Components/MarkdownView Markdown
Universal Component

MarkdownView Markdown

Markdown HTML sanitize

This page was migrated by AI, please review carefully

Migration is complete, but please validate against source code and manual review.

MarkdownView Markdown

Markdown HTML sanitize

import { ref } from 'vue' const content = ref( '# Title\n\n- item 1\n- item 2\n\n`inline code`\n\n```ts\nconst a = 1\n```\n\n> Quote', ) const richContent = ref( [ '# Heading 1', '## Heading 2', '', 'This is **bold**, *italic*, ~~strikethrough~~, and a [link](https://github.com).', '', '- Unordered item', ' - Nested item', '- [x] Task done', '- [ ] Task todo', '', '1. First ordered', '2. Second ordered', '', '> Blockquote with multiple lines', '>', '> - Quote item', '> - Another item', '', '---', '', '| Feature | Value |', '| --- | --- |', '| Table | Supported |', '| Inline code | `const a = 1` |', '', '```ts', 'export const sum = (a: number, b: number) => a + b', '```', ].join('\n'), )

Basic Usage

MarkdownView

Demo loads on client.

Render Examples

Common Markdown Structures

Demo loads on client.

Theme Preview

Light / Dark

Demo loads on client.

API

Props

PropTypeDefaultDescription
contentstringTextDescription for content.
sanitizebooleantrueDescription for sanitize.
themeauto | light | darkautoText(auto Text data-theme/class,TextDefault light)
Was this helpful?