Detalhes do pacote

@mdit-vue/shared

mdit-vue93.4kMIT2.1.4

Shared utils and types of mdit-vue

markdown-it, vue, utils

readme (leia-me)

mdit-vue

mdit-vue

github check coverage license

markdown-it plugins for Vue.js

Why?

As we know, Markdown could be converted into HTML, and raw HTML is supported by most of the Markdown parsers.

Since the Vue template syntax is HTML-based, and all Vue templates are syntactically valid HTML, it's quite straight forward to think that we could use Vue template syntax in Markdown.

Unlike JSX, Vue template syntax is naturally compatible with Markdown syntax, so we don't have to make lots of extensions or limitations to Markdown syntax like MDX. However, we still need to make some modifications to the parser so that Markdown could have more fun with Vue.

There has been lots of projects that built with this idea, but they are using different ways to modify the Markdown parsers. Most of them don't strictly follow the Markdown specification and have various minor errors.

This project is here to provide some unified plugins for markdown-it, one of the most popular markdown parsers in JS world, to make it work better with Vue.

Packages

Package Version (click for changelogs)
@mdit-vue/plugin-component plugin-component version
@mdit-vue/plugin-frontmatter plugin-frontmatter version
@mdit-vue/plugin-headers plugin-headers version
@mdit-vue/plugin-sfc plugin-sfc version
@mdit-vue/plugin-title plugin-title version
@mdit-vue/plugin-toc plugin-toc version

Who is using?

This project was originally extracted from Vue's official project, and maintained by Vue team members. It is supporting many awesome projects:

License

MIT © mdit-vue Contributors

changelog (log de mudanças)

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

2.1.4 (2025-04-10)

Bug Fixes

  • plugin-frontmatter: extract frontmatter in parse step (close #13) (#14) (1192bd2)

2.1.3 (2024-05-13)

Note: Version bump only for package @mdit-vue/monorepo

2.1.2 (2024-04-15)

Bug Fixes

  • sync markdown-it types updates (#9) (f6768b1)

2.1.1 (2024-04-13)

Bug Fixes

  • plugin-component: inline html block tags to make cjs build work (eb1a264)

2.1.0 (2024-04-08)

Features

  • upgrade markdown-it types to v14 (6839be8)

2.0.0 (2023-12-08)

Features

BREAKING CHANGES

  • bump to markdown-it 14

1.0.0 (2023-09-26)

Bug Fixes

  • plugin-toc: remove duplicate itemClass (#7) (7e0f1f0)

BREAKING CHANGES

  • drop support for node 16

0.12.1 (2023-08-24)

Note: Version bump only for package mdit-vue

0.12.0 (2023-02-10)

Features

  • plugin-headers: add shouldAllowNested option (93e004d)
  • plugin-toc: add shouldAllowNested option (close #5) (1f3b867)
  • shared: add shouldAllowNested option for resolveHeadersFromTokens (9363b92)

0.11.2 (2022-12-23)

Bug Fixes

  • shared: avoid resolve headers in nested blocks (ce146bd)

0.11.1 (2022-08-30)

Note: Version bump only for package mdit-vue

0.11.0 (2022-08-25)

Features

  • plugin-sfc: extract all script blocks (8c39df6)

0.10.0 (2022-08-23)

Features

  • plugin-headers: resolve link property for headers (da2954f)
  • types: add link property to header (7461417)

0.9.4 (2022-08-23)

Bug Fixes

  • plugin-component: handle multiline component tags correctly (53724fa)

0.9.3 (2022-08-20)

Bug Fixes

  • plugin-headers: avoid headers being overridden by another rendering (de1030b)
  • plugin-title: avoid title being overridden by another rendering (43cc020)

0.9.2 (2022-08-18)

Bug Fixes

  • plugin-toc: avoid toc being overridden by another rendering (c145c26)

0.9.1 (2022-07-26)

Bug Fixes

  • plugin-sfc: expose MarkdownSfcBlocks type (c2a91de)

0.9.0 (2022-07-26)

Features

  • plugin-sfc: extract SFC blocks as structured data (5a0aa54)

BREAKING CHANGES

  • plugin-sfc: the type of env.sfcBlocks has been changed

0.8.1 (2022-07-22)

Bug Fixes

  • plugin-component: make component tags behave like inline tags in some cases (9db6f9c)

0.8.0 (2022-07-22)

Features

  • plugin-component: add blockTags and inlineTags options (4651422)

0.7.1 (2022-07-20)

Note: Version bump only for package mdit-vue

0.7.0 (2022-07-18)

Features

  • plugin-frontmatter: extract content without frontmatter into env.content (a9d5cef)

0.6.0 (2022-07-11)

Features

  • types: extract types from shared package (5fc56ce)

0.5.0 (2022-07-06)

Features

  • plugin-frontmatter: add frontmatter plugin (bcffc7a)

0.4.0 (2022-07-02)

Features

  • plugin-headers: add headers plugin (636aa9b)
  • plugin-title: add title plugin (662e153)

0.3.1 (2022-06-25)

Bug Fixes

  • plugin-toc: export types (310320e)

0.3.0 (2022-06-25)

Features

  • plugin-toc: add toc plugin (e64cc2c)
  • shared: add html escape and unescape utils (e1103c2)

0.2.0 (2022-06-23)

Features

  • plugin-sfc: add sfc plugin (1eb4e0a)
  • shared: add shared package (9e36bdc)

0.1.1 (2022-06-23)

Bug Fixes

  • plugin-component: add js extension to work with esm (42ccdad)

0.1.0 (2022-06-22)

Features

  • plugin-component: add component plugin (cd2eeaa)