fix: fix html following list (#3444)

This commit is contained in:
Tony Brix 2024-09-08 09:25:54 -06:00 committed by GitHub
parent 2fe4136b5b
commit 9d7b728749
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 18 additions and 0 deletions

View File

@ -305,6 +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');
// Check if following lines should be included in List Item
while (src) {
@ -330,6 +331,11 @@ export class _Tokenizer {
break;
}
// End list item if found start of html block
if (htmlBeginRegex.test(nextLine)) {
break;
}
// End list item if found start of new bullet
if (nextBulletRegex.test(nextLine)) {
break;

View File

@ -0,0 +1,7 @@
<ul>
<li>list item 1</li>
<li>list item 2</li>
</ul>
<div class="some-class">
Content
</div>

View File

@ -0,0 +1,5 @@
- list item 1
- list item 2
<div class="some-class">
Content
</div>