fix html generation #1543

This commit is contained in:
Leo Horie 2017-01-16 09:10:47 -05:00
parent fb856c0636
commit aca0c6c120

View file

@ -25,6 +25,7 @@ function generate(pathname) {
var markdown = fs.readFileSync(pathname, "utf-8")
var fixed = markdown
.replace(/(`[^`]+?)<(.*`)/gim, "$1&lt;$2") // fix generic syntax
.replace(/&lt;\//gim, "</") // then revert broken html
.replace(/`((?:\S| -> |, )+)(\|)(\S+)`/gim, function(match, a, b, c) { // fix pipes in code tags
return "<code>" + (a + b + c).replace(/\|/g, "&#124;") + "</code>"
})