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:
parent
f2e3e756f8
commit
21e6ca1976
2 changed files with 7 additions and 0 deletions
|
@ -647,6 +647,9 @@ emphasisStart c = try $ do
|
||||||
char c
|
char c
|
||||||
lookAhead (noneOf emphasisForbiddenBorderChars)
|
lookAhead (noneOf emphasisForbiddenBorderChars)
|
||||||
pushToInlineCharStack c
|
pushToInlineCharStack c
|
||||||
|
-- nested inlines are allowed, so mark this position as one which might be
|
||||||
|
-- followed by another inline.
|
||||||
|
updateLastPreCharPos
|
||||||
return c
|
return c
|
||||||
|
|
||||||
-- | Parses the closing character of emphasis
|
-- | Parses the closing character of emphasis
|
||||||
|
|
|
@ -47,6 +47,10 @@ tests =
|
||||||
"/*strength*/" =?>
|
"/*strength*/" =?>
|
||||||
para (emph . strong $ "strength")
|
para (emph . strong $ "strength")
|
||||||
|
|
||||||
|
, "Emphasized Strong preceded by space" =:
|
||||||
|
" */super/*" =?>
|
||||||
|
para (strong . emph $ "super")
|
||||||
|
|
||||||
, "Strikeout" =:
|
, "Strikeout" =:
|
||||||
"+Kill Bill+" =?>
|
"+Kill Bill+" =?>
|
||||||
para (strikeout . spcSep $ [ "Kill", "Bill" ])
|
para (strikeout . spcSep $ [ "Kill", "Bill" ])
|
||||||
|
|
Loading…
Add table
Reference in a new issue