docs: fix heading renderer example (#3392)
This commit is contained in:
parent
0a3b2569fa
commit
ead7af34a5
@ -72,7 +72,8 @@ import { marked } from 'marked';
|
|||||||
|
|
||||||
// Override function
|
// Override function
|
||||||
const renderer = {
|
const renderer = {
|
||||||
heading(text, depth) {
|
heading({ tokens, depth }) {
|
||||||
|
const text = this.parser.parseInline(tokens);
|
||||||
const escapedText = text.toLowerCase().replace(/[^\w]+/g, '-');
|
const escapedText = text.toLowerCase().replace(/[^\w]+/g, '-');
|
||||||
|
|
||||||
return `
|
return `
|
||||||
|
Loading…
x
Reference in New Issue
Block a user