@webority/markdown-core

中文文档
0.119.0发布于 2026/11/03SEE LICENSE IN LICENSETypeScriptES Module零依赖

The one markdown grammar every Webority renderer reads: block and inline parsing, the link rule and plain-text extraction. No UI and no platform code, so web, Razor and phone renderers draw the same document.

原始使用文档

@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.

ExportWhat 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.

版本与发布记录

@webority/markdown-core 共发布 10 个版本,首次发布于 2026/11/02;过去 12 个月发布了 10 个版本。

版本发布日期距今
0.119.0latest2026/11/03今天
0.118.02026/11/03今天
0.117.02026/11/03今天
0.116.02026/11/02今天
0.115.02026/11/02今天
0.114.02026/11/021 天前

关于 @webority/markdown-core 的常见问题

@webority/markdown-core 是什么?

每个webbority渲染器读取的一个标记语法:块和内联解析、链接规则和纯文本提取。没有UI和平台代码,所以web, Razor和手机渲染器绘制相同的文档。

如何安装 @webority/markdown-core?

在项目目录运行 npm install @webority/markdown-core,或使用 pnpm add / yarn add / bun add。

@webority/markdown-core 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@webority/markdown-core 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@webority/markdown-core 可以商用吗?

@webority/markdown-core 使用 SEE LICENSE IN LICENSE 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@webority/markdown-core 还在维护吗?

最新版本 0.119.0 发布于 2026/11/03(今天);至今共发布 10 个版本,其中过去 12 个月发布了 10 个;首次发布于 2026/11/02。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。