aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/apidoc/markdown.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/apidoc/markdown.ts b/scripts/apidoc/markdown.ts
index 88df0150..870b4201 100644
--- a/scripts/apidoc/markdown.ts
+++ b/scripts/apidoc/markdown.ts
@@ -39,10 +39,15 @@ const htmlSanitizeOptions: sanitizeHtml.IOptions = {
function comparableSanitizedHtml(html: string): string {
return html
+ .replace(/&#x[0-9A-F]{2};/g, (x) =>
+ String.fromCodePoint(Number.parseInt(x.slice(3, -1), 16))
+ )
.replace(/>/g, '>')
- .replace(/ /g, '')
+ .replace(/&lt;/g, '<')
+ .replace(/&amp;/g, '&')
.replace(/&quot;/g, '"')
- .replace(/&#39;/g, "'");
+ .replace(/=""/g, '')
+ .replace(/ /g, '');
}
/**