From 113ac67890fb90be2f66270cf341dde983cbb875 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Fri, 26 Jan 2024 16:59:13 -0700 Subject: [PATCH] Match HTML declaration blocks with lowercase letters --- commonmark/src/Commonmark/Blocks.hs | 8 ++++++-- commonmark/test/regression.md | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/commonmark/src/Commonmark/Blocks.hs b/commonmark/src/Commonmark/Blocks.hs index f3a8ee1..2cf27bd 100644 --- a/commonmark/src/Commonmark/Blocks.hs +++ b/commonmark/src/Commonmark/Blocks.hs @@ -61,7 +61,7 @@ import Control.Monad (foldM, guard, mzero, void, unless, when) import Control.Monad.Trans.Class (lift) import Data.Foldable (foldrM) -import Unicode.Char (isAsciiUpper, isDigit) +import Unicode.Char (isAsciiUpper, isAsciiLower, isDigit) import Unicode.Char.General.Compat (isSpace) import Data.Dynamic import Data.Text (Text) @@ -1165,7 +1165,7 @@ startCond 3 = void $ symbol '?' startCond 4 = void $ try $ do symbol '!' satisfyWord (\t -> case T.uncons t of - Just (c, _) -> isAsciiUpper c + Just (c, _) -> isAsciiLetter c _ -> False) startCond 5 = void $ try $ do symbol '!' @@ -1231,6 +1231,10 @@ removeConsecutive (x:y:zs) | x == y + 1 = removeConsecutive (y:zs) removeConsecutive xs = xs +isAsciiLetter :: Char -> Bool +isAsciiLetter c = + isAsciiUpper c || isAsciiLower c + ------------------------------------------------------------------------- collapseNodeStack :: [BlockNode m il bl] -> BlockParser m il bl (BlockNode m il bl) diff --git a/commonmark/test/regression.md b/commonmark/test/regression.md index fa6a9c3..c17bf83 100644 --- a/commonmark/test/regression.md +++ b/commonmark/test/regression.md @@ -336,3 +336,17 @@ Test x

Test

Test x

```````````````````````````````` + + +Issue #142 +```````````````````````````````` example + + +. + + +````````````````````````````````