Skip to content

Commit

Permalink
Be safe: encode ">" character too
Browse files Browse the repository at this point in the history
Although standard says it is _Anything else_
https://www.w3.org/TR/html52/syntax.html#data-state
  • Loading branch information
szepeviktor committed Jan 30, 2021
1 parent fd1081d commit b30e79a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/prism-core.js
Expand Up @@ -64,7 +64,7 @@ var _ = {
} else if (Array.isArray(tokens)) {
return tokens.map(encode);
} else {
return tokens.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\u00a0/g, ' ');
return tokens.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\u00a0/g, ' ');
}
},

Expand Down

0 comments on commit b30e79a

Please sign in to comment.