Skip to content

Commit

Permalink
fix: fix html comment after list (#3518)
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech authored Nov 7, 2024
1 parent a73f85e commit a612576
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Tokenizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ export class _Tokenizer {
const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`);
const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\`\`\`|~~~)`);
const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);
const htmlBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}<[a-z].*>`, 'i');
const htmlBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}<(?:[a-z].*>|!--)`, 'i');

// Check if following lines should be included in List Item
while (src) {
Expand Down
8 changes: 8 additions & 0 deletions test/specs/new/html_following_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@
<div class="some-class">
Content
</div>

<ul>
<li>list item 1</li>
<li>list item 2</li>
</ul>
<!--
Comment
-->
6 changes: 6 additions & 0 deletions test/specs/new/html_following_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@
<div class="some-class">
Content
</div>

- list item 1
- list item 2
<!--
Comment
-->

0 comments on commit a612576

Please # to comment.