Skip to content

Commit

Permalink
Merge branch 'quote-escaping-fix' of https://github.com/matias-la/anser
Browse files Browse the repository at this point in the history
… into new-version
  • Loading branch information
IonicaBizau committed Feb 2, 2022
2 parents cc8eb53 + a9d7ae3 commit 34c0014
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,9 @@ class Anser {
* @returns {String} The escpaed HTML output.
*/
escapeForHtml (txt) {
return txt.replace(/[&<>]/gm, str =>
return txt.replace(/[&<>\"]/gm, str =>
str == "&" ? "&amp;" :
str == '"' ? "&quot;" :
str == "<" ? "&lt;" :
str == ">" ? "&gt;" : ""
);
Expand Down

0 comments on commit 34c0014

Please sign in to comment.