git.iko.soy/typeable/pandoc
on master help sign in
Org reader: recognize emphasis after TODO/DONE keyword
7e7bc34Albert Krewinkel
src/Text/Pandoc/Readers/Org/DocumentTree.hs+3−1
@@ -273,7 +273,9 @@ headlineToHeader hdln = do
273todoKeyword :: Monad m => OrgParser m TodoMarker
273todoKeyword :: Monad m => OrgParser m TodoMarker
274todoKeyword = try $ do
274todoKeyword = try $ do
275 taskStates <- activeTodoMarkers <$> getState
275 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)
277 choice (map kwParser taskStates)
279 choice (map kwParser taskStates)
278
280
279todoKeywordToInlines :: TodoMarker -> Inlines
281todoKeywordToInlines :: TodoMarker -> Inlines
test/Tests/Readers/Org/Block/Header.hs+7
@@ -87,6 +87,13 @@ tests =
87 let todoSpan = spanWith ("", ["done", "DONE"], []) "DONE"
87 let todoSpan = spanWith ("", ["done", "DONE"], []) "DONE"
88 in headerWith ("header", [], []) 1 (todoSpan <> space <> "header")
88 in headerWith ("header", [], []) 1 (todoSpan <> space <> "header")
89
89
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+
90 , "Header with unknown todo keyword" =:
97 , "Header with unknown todo keyword" =:
91 "* WAITING header" =?>
98 "* WAITING header" =?>
92 headerWith ("waiting-header", [], []) 1 "WAITING header"
99 headerWith ("waiting-header", [], []) 1 "WAITING header"