Expand description
The portable Markdown subset a message’s text is written in, and its translations.
Inline: **bold**, *italic* or _italic_, `code`, [text](url) and backslash
escapes (\*). Lines: a line starting with - or * is a bullet; other lines are text,
kept as written (line breaks matter in chat). There are no headings and no tables: the title
is separate.
Core escapes every value a template interpolates (escape), so a value containing * or
_ stays literal. Each destination translates with one of the to_* functions.
Enums§
Functions§
- escape
swith every character that means something in the subset backslash-escaped.- fit
text(portable Markdown) translated withtranslate, fitting inmaxcharacters: when the translation is too long, whole lines are dropped from the end of the source before translating, so a cut never lands inside the dialect’s markup, andmarker(already in the dialect) is appended. The second value says whether it was cut.- html_
escape tsafe as HTML text or an attribute value.- parse
- Parse
textline by line. - to_
google_ chat - Google Chat’s text formatting (the same marks as Slack’s).
- to_html
- An HTML fragment: lines become paragraphs (consecutive lines joined by
<br>), bullets a list. - to_
plain - Plain text: marks removed, links as
text (url), bullets as-. - to_
slack - Slack’s
mrkdwn, which has no escapes:&,<and>become entities, and literal*,~and`become look-alikes so they can’t start formatting. - to_
teams - The Markdown Microsoft Teams renders in an Adaptive Card text block.
- truncate
textcut to at mostmaxcharacters includingmarker, at a line break when one is close enough;Nonewhen it already fits.