Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix html comment after list #3518

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
-->