updates to markdown processing to allow custom elements
This commit is contained in:
@@ -4,7 +4,7 @@ import { create_renderer } from './renderer';
|
||||
import { mark_ext } from './mark';
|
||||
import { section_ext } from './section';
|
||||
import { icon_ext } from './icon';
|
||||
import { sanitize_html } from './html-sanitize';
|
||||
import { CustomElementHandling, sanitize_html } from './html-sanitize';
|
||||
import { katex_block_ext, katex_inline_ext } from './katex';
|
||||
import { footnote_list_ext, footnote_ref_ext } from './footnotes';
|
||||
import { description_list_ext } from './description-list';
|
||||
@@ -16,6 +16,7 @@ export interface MarkdownOptions {
|
||||
inline?: boolean;
|
||||
katex_macros?: Record<string, string>;
|
||||
extensions?: MarkdownExtension[];
|
||||
custom_elements?: CustomElementHandling;
|
||||
}
|
||||
|
||||
export interface MarkdownExtension {
|
||||
@@ -64,5 +65,5 @@ export async function render_markdown_to_html(markdown: string, options: Markdow
|
||||
});
|
||||
});
|
||||
|
||||
return sanitize_html(unsafe_html);
|
||||
return sanitize_html(unsafe_html, options.custom_elements);
|
||||
}
|
||||
|
Reference in New Issue
Block a user