mirror of
https://github.com/docmost/docmost.git
synced 2025-11-16 22:01:10 +10:00
📝 Add docstrings to feat/typst
Docstrings generation was requested by @Vito0912. * https://github.com/docmost/docmost/pull/1652#issuecomment-3353711947 The following files were modified: * `apps/client/src/features/editor/components/typst/typst-block.tsx` * `apps/client/src/features/editor/components/typst/typst-menu.tsx` * `apps/client/src/features/editor/page-editor.tsx` * `apps/server/src/collaboration/collaboration.util.ts` * `packages/editor-ext/src/lib/markdown/utils/marked.utils.ts`
This commit is contained in:
committed by
GitHub
parent
3135030376
commit
035e21e211
@ -2,6 +2,7 @@ import { marked } from "marked";
|
||||
import { calloutExtension } from "./callout.marked";
|
||||
import { mathBlockExtension } from "./math-block.marked";
|
||||
import { mathInlineExtension } from "./math-inline.marked";
|
||||
import { typstBlockExtension } from "./typst-block.marked";
|
||||
|
||||
marked.use({
|
||||
renderer: {
|
||||
@ -29,9 +30,23 @@ marked.use({
|
||||
});
|
||||
|
||||
marked.use({
|
||||
extensions: [calloutExtension, mathBlockExtension, mathInlineExtension],
|
||||
extensions: [
|
||||
calloutExtension,
|
||||
mathBlockExtension,
|
||||
mathInlineExtension,
|
||||
typstBlockExtension,
|
||||
],
|
||||
});
|
||||
|
||||
/**
|
||||
* Converts Markdown text to HTML.
|
||||
*
|
||||
* The function removes an optional leading YAML front matter block, trims leading whitespace,
|
||||
* parses the remaining Markdown with line-breaks enabled, and returns the resulting HTML.
|
||||
*
|
||||
* @param markdownInput - Markdown source text; may include a leading YAML front matter section delimited by `---`.
|
||||
* @returns The generated HTML string produced from the parsed Markdown.
|
||||
*/
|
||||
export function markdownToHtml(
|
||||
markdownInput: string,
|
||||
): string | Promise<string> {
|
||||
|
||||
Reference in New Issue
Block a user