feat: support markdown
This commit is contained in:
parent
bd230ddd4f
commit
85d144a1e9
34 changed files with 2350 additions and 4 deletions
27
ui/components/Markdown/renderer/break.tsx
Normal file
27
ui/components/Markdown/renderer/break.tsx
Normal file
|
@ -0,0 +1,27 @@
|
|||
import { css, cx } from "@emotion/css";
|
||||
import type { Break } from "@yozora/ast";
|
||||
import React from "react";
|
||||
import { astClasses } from "../context";
|
||||
|
||||
/**
|
||||
* Render `break`.
|
||||
*
|
||||
* @see https://www.npmjs.com/package/@yozora/ast#break
|
||||
* @see https://www.npmjs.com/package/@yozora/tokenizer-break
|
||||
*/
|
||||
export class BreakRenderer extends React.Component<Break> {
|
||||
public override shouldComponentUpdate(): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
public override render(): React.ReactElement {
|
||||
return <br className={cls} />;
|
||||
}
|
||||
}
|
||||
|
||||
const cls = cx(
|
||||
astClasses.break,
|
||||
css({
|
||||
boxSizing: "border-box",
|
||||
}),
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue