Muse reader: do not reparse blocks inside unclosed block tag
Fixes #4425
This commit is contained in:
parent
15f700d8ed
commit
f0a029ac51
2 changed files with 22 additions and 4 deletions
|
@ -265,10 +265,10 @@ parseBlocksTill :: PandocMonad m
|
|||
=> MuseParser m a
|
||||
-> MuseParser m (F Blocks)
|
||||
parseBlocksTill end =
|
||||
try parseEnd <|>
|
||||
try blockStart <|>
|
||||
try listStart <|>
|
||||
try paraStart
|
||||
try (parseEnd <|>
|
||||
blockStart <|>
|
||||
listStart <|>
|
||||
paraStart)
|
||||
where
|
||||
parseEnd = mempty <$ end
|
||||
blockStart = do first <- blockElements
|
||||
|
|
|
@ -1224,5 +1224,23 @@ tests =
|
|||
, "</quote>"
|
||||
] =?>
|
||||
blockQuote (bulletList [ blockQuote $ para "foo" ] <> para "bar")
|
||||
|
||||
, "Unclosed quote tag" =:
|
||||
T.unlines
|
||||
[ "<quote>"
|
||||
, "<verse>"
|
||||
, "</quote>"
|
||||
, "</verse>"
|
||||
] =?>
|
||||
para "<quote>" <> lineBlock [ "</quote>" ]
|
||||
|
||||
, "Unclosed quote tag inside list" =:
|
||||
T.unlines
|
||||
[ " - <quote>"
|
||||
, " <verse>"
|
||||
, " </quote>"
|
||||
, " </verse>"
|
||||
] =?>
|
||||
bulletList [ para "<quote>" <> lineBlock [ "</quote>" ] ]
|
||||
]
|
||||
]
|
||||
|
|
Loading…
Add table
Reference in a new issue