Skip to content

Commit

Permalink
more markdown parser improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Concedo authored and Concedo committed Sep 13, 2024
1 parent 4bf2ab6 commit c711ed4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4002,13 +4002,17 @@
.replace(/(^\d\d?[ .] .*)\%SpcStg\%/gm, "$1\n\%SpcTemp\%") //fix misalign
.replace(/^\d\d?[ .] (.*)([\n]??)/gm, "<ol><li>$1</li></ol>")
.replace(/\n\%SpcTemp\%/gm, "\%SpcStg\%") //fix misalign
.replace(/<\/li><\/ol><ol><li>/gm, "</li><li>")
.replace(/<\/li><\/ol>\n\s*?\n<ol><li>/gm, "</li>\n<li>")
.replace(/<\/li><\/ol>\s*?<ol><li>/gm, "</li><li>")
.replace(/<\/[ou]l><li>(.*\%SpcStg\%.*\%SpcEtg\%.*)<\/li><\/[ou]l\>/gm,"$1")
.replace(/^\s{2,6}[\*+-][ .](.*)/gm, "<ul><ul><li>$1</li></ul></ul>")
.replace(/^\s{2,6}\d[ .](.*)/gm, "<ul><ol><li>$1</li></ol></ul>")
.replace(/<\/[ou]l\>\n\n<[ou]l\>/gm, "\n")
.replace(/<\/[ou]l\>\n<[ou]l\>/g, "")
.replace(/<\/li><\/ul><ul><li>/gm, "</li><li>")
.replace(/<\/ul\>\n\n<ul\>/gm, "\n")
.replace(/<\/ol\>\n\n<ol\>/gm, "\n")
.replace(/<\/ol\>\n<ol\>/g, "")
.replace(/<\/ul\>\n<ul\>/g, "")
.replace(/<\/li><\/ul>\n\s*?\n<ul><li>/gm, "</li>\n<li>")
.replace(/<\/li><\/ul>\s*?<ul><li>/gm, "</li><li>")
.replace(/\*\*\*([^\s*].*?[^\\])\*\*\*/gm, "<b><em>$1</em></b>")
.replace(/\*\*([^\s*].*?[^\\])\*\*/gm, "<b>$1</b>")
.replace(/\*([^\s*].*?[^\\])\*/gm, "<em>$1</em>")
Expand Down

0 comments on commit c711ed4

Please sign in to comment.