TWiki reader: fix performance issue with underscores.
Underscore emphasis can't cross table cell boundaries, but the parser wasn't respecting this, leading to exponential behavior in documents with table cells containing underscores. This fixes the original sample; it's possible that there are other performance issues involving underscores. Closes #3921.
This commit is contained in:
parent
20bce07dd8
commit
f9d9880325
1 changed files with 3 additions and 1 deletions
|
@ -424,7 +424,9 @@ strongAndEmph :: PandocMonad m => TWParser m B.Inlines
|
|||
strongAndEmph = try $ B.emph . B.strong <$> enclosed (string "__") nestedInlines
|
||||
|
||||
emph :: PandocMonad m => TWParser m B.Inlines
|
||||
emph = try $ B.emph <$> enclosed (char '_') nestedInlines
|
||||
emph = try $ B.emph <$> enclosed (char '_')
|
||||
(\p -> notFollowedBy (char '|') >> nestedInlines p)
|
||||
-- emphasis closers can't cross table cell boundaries, see #3921
|
||||
|
||||
emphHtml :: PandocMonad m => TWParser m B.Inlines
|
||||
emphHtml = B.emph . mconcat <$> (parseHtmlContent "em" inline <|> parseHtmlContent "i" inline)
|
||||
|
|
Loading…
Add table
Reference in a new issue