不要怂,就是干,撸起袖子干!

Commit 44d72f29 by Nick Acker

Fix non-global string replace for docs

String.prototype.replace is not a global replace when the first
argument is a String, which caused escaping issues with docs
generator, breaking formatting. This patch replaces the substring
argument with an equivalent regex with the global flag.
1 parent 511ae271
Showing with 3 additions and 3 deletions
......@@ -144,9 +144,9 @@ Comment.concatTypes = function (types, convertEntities) {
if (convertEntities) {
// Convert a couple of things to their HTML-entities
// The spacing around | is intentional, in order to introduce some linebreaks in the params table
type = type.replace('|', ' | ')
.replace('>', '>')
.replace('<', '&lt;');
type = type.replace(/\|/g, ' &#124; ')
.replace(/>/g, '&gt;')
.replace(/</g, '&lt;');
}
return type;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!