From a612576ff647b4124e8fa80f608cc23c908a1861 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Thu, 7 Nov 2024 10:22:52 -0700 Subject: [PATCH] fix: fix html comment after list (#3518) --- src/Tokenizer.ts | 2 +- test/specs/new/html_following_list.html | 8 ++++++++ test/specs/new/html_following_list.md | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Tokenizer.ts b/src/Tokenizer.ts index f29795e704..f8bf850573 100644 --- a/src/Tokenizer.ts +++ b/src/Tokenizer.ts @@ -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) { diff --git a/test/specs/new/html_following_list.html b/test/specs/new/html_following_list.html index 349d4136cb..7cbb6643ef 100644 --- a/test/specs/new/html_following_list.html +++ b/test/specs/new/html_following_list.html @@ -5,3 +5,11 @@
Content
+ + + diff --git a/test/specs/new/html_following_list.md b/test/specs/new/html_following_list.md index 52c2113123..6275de00eb 100644 --- a/test/specs/new/html_following_list.md +++ b/test/specs/new/html_following_list.md @@ -3,3 +3,9 @@
Content
+ +- list item 1 +- list item 2 +