pub enum Channel {
TelegramHtml,
SlackMarkdown,
GithubMarkdown,
NotionMarkdown,
Plain,
Html,
}Expand description
Target channel. Each channel accepts a different syntax, and the narrower output decides the parsing scope.
Variants§
TelegramHtml
Telegram parse_mode=HTML. Nine allowed tags:
b i u s code pre a blockquote tg-spoiler. No tables or headings. 4096 characters.
SlackMarkdown
Slack markdown_text. Slack converts standard Markdown itself. 12,000 characters.
Almost no conversion is needed; what is left is normalization and splitting.
GithubMarkdown
GitHub comments and PR bodies (GFM). Renders tables, headings, and strikethrough.
65,536 characters. Emits the same Markdown as Slack, but escapes the two characters GFM
reads as syntax (~ <).
NotionMarkdown
Notion page body (Notion-flavored Markdown — the API markdown field and connectors).
Four heading levels. Emits the same Markdown as GitHub, but strips inline HTML Notion
cannot render (it would show as text), and writes autolinks <url> as [url](url) (the
angle brackets would remain as text). Emphasis before a Korean particle is rendered by
Notion as is, so it is not turned into <strong> — doing so would make the tag show as text.
Plain
Strips all markup. The fallback path.
Html
An HTML fragment for the browser. Renders headings, lists, tables, and code blocks as tags. No limit.
Assumes the output goes straight into innerHTML — all text is escaped, HTML from the
source survives only as inline tags with their attributes dropped, and only http(s) and
mailto links become <a>. Appending Streamer::close_open to the streaming
accumulated output gives a shape that can be inserted as is.