disable newly deprecated stuff

This commit is contained in:
James Brumond 2023-05-18 21:27:09 -07:00
parent 4274045fca
commit e40db445a5
Signed by: james
GPG Key ID: E8F2FC44BAA3357A
2 changed files with 3 additions and 6 deletions

View File

@ -30,6 +30,8 @@ export async function render_markdown_to_html(markdown: string, options: Markdow
async: true, async: true,
breaks: options.breaks || false, breaks: options.breaks || false,
renderer: create_renderer(options), renderer: create_renderer(options),
mangle: false,
headerIds: false,
}; };
marked.use({ marked.use({

View File

@ -28,14 +28,9 @@ export function create_renderer(opts: MarkdownOptions) {
} }
function heading(renderer: marked.Renderer, opts: MarkdownOptions) { function heading(renderer: marked.Renderer, opts: MarkdownOptions) {
return function(orig_text: string, level: 1 | 2 | 3 | 4 | 5 | 6, raw: string, slugger) { return function(orig_text: string, level: 1 | 2 | 3 | 4 | 5 | 6, raw: string) {
let { text, id, html_attrs } = parse_attributes(raw); let { text, id, html_attrs } = parse_attributes(raw);
if (! id) {
id = slugger.slug(text);
html_attrs.push(`id="${id}"`);
}
return ` return `
<h${level} ${html_attrs.join(' ')}> <h${level} ${html_attrs.join(' ')}>
${text} ${text}