west Home
light_mode
MumpUI / Component / Markdown

MarkedJS is required for markdown rendering. Import the script as shown below

<html>
  <head>
    ..
  </head>
  <body>
    ..
    <script src="https://cdn.jsdelivr.net/npm/marked@12.0.2/lib/marked.umd.min.js"></script>
  </body>
</html>
Render markdown as HTML
copy
code  Show code

Title

Hello there!

Demo →

Markdown component props
NameTypeUsage
..All div element props
contentstring
Fetch markdown file
copy
const md = await MD.fetch('/typography.md')
Add JSON meta data in markdown content
copy
```
{
  "name": "markdown"
}
```

<!-- meta-break -->

# Title

Hello there!
Parse content & meta data from a markdown content
copy
const { meta, content } = MD.parse(md)