disable newly deprecated stuff
This commit is contained in:
parent
4274045fca
commit
e40db445a5
@ -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({
|
||||||
|
@ -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}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user