packages/message-parser/README.md
@rocket.chat/message-parserRocket.Chat parser for messages
<!--/header-->
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.
GFM-style tables. A leading and trailing pipe is required on every row. Alignment is taken from the delimiter row:
| Marker | Alignment |
|---|---|
:--- | left |
:--: | center |
---: | right |
--- | none |
| Header 1 | Header 2 |
| -------- | :------: |
| Cell 1 | Cell 2 |
A literal pipe inside a cell must be escaped as \|. Cell content supports
inline markup (bold, italic, links, emoji, …).
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.
Pattern: <t:{timestamp}:?{format}>
| Format | Description | Example |
|---|---|---|
t | Short time | 12:00 AM |
T | Long time | 12:00:00 AM |
d | Short date | 12/31/2020 |
D | Long date | Thursday, December 31, 2020 |
f | Full date and time | Thursday, December 31, 2020 12:00 AM |
F | Full date and time (long) | Thursday, December 31, 2020 12:00:00 AM |
R | Relative time | 1 year ago |
Contributions, issues, and feature requests are welcome!
Feel free to check the issues.
<!--/contributing(msg)-->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.
URL rule doesn't allow whitespace, (, or )