Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rocket.chat/message-parser

Package Overview
Dependencies
Maintainers
0
Versions
617
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rocket.chat/message-parser

Rocket.Chat parser for messages

  • 0.31.31
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
678
decreased by-17.11%
Maintainers
0
Weekly downloads
 
Created
Source

Rocket.Chat

@rocket.chat/message-parser

Rocket.Chat parser for messages


npm@latest npm@next npm downloads License: MIT

deps npm bundle size

Description

Rocket.Chat grammar with the purpose of parsing the messages of the rocket chat, converting text to an AST tree.

The grammar provides support for markdown, mentions and emojis.

Supported markup

  • quotes
  • bold/italic/strike
  • ordered lists
  • unordered lists
  • task lists
  • phone numbers
  • mentions
  • emoji
  • colors
  • URI's
  • mentions users/channels
  • timestamps

Timestamps

The timestamp tag is a special tag that allows you to convert a Unix timestamp to a human-readable date and time.

Timestamps are allowed inside strike elements.

Usage

Pattern: <t:{timestamp}:?{format}>

  • {timestamp} is a Unix timestamp
  • {format} is an optional parameter that can be used to customize the date and time format.
Formats
FormatDescriptionExample
tShort time12:00 AM
TLong time12:00:00 AM
dShort date12/31/2020
DLong dateThursday, December 31, 2020
fFull date and timeThursday, December 31, 2020 12:00 AM
FFull date and time (long)Thursday, December 31, 2020 12:00:00 AM
RRelative time1 year ago

Contributing

Contributions, issues, and feature requests are welcome!
Feel free to check the issues.

Whenever you find a grammar-related bug, start by inserting the test case.

We are open to other tags/markups, as long as they don't generate unexpected behavior.

Observations and known issues

  • Nested lists are unsupported
  • URL rule doesn't allow whitespace, (, or )

FAQs

Package last updated on 10 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc