@webority/markdown-core
The one markdown grammar every Webority renderer reads. It turns a markdown string into blocks and
inline tokens, decides what a link may open, and extracts plain text. It draws nothing and touches
no platform API, so AppMarkdown (React), <wui-markdown> and <app-markdown> (Razor pages) and
the phone Markdown all draw the same document from the same rules.
| Export | What it does |
|---|---|
parseMarkdown(source) | the blocks: paragraph, heading, list (nested by depth), table, code, quote, rule |
parseInline(text) | the inline tokens: text, code, strong, em, strike, link, image |
linkTarget(href, links, resolveLink) | what a link opens: an app route, a web address, a mail or phone address, or nothing |
webRoute(target) | the web route of a resolved app link |
markdownToPlainText(source) | the text a screen reader, a preview or a search index reads |
links is "web" (open web, mail and phone addresses) or "app" (open only what resolveLink
resolves to an in-app route). Chat replies use "app", because model output must not send a
person off the app.