git.iko.soy/typeable/pandoc
on master help sign in
Org reader: recognize emphasis after TODO/DONE keyword

Fixes: #5484

commit7e7bc3493ef7ca17fbd8746bae8731dfecef60dd authorAlbert Krewinkel <albert@zeitkraut.de> dateSun 5 May 2019, 13:53 (8 years ago) parent545da61
2 files changed+10−1
src/Text/Pandoc/Readers/Org/DocumentTree.hs+3−1 test/Tests/Readers/Org/Block/Header.hs+7
src/Text/Pandoc/Readers/Org/DocumentTree.hs+3−1
@@ -273,7 +273,9 @@ headlineToHeader hdln = do
273273todoKeyword :: Monad m => OrgParser m TodoMarker
274274todoKeyword = try $ do
275275 taskStates <- activeTodoMarkers <$> getState
276− let kwParser tdm = try (tdm <$ string (todoMarkerName tdm) <* spaceChar)
276+ let kwParser tdm = try (tdm <$ string (todoMarkerName tdm)
277+ <* spaceChar
278+ <* updateLastPreCharPos)
277279 choice (map kwParser taskStates)
278280
279281todoKeywordToInlines :: TodoMarker -> Inlines
test/Tests/Readers/Org/Block/Header.hs+7
@@ -87,6 +87,13 @@ tests =
8787 let todoSpan = spanWith ("", ["done", "DONE"], []) "DONE"
8888 in headerWith ("header", [], []) 1 (todoSpan <> space <> "header")
8989
90+ , "emphasis in first word" =:
91+ "** TODO /fix/ this" =?>
92+ let todoSpan = spanWith ("", ["todo", "TODO"], []) "TODO"
93+ in headerWith ("fix-this", [], [])
94+ 2
95+ (todoSpan <> space <> emph "fix" <> space <> "this")
96+
9097 , "Header with unknown todo keyword" =:
9198 "* WAITING header" =?>
9299 headerWith ("waiting-header", [], []) 1 "WAITING header"