Initial commit
This commit is contained in:
commit
3f501820b1
173 changed files with 24001 additions and 0 deletions
17
quartz/util/escape.ts
Executable file
17
quartz/util/escape.ts
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
export const escapeHTML = (unsafe: string) => {
|
||||
return unsafe
|
||||
.replaceAll("&", "&")
|
||||
.replaceAll("<", "<")
|
||||
.replaceAll(">", ">")
|
||||
.replaceAll('"', """)
|
||||
.replaceAll("'", "'")
|
||||
}
|
||||
|
||||
export const unescapeHTML = (html: string) => {
|
||||
return html
|
||||
.replaceAll("&", "&")
|
||||
.replaceAll("<", "<")
|
||||
.replaceAll(">", ">")
|
||||
.replaceAll(""", '"')
|
||||
.replaceAll("'", "'")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue