From e6d1b3524d765df997561a151d3f93ce5d802ab0 Mon Sep 17 00:00:00 2001 From: griest024 Date: Mon, 22 Jul 2024 10:53:48 -0400 Subject: [PATCH] feat(dgeni): render headings with slugified IDs (#2927) --- tools/dgeni/src/processors/markdown.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/dgeni/src/processors/markdown.ts b/tools/dgeni/src/processors/markdown.ts index c306155805..5b1a9a51d0 100644 --- a/tools/dgeni/src/processors/markdown.ts +++ b/tools/dgeni/src/processors/markdown.ts @@ -8,6 +8,7 @@ import graphql from 'highlight.js/lib/languages/graphql'; import scss from 'highlight.js/lib/languages/scss'; import typescript from 'highlight.js/lib/languages/typescript'; import xml from 'highlight.js/lib/languages/xml'; +import { slugify } from 'markdown-toc/lib/utils'; import { marked } from 'marked'; import { markedHighlight } from 'marked-highlight'; @@ -74,6 +75,10 @@ marked.use({ token.href = getLinkUrl(token.href); } }, + renderer: { + heading: (text: string, level: number, raw: string) => + `${text}`, + }, }); export class MarkdownCodeProcessor implements Processor {