File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
packages/website/src/scripts/playground Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,17 @@ export function toMarker(message) {
3333 ] ;
3434}
3535
36+ /**
37+ * @param {string } str
38+ * @returns {string }
39+ */
40+ export function escapeHTML ( str ) {
41+ return str
42+ . replace ( / & / g, "&" )
43+ . replace ( / < / g, "<" )
44+ . replace ( / > / g, ">" ) ;
45+ }
46+
3647export const INITIAL_HTML = html `<!DOCTYPE html>
3748 < html >
3849 < head >
Original file line number Diff line number Diff line change @@ -3,7 +3,8 @@ import "codemirror/mode/htmlmixed/htmlmixed.js";
33import "codemirror/mode/javascript/javascript.js" ;
44import CodeMirror from "codemirror" ;
55import {
6- toMarker
6+ toMarker ,
7+ escapeHTML
78} from "./helpers" ;
89import {
910 html
@@ -115,7 +116,7 @@ export class View {
115116 }
116117
117118 return html `< li class ="bg-red-100 text-red-800 px-2 py-1 my-1 rounded ">
118- ${ line } :${ column } - ${ message } (
119+ ${ line } :${ column } - ${ escapeHTML ( message ) } (
119120 < a href ="/docs/rules/ ${ ruleId . replace (
120121 "@html-eslint/" ,
121122 ""
You can’t perform that action at this time.
0 commit comments