Initial commit
This commit is contained in:
commit
2f5e10140c
133 changed files with 10429 additions and 0 deletions
19
packages/core/markdown/src/text.tsx
Normal file
19
packages/core/markdown/src/text.tsx
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { createMemo } from "solid-js";
|
||||
|
||||
import {
|
||||
ensureMarkdownStyles,
|
||||
parseMarkdownBlocks,
|
||||
renderBlocks,
|
||||
} from "./markdown";
|
||||
|
||||
export type TextProps = {
|
||||
value: string;
|
||||
};
|
||||
|
||||
export default function Text(props: TextProps) {
|
||||
ensureMarkdownStyles();
|
||||
|
||||
const blocks = createMemo(() => parseMarkdownBlocks(props.value));
|
||||
|
||||
return <div class="tm-md-root">{renderBlocks(blocks())}</div>;
|
||||
}
|
||||
Loading…
Reference in a new issue