Skip to content

Commit

Permalink
Fix escaped HTML showing up in page navigation
Browse files Browse the repository at this point in the history
Resolves #2224
  • Loading branch information
Gerrit0 committed Apr 15, 2023
1 parent f6dc882 commit 03734cf
Show file tree
Hide file tree
Showing 6 changed files with 2,306 additions and 13 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Expand Up @@ -11,7 +11,7 @@

### Bug Fixes

- Validation will no longer be skipped for sub packages when running with `--entryPointStrategy packages`.
- Fixed `&` showing as `&` and HTML text showing up in page contents navigation, #2224.
- Increased padding between sections when one navigation column is displayed, #2225.
- Correct padding for navigation elements with a displayed icon, #2229.
- Fixed `source-order` sort strategy failing to compare reflections within a file.
Expand All @@ -23,6 +23,7 @@
- Fixed "Implementation of X.y" links if a mixture of methods and property-methods are used, #2233.
- "Implementation of" text to symbol-properties not contained in the documentation will now use the resolved name instead of a `__@` symbol name, #2234.
- Fix expansion of globs if a single entry point is provided, #2235.
- Validation will no longer be skipped for sub packages when running with `--entryPointStrategy packages`.
- Fixed broken theme toggle if the page contained a member named "theme".

### Thanks!
Expand Down
3 changes: 2 additions & 1 deletion src/lib/output/themes/MarkedPlugin.ts
Expand Up @@ -7,6 +7,7 @@ import { RendererEvent, MarkdownEvent, PageEvent } from "../events";
import { BindOption, readFile, copySync, isFile } from "../../utils";
import { highlight, isSupportedLanguage } from "../../utils/highlighter";
import type { Theme } from "shiki";
import { getTextContent } from "../../utils/html";

/**
* Implements markdown and relativeURL helpers for templates.
Expand Down Expand Up @@ -192,7 +193,7 @@ output file :
// Prefix the slug with an extra `$` to prevent conflicts with TypeDoc's anchors.
this.page!.pageHeadings.push({
link: `#md:${slug}`,
text,
text: getTextContent(text),
level,
});
return `<a id="md:${slug}" class="tsd-anchor"></a><h${level}><a href="#$${slug}" style="color:inherit;text-decoration:none">${text}</a></h${level}>`;
Expand Down

0 comments on commit 03734cf

Please sign in to comment.