Markdown

Markdown renderer for rich formatted content, with headings, lists, tables, code blocks, and KaTeX math expressions out of the box.

import { Markdown } from "@plexui/vue/components/Markdown";

Examples

Overview

Math

API

PropTypeDefaultDescription
default slotstring—Markdown source (text only; interpolate a string to keep its newlines)
sourcestring—Markdown source, used when the default slot is empty
include-mathbooleanfalseEnable LaTeX math rendering
break-new-linesbooleanfalseTurn single newlines into line breaks
copyable-code-blocksbooleantrueShow a copy button on code blocks
collapsible-code-blocksbooleantrueRender code blocks in the collapsible view with a View Code button
componentsRecord<string, MarkdownComponent>—Tag name to component overrides, applied over the built-in ones
directivesMarkdownDirective[]—Custom directives, each rendered by its own component
remark-pluginsPluggableList—Extra remark plugins, after the built-in ones
rehype-pluginsPluggableList—Extra rehype plugins
allowed-elementsstring[]—Only render these elements
disallowed-elementsstring[]—Never render these elements
skip-htmlbooleanfalseIgnore raw HTML in the source
url-transform(url: string) => string—Rewrites URLs; the default drops unsafe protocols (javascript:) and keeps tel: and sms:
classstring—Applied to the wrapping element

Styling

Markdown has no component tokens of its own. It reads the shared semantic color, typography and spacing tokens listed in Design tokens, so it follows theme changes made there.