npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@xihe-lab/tapd-markdown

v1.0.0

Published

TAPD rich text (TinyMCE HTML dialect) ↔ Markdown bidirectional lossless converter: semantic primitives for @mentions/attachment anchors, GFM mapping, inline-HTML passthrough

Readme

@xihe-lab/tapd-markdown

TAPD 富文本(TinyMCE HTML 方言)↔ Markdown 双向转换器:@xihe-lab/tapd-cli 与 @xihe-lab/tapd-mcp-server 共享的转换内核。

安装

npm install @xihe-lab/tapd-markdown

能力

  • 转换引擎:mdToHtml(md) / htmlToMd(html)——markdown-it + turndown,GFM(表格/任务列表/删除线)+ TAPD 语义接线(保真规则优先于 GFM)
  • 无损开关:htmlToMdLossless(html)——GFM 可表达者转 md,不可表达者(sub/sup/mark/u/font/span[style]/div[style])行内 HTML 原样保留;默认 htmlToMd 维持有损行为(向后兼容)
  • sanitize:sanitizeTapdHtml(html)——剥除 <script>/<style>/<iframe>(对齐 TAPD 服务端策略),两条读侧路径入口均已内置
  • 语义原语:@提及(at-who 标记 ↔ md @语法,含 @@ 转义、CJK 边界、代码段/URL 防误伤)、附件锚点(data 五件套 ↔ [📎 名称](attach:<ws>/<id>))、HTML 字面量转义
  • 真值模型:HTML 为真值、md 为可编辑投影;GFM 不可表达的内容行内 HTML 保留(round-trip 无损策略),保留标签经 mdToHtml 往返不丢

使用

import { mdToHtml, htmlToMd, htmlToMdLossless } from '@xihe-lab/tapd-markdown';

mdToHtml('请 @徐昭 今天内确认,附件 [📎 设计稿](attach:39814312/xxx)');
htmlToMd('<b class="at-who" data-userid="徐昭">@徐昭</b> 已确认');

// 无损模式:GFM 不可表达标签保留原始 HTML(默认 htmlToMd 会降为纯文本内容)
htmlToMdLossless('<p><sub>下标</sub><mark>高亮</mark></p>');
// → '<sub>下标</sub><mark>高亮</mark>'

依赖关系

转换内核由 @xihe-lab/tapd-core 消费并经其工具管道(tapd_md_to_html / tapd_html_to_md 及富文本写管道)透出;命令行与 MCP 入口见 @xihe-lab/tapd-cli 与 @xihe-lab/tapd-mcp-server。

仓库与镜像

License

Apache-2.0