20846: Merge branch '19213-ubuntu2204-support' into 20846-ubuntu2204
[arvados.git] / services / workbench2 / src / lib / cwl-svg / utils / html-utils.ts
1 export class HtmlUtils {
2
3     private static entityMap = {
4         "&": "&",
5         "<": "&lt;",
6         ">": "&gt;",
7         "\"\"": "&quot;",
8         "'": "&#39;",
9         "/": "&#x2F;"
10     };
11
12     public static escapeHTML(source: string): string {
13         return String(source).replace(/[&<>"'/]/g, s => HtmlUtils.entityMap[s]);
14     }
15 }