diff --git a/src/utils/renderer.ts b/src/utils/renderer.ts index 75fa8d7..23c9622 100644 --- a/src/utils/renderer.ts +++ b/src/utils/renderer.ts @@ -40,6 +40,16 @@ function buildTheme({ theme: _theme, fonts, size, isUseIndent }: IOpts): ThemeSt } as ThemeStyles } +function escapeHtml(text: string): string { + return text + .replace(/&/g, `&`) // 转义 & + .replace(//g, `>`) // 转义 > + .replace(/"/g, `"`) // 转义 " + .replace(/'/g, `'`) // 转义 ' + .replace(/`/g, ```) // 转义 ` +} + function buildAddition(): string { return `