deno.land / x / masx200_leetcode_test@10.6.5 / html-entity-parser / index.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
export default function html_Entity_Parser(text: string): string { return text.replace(entityRegExp, replacer);}function replacer(a: string) { const value = translator.get(a); return value ?? a;}const translator = new Map<string, string>([ ["&quot;", '"'], ["&apos;", "'"], ["&amp;", "&"], ["&gt;", ">"], ["&lt;", "<"], ["&frasl;", "/"],]);const entityRegExp = /\&[a-z]+\;/g;
masx200_leetcode_test

Version Info

Tagged at
a year ago