HTMLの特殊文字をJavaScriptでエスケープする
function escape(html: string) {
    return html.replaceAll(/[<>&'"]/g, c => {
        switch (c) {
            case "<":
                return "<"
            case ">":
                return ">"
            case "&":
                return "&"
            case "'":
                return "'"
            case '"':
                return """
            default:
                return c
        }
    })
}