diff --git a/static/rest_framework_swagger/lib/marked.js b/static/rest_framework_swagger/lib/marked.js index c2a678d5..f2b1521e 100644 --- a/static/rest_framework_swagger/lib/marked.js +++ b/static/rest_framework_swagger/lib/marked.js @@ -1083,7 +1083,8 @@ function escape(html, encode) { } function unescape(html) { - return html.replace(/&([#\w]+);/g, function(_, n) { + // explicitly match decimal, hex, and named HTML entities + return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(\w+))/g, function(_, n) { n = n.toLowerCase(); if (n === 'colon') return ':'; if (n.charAt(0) === '#') {