fix(escapeHtmlComment): Avoid throwing errors due to src not being a string

This commit is contained in:
LazyTong 2024-11-22 23:19:06 +08:00 committed by GitHub
parent fc4bbf95c1
commit 515cc44084
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ export function escapeHtml(string: unknown): string {
const commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g
export function escapeHtmlComment(src: string): string {
return src.replace(commentStripRE, '')
return src.toString().replace(commentStripRE, '')
}
export const cssVarNameEscapeSymbolsRE: RegExp =