projects
/
arvados-workbench2.git
/ blob
07b5405d1c05ef2f09a929ca79a7bc2cd47256a4
[arvados-workbench2.git]
/
src
/
lib
/
cwl-svg
/
utils
/
html-utils.ts
1
export class HtmlUtils {
2
3
private static entityMap = {
4
"&": "&",
5
"<": "<",
6
">": ">",
7
"\"\"": """,
8
"'": "'",
9
"/": "/"
10
};
11
12
public static escapeHTML(source: string): string {
13
return String(source).replace(/[&<>"'\/]/g, s => HtmlUtils.entityMap[s]);
14
}
15
}