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 🙏

© 2025 – Pkg Stats / Ryan Hefner

vue-markdown-unified

v1.0.0

Published

Vue3 VNode to render markdown

Readme

vue-markdown-unified

vue-markdown-unified

Vue3 VNode to render markdown.

功能量带你

  • [x] 默认安全(无攻击或 XSS 攻击) (no dangerouslySetInnerHTML or XSS attacks)
  • [x] 组件 组件(传递您自己的组件以使用,而不是 <h2> for ## hi)
  • [x] 插件 (内置插件,并且可以设置插件,您可以 unified 生态中选择许多插件)
  • [x] 兼容 (100% 符合 CommonMark,100% 符合 GFM,带插件)

安装

pnpm add vue-markdown-unified
# 或
npm install vue-markdown-unified

基本用法

import { Markdown } from "vue-markdown-unified";

const vnode = Markdown("# Hello World", {
  enableLatex: true,
});

可用参数与类型

MarkdownProps

| 参数名 | 类型 | 说明 | | ------------------- | ------------------------- | -------------------------------------------------- | | content | string | 要渲染的 Markdown 内容 | | animated | boolean | 是否启用打字机等动画效果,默认 false | | enableSanitize | boolean | 是否对输出内容进行 HTML 安全过滤,默认 false | | isBreaks | boolean | 是否将软换行视为真实换行(GFM 风格),默认 false | | enableLatex | boolean | 是否启用 KaTeX 数学公式渲染,默认 false | | allowHtml | boolean | 是否允许 Markdown 中的原始 HTML,默认 false | | remarkPlugins | Pluggable[] | 额外的 remark 插件(Markdown 解析阶段) | | rehypePlugins | Pluggable[] | 额外的 rehype 插件(HTML/AST 处理阶段) | | remarkRehypeOptions | Record<string, unknown> | remark-rehype 转换的额外参数 | | components | Components | 自定义渲染组件映射 | | prismOptions | PrismOptions | PrismJS 代码高亮相关配置 |

PrismOptions

| 参数名 | 类型 | 说明 | | --------------- | --------------------- | ------------------------------------------------------ | | ignoreMissing | boolean | 忽略未注册的语言,默认 false | | defaultLanguage | string | 未指定语言时的默认高亮语言 | | showLineNumbers | boolean \| string[] | 是否显示代码行号,或指定哪些语言显示行号,默认 false |

相关类型

代码高亮主题

你可以在入口文件中手动引入主题样式:

import "vue-markdown-unified/dist/themes/prism-coy.css";

如需更详细的类型定义,请参考源码中的 src/types.ts 文件,或在编辑器中获得类型提示。