Org reader: ensure emphasis markup can be nested
Nested emphasis markup (e.g. `/*strong and emphasized*/`) was
interpreted incorrectly in that the inner markup was not recognized.
commit21e6ca197694a8f65bd2717dc441ea99f3f20312
authorAlbert Krewinkel <albert@zeitkraut.de>
dateThu 5 Jan 2017, 23:24 (10 years ago)
parentf2e3e75
src/Text/Pandoc/Readers/Org/Inlines.hs+3
@@ -647,6 +647,9 @@ emphasisStart c = try $ do
647647 char c
648648 lookAhead (noneOf emphasisForbiddenBorderChars)
649649 pushToInlineCharStack c
650+ -- nested inlines are allowed, so mark this position as one which might be
651+ -- followed by another inline.
652+ updateLastPreCharPos
650653 return c
651654
652655-- | Parses the closing character of emphasis
tests/Tests/Readers/Org.hs+4
@@ -47,6 +47,10 @@ tests =
4747 "/*strength*/" =?>
4848 para (emph . strong $ "strength")
4949
50+ , "Emphasized Strong preceded by space" =:
51+ " */super/*" =?>
52+ para (strong . emph $ "super")
53+
5054 , "Strikeout" =:
5155 "+Kill Bill+" =?>
5256 para (strikeout . spcSep $ [ "Kill", "Bill" ])