fix html generation #1543
This commit is contained in:
parent
fb856c0636
commit
aca0c6c120
1 changed files with 1 additions and 0 deletions
|
|
@ -25,6 +25,7 @@ function generate(pathname) {
|
||||||
var markdown = fs.readFileSync(pathname, "utf-8")
|
var markdown = fs.readFileSync(pathname, "utf-8")
|
||||||
var fixed = markdown
|
var fixed = markdown
|
||||||
.replace(/(`[^`]+?)<(.*`)/gim, "$1<$2") // fix generic syntax
|
.replace(/(`[^`]+?)<(.*`)/gim, "$1<$2") // fix generic syntax
|
||||||
|
.replace(/<\//gim, "</") // then revert broken html
|
||||||
.replace(/`((?:\S| -> |, )+)(\|)(\S+)`/gim, function(match, a, b, c) { // fix pipes in code tags
|
.replace(/`((?:\S| -> |, )+)(\|)(\S+)`/gim, function(match, a, b, c) { // fix pipes in code tags
|
||||||
return "<code>" + (a + b + c).replace(/\|/g, "|") + "</code>"
|
return "<code>" + (a + b + c).replace(/\|/g, "|") + "</code>"
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue