# vue-markdown **Repository Path**: yuguaa/vue-markdown ## Basic Information - **Project Name**: vue-markdown - **Description**: Vue component that render markdown using unified - **Primary Language**: TypeScript - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-05-22 - **Last Updated**: 2025-05-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # @crazydos/vue-markdown [![npm version](https://img.shields.io/npm/v/@crazydos/vue-markdown.svg)](https://www.npmjs.com/package/@crazydos/vue-markdown) [![npm downloads](https://img.shields.io/npm/dm/@crazydos/vue-markdown.svg)](https://www.npmjs.com/package/@crazydos/vue-markdown) [![License](https://img.shields.io/github/license/nuxt/nuxt.svg)](https://github.com/shunnNet/vue-markdown/blob/main/LICENSE) This is a package that provide Vue 3+ component to render markdown content with [`unified`](https://github.com/unifiedjs/unified) pipeline. And is referenced from [`react-markdown`](https://github.com/remarkjs/react-markdown). - [@crazydos/vue-markdown](#crazydosvue-markdown) - [Features](#features) - [Online example \& playground](#online-example--playground) - [Migration: for `v0.x` users:](#migration-for-v0x-users) - [Use named import](#use-named-import) - [Slot prefix](#slot-prefix) - [Install](#install) - [Unified plugins version](#unified-plugins-version) - [Usages](#usages) - [Basic](#basic) - [Rendering `GFM`](#rendering-gfm) - [Custom attributes](#custom-attributes) - [Customize tag rendering with scoped slot](#customize-tag-rendering-with-scoped-slot) - [re-render issue](#re-render-issue) - [Use `` in markdown](#use-slot-in-markdown) - [Security](#security) - [Documentation](#documentation) - [`` Props](#vuemarkdown-props) - [`scoped slot` and `custom attrs`](#scoped-slot-and-custom-attrs) - [Attributes aliases](#attributes-aliases) - [Code content example](#code-content-example) - [Reference](#reference) - [License](#license) ## Features - 🌴 Use [unified](https://github.com/unifiedjs/unified) to render Markdown (CommonMark) - 🪑 Supports rendering of additional elements (i.e: GFM: `tables`, `footnotes`, `task lists` etc.) through [remark](https://github.com/remarkjs/remark) and [rehype](https://github.com/rehypejs/rehype) plugins. - :hammer_and_wrench: Allows customization of tag attributes for markdown elements. (i.e: `class`, `target`, `rel` etc.) - 🛃 Enables customization of markdown element rendering through Vue `scoped slot`. - 🚀 Support rendering Vue component in markdown (need `rehype-raw`) - 🛡️ Safely renders markdown to prevent harmful content by `rehype-sanitize` - 📝 Fully typed with TypeScript for better developer experience and type safety. > [!TIP] > If this package has been helpful to you, feel free to [support me on Buy Me a Coffee](https://buymeacoffee.com/shunnnet) ~ Buy Me A Coffee ## Online example & playground For more usage examples and detailed plugin configuration, please refer to the [usage examples on Stackblitz](https://stackblitz.com/edit/nuxt-starter-xvieezcs?file=pages%2Findex.vue). [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/edit/nuxt-starter-xvieezcs?file=pages%2Findex.vue) ## Migration: for `v0.x` users: Thank you to the users of `v0.x` for motivating me to continue this project. It is now recommended to upgrade to version `v1.x`. There are no significant differences between `v1.x` and `v0.x`, but `v1.x` has upgraded `unified` and enhanced TypeScript support. To migrate to v1.x, please make the following adjustments: ### Use named import v0.x: ```ts import VueMarkdown from "@crazydos/vue-markdown" ``` v1.x ```ts import { VueMarkdown } from "@crazydos/vue-markdown" ``` ### Slot prefix The syntax for the `` tag has changed. Slot name now need add prefix `s-` as follows: v0.x: ```html