| ... | ... | @@ -3319,14 +3319,16 @@ const NAV_MODES = { |
| 3319 | 3319 | } else if (line.text.startsWith("#")) { |
| 3320 | 3320 | line.type = "h1"; |
| 3321 | 3321 | line.text = line.text.substr(1); |
| 3322 | | } else if (line.text.startsWith("-")) { |
| 3323 | | line.type = "ul"; |
| 3324 | | line.text = line.text.substr(1); |
| 3325 | | } else if (line.text.match(/^\d+\..*$/)) { |
| 3326 | | // if line starts with {number}{dot} |
| 3327 | | const match = line.text.match(/(\d+)\./); |
| 3322 | } else if (line.text.match(/^-[ \t]+.*$/)) { |
| 3323 | // line starts with a hyphen, followed by spaces or tabs |
| 3324 | const match = line.text.match(/^-[ \t]+/); |
| 3328 | 3325 | line.type = "ul"; |
| 3329 | 3326 | line.text = line.text.substr(match[0].length); |
| 3327 | } else if (line.text.match(/^\d+\.[ \t]+.*$/)) { |
| 3328 | // line starts with {number}{dot}{spaces or tabs} |
| 3329 | const match = line.text.match(/(\d+)\.[ \t]+/); |
| 3330 | line.type = "ol"; |
| 3331 | line.text = line.text.substr(match[0].length); |
| 3330 | 3332 | line.ordered_number = Number(match[1].length); |
| 3331 | 3333 | } else if (line.text == "```") { |
| 3332 | 3334 | line.type = "skip"; |
| ... | ... | @@ -3536,7 +3538,7 @@ const NAV_MODES = { |
| 3536 | 3538 | case "ul": |
| 3537 | 3539 | case "ol": |
| 3538 | 3540 | if ( |
| 3539 | | !previousLineIs("ul", line_no) || |
| 3541 | !previousLineIs(line.type, line_no) || |
| 3540 | 3542 | getPreviousLineIndent(line_no) < line.indent |
| 3541 | 3543 | ) { |
| 3542 | 3544 | html += "<" + line.type + ">\n"; |
| ... | ... | @@ -3545,7 +3547,7 @@ const NAV_MODES = { |
| 3545 | 3547 | html += "<li>" + markdownInlines(line.text) + "</li>\n"; |
| 3546 | 3548 | |
| 3547 | 3549 | if ( |
| 3548 | | !nextLineIs("ul", line_no) || |
| 3550 | !nextLineIs(line.type, line_no) || |
| 3549 | 3551 | getNextLineIndent(line_no) < line.indent |
| 3550 | 3552 | ) { |
| 3551 | 3553 | html += "</" + line.type + ">\n"; |
| ... | ... | @@ -4067,4 +4069,4 @@ function toggleExpand(event) { |
| 4067 | 4069 | if (!parent.open && parent.getBoundingClientRect().top < 0) { |
| 4068 | 4070 | parent.parentElement.parentElement.scrollIntoView(true); |
| 4069 | 4071 | } |
| 4070 | | } |
| | \ No newline at end of file |
| 4072 | } |