Vue-markdown is a component designed for Vue.js applications (specifically Vue 2.x) that provides robust and high-speed parsing and rendering of Markdown content. The current stable version, 2.2.4, was released approximately seven years ago and primarily supports the Vue 2 ecosystem. It offers extensive Markdown syntax support including GFM task lists, tables, automatic table of contents generation, emojis, footnotes, and allows for integration with external libraries like Prism for syntax highlighting and KaTeX for mathematical expressions. Key differentiators include its rich feature set for extended Markdown and its direct component-based integration for Vue 2. However, the package is no longer actively maintained, making it unsuitable for modern Vue 3+ projects, which would require alternative solutions or manual integration of a generic Markdown parser.
npm install vue-markdownVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to integrate `vue-markdown` into a Vue 2 application, allowing users to input Markdown in a textarea and see it rendered dynamically below. It highlights component registration and binding the `source` prop.
For Vue 3 projects, consider using alternative markdown parsing libraries designed for Vue 3 (e.g., `@kangc/v-md-editor`) or integrate a generic markdown parser (like `markdown-it`) with Vue's `v-html` directive, ensuring proper sanitization.
For any new projects, or if stability and security are critical, migrate to a actively maintained markdown parsing solution. For existing Vue 2 projects, understand the risks and consider isolating its usage or replacing it if security becomes a concern.
Always use the `:source` prop (e.g., `<vue-markdown :source="myMarkdownString"></vue-markdown>`) if your Markdown content is dynamic and needs to react to changes. Only use the default slot for static, unchanging Markdown directly within the template.
Ensure `import Vue from 'vue'` is at the top of your script if you are in a module environment (e.g., a Vue CLI project or using Webpack/Vite).
For syntax highlighting, you need to include a library like Prism.js and its CSS. For KaTeX, include the KaTeX CSS (`https://unpkg.com/katex/dist/katex.min.css`) in your HTML or import it globally.
Provide your dynamic Markdown content through the `:source` prop of the `vue-markdown` component instead of placing it directly within the `<vue-markdown>` tags. For example, use `<vue-markdown :source="myDynamicMarkdown"></vue-markdown>`.
No dependency data recorded yet.