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.
This commit is contained in:
Albert Krewinkel 2017-01-05 23:24:27 +01:00
parent f2e3e756f8
commit 21e6ca1976
2 changed files with 7 additions and 0 deletions

View file

@ -647,6 +647,9 @@ emphasisStart c = try $ do
char c
lookAhead (noneOf emphasisForbiddenBorderChars)
pushToInlineCharStack c
-- nested inlines are allowed, so mark this position as one which might be
-- followed by another inline.
updateLastPreCharPos
return c
-- | Parses the closing character of emphasis

View file

@ -47,6 +47,10 @@ tests =
"/*strength*/" =?>
para (emph . strong $ "strength")
, "Emphasized Strong preceded by space" =:
" */super/*" =?>
para (strong . emph $ "super")
, "Strikeout" =:
"+Kill Bill+" =?>
para (strikeout . spcSep $ [ "Kill", "Bill" ])