Skip to content

Commit

Permalink
Merge pull request #1 from rsp/fix/xss_html_entities_semicolon
Browse files Browse the repository at this point in the history
Optional semicolon in html entities regex
  • Loading branch information
matt- authored Jul 15, 2016
2 parents 2cff859 + 31c7799 commit 0fa05b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/marked.js
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ function escape(html, encode) {

function unescape(html) {
// explicitly match decimal, hex, and named HTML entities
return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(\w+))/g, function(_, n) {
return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g, function(_, n) {
n = n.toLowerCase();
if (n === 'colon') return ':';
if (n.charAt(0) === '#') {
Expand Down

0 comments on commit 0fa05b6

Please sign in to comment.