From 21e6ca197694a8f65bd2717dc441ea99f3f20312 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 5 Jan 2017 23:24:27 +0100 Subject: 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. --- src/Text/Pandoc/Readers/Org/Inlines.hs | 3 +++ tests/Tests/Readers/Org.hs | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/Text/Pandoc/Readers/Org/Inlines.hs b/src/Text/Pandoc/Readers/Org/Inlines.hs index 97b36b388..5f3df8d3e 100644 --- a/src/Text/Pandoc/Readers/Org/Inlines.hs +++ b/src/Text/Pandoc/Readers/Org/Inlines.hs @@ -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 diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs index 6b07784b7..4462d81cc 100644 --- a/tests/Tests/Readers/Org.hs +++ b/tests/Tests/Readers/Org.hs @@ -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" ]) -- cgit v1.2.3