Vue Simple Markdown Component

1.1.5 · maintenance · verified Tue Apr 21

Vue Simple Markdown is a lightweight and performant Markdown parsing component specifically designed for Vue.js 2 applications. Currently at version 1.1.5, the package's last publish was 5 years ago, indicating it is no longer actively maintained but remains stable for existing Vue 2 projects. It provides a `<vue-simple-markdown>` component that accepts a `source` prop containing Markdown text and renders it as HTML. Its key differentiators include highly configurable parsing options via numerous boolean props (e.g., `emoji`, `heading`, `highlight`, `table`, `lists`), allowing developers to enable or disable specific Markdown features. While it offers integration with `highlightjs` for syntax highlighting, `highlightjs` itself needs to be installed and managed by the user. The library focuses on simplicity and speed for transforming Markdown within Vue 2 environments.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to install, globally register, and use the `<vue-simple-markdown>` component with various props to render a markdown string in a Vue 2 application.

import Vue from 'vue';
import VueSimpleMarkdown from 'vue-simple-markdown';
import 'vue-simple-markdown/dist/vue-simple-markdown.css';

// Optional: For syntax highlighting with the 'highlight' prop,
// you'd typically install and import highlight.js and its themes:
// import 'highlight.js/styles/github.css';
// import hljs from 'highlight.js';
// Vue.directive('highlightjs', { /* ... directive setup ... */ });

Vue.use(VueSimpleMarkdown);

new Vue({
  el: '#app',
  data: {
    markdownSource: `# Hello Vue Simple Markdown!

This is a paragraph with **bold** and *italic* text.

## Features

*   Emoji support :)
*   Code blocks:

    ```javascript
    console.log('Hello, world!');
    const name = 'Vue';
    ```

| Header 1 | Header 2 |
|----------|----------|
| Cell 1   | Cell 2   |
| Cell 3   | Cell 4   |
`,
  },
  template: `
    <div id="app">
      <h1>Markdown Preview</h1>
      <vue-simple-markdown
        :source="markdownSource"
        :highlight="true"
        :emoji="true"
        :table="true"
      />
    </div>
  `,
});

view raw JSON →