Skip to content

Commit a612576

Browse files
authored
fix: fix html comment after list (#3518)
1 parent a73f85e commit a612576

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

src/Tokenizer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ export class _Tokenizer {
305305
const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`);
306306
const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\`\`\`|~~~)`);
307307
const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);
308-
const htmlBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}<[a-z].*>`, 'i');
308+
const htmlBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}<(?:[a-z].*>|!--)`, 'i');
309309

310310
// Check if following lines should be included in List Item
311311
while (src) {

test/specs/new/html_following_list.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,11 @@
55
<div class="some-class">
66
Content
77
</div>
8+
9+
<ul>
10+
<li>list item 1</li>
11+
<li>list item 2</li>
12+
</ul>
13+
<!--
14+
Comment
15+
-->

test/specs/new/html_following_list.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33
<div class="some-class">
44
Content
55
</div>
6+
7+
- list item 1
8+
- list item 2
9+
<!--
10+
Comment
11+
-->

0 commit comments

Comments
 (0)