Calm motion: animations on this site only fade, with no movement
Markdown
Markdown text, safely rendered
Shows Markdown text, such as a comment, a release note, or a message from a model, with the type of the library. Edit the text on the left to see it change. For code with a copy button and line numbers, use the code block. To let people write rich text, use the editor.
Basic
Episode 12
Megumi's final route is set. Notes from the script meeting:
- Rewrite the ending
- Check the art with Eriri
- Read the schedule and the studio site
A heroine who does not stand out is still a heroine.
| Day | Task | Hours |
|---|---|---|
| Mon | Script | 6 |
| Tue | Art | 8 |
const route = "Megumi";<script>alert("raw HTML stays text")</script>- Install marked and pass its
lexer:import { lexer } from "marked". The library never loads marked itself, so an app that does not use this component needs no marked. - The component builds each element itself and never sets HTML from the text. Raw HTML in the text, such as
<script>, shows as the text that was written. - Only
http:,https:,mailto:,tel:, and relative links become links, and only those images load. Other links, such asjavascript:, keep their text and do not link. - A link to a path in your app, such as
/docs, uses your router when you provide its link component. A link to another site opens in a new tab. levelsets the HTML level of a#heading (default 2), so the text does not add a second<h1>to your page. Deeper headings follow, up to<h6>.- It supports GFM: tables with column alignment, task lists (as disabled checkboxes), and
strikethrough. - Code blocks get a
language-*class, so you can add a highlighter. The component does not color code.
Usage
ts
import { BlessMarkdown } from "blessing-ui";
import { lexer } from "marked";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
source* | string | — | the Markdown text |
lexer* | (source: string) => Token[] | — | turns the text into tokens: pass `lexer` from marked (`import { lexer } from "marked"`) |
level | 1 | 2 | 3 | 4 | 5 | 6 | 2 | the HTML level of a `#` heading; deeper ones follow, up to h6 |