diff --git a/src/Text/Pandoc/Readers/Org/Meta.hs b/src/Text/Pandoc/Readers/Org/Meta.hs index 6246947e48e1..8f19760bc8ab 100644 --- a/src/Text/Pandoc/Readers/Org/Meta.hs +++ b/src/Text/Pandoc/Readers/Org/Meta.hs @@ -252,7 +252,11 @@ todoSequence = try $ do where todoKeyword :: Monad m => OrgParser m Text - todoKeyword = many1Char nonspaceChar <* skipSpaces + todoKeyword = do + keyword <- many1Char nonspaceChar + let cleanKeyword = T.takeWhile (/= '(') keyword + skipSpaces + return cleanKeyword todoKeywords :: Monad m => OrgParser m [Text] todoKeywords = try $ diff --git a/test/Tests/Readers/Org/Block/Header.hs b/test/Tests/Readers/Org/Block/Header.hs index f0d77bc94daf..52396b90564b 100644 --- a/test/Tests/Readers/Org/Block/Header.hs +++ b/test/Tests/Readers/Org/Block/Header.hs @@ -118,6 +118,13 @@ tests = in headerWith ("compile", [], []) 1 (waiting <> space <> "compile") <> headerWith ("lunch", [], []) 1 (cancelled <> space <> "lunch") <> headerWith ("todo-feature", [], []) 1 (done <> space <> "todo-feature") + + , "Fast access TODO states" =: + T.unlines [ "#+TODO: TODO(t) | DONE(d)" + , "* TODO test" + ] =?> + let todoSpan = spanWith ("", ["todo", "TODO"], []) "TODO" + in headerWith ("test", [], []) 1 (todoSpan <> space <> "test") ] , "Tagged headers" =: