docs: fix heading renderer example (#3392)

This commit is contained in:
Tony Brix 2024-08-06 21:28:11 -06:00 committed by GitHub
parent 0a3b2569fa
commit ead7af34a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -72,7 +72,8 @@ import { marked } from 'marked';
// Override function
const renderer = {
heading(text, depth) {
heading({ tokens, depth }) {
const text = this.parser.parseInline(tokens);
const escapedText = text.toLowerCase().replace(/[^\w]+/g, '-');
return `