Skip to content

Commit b84fa66

Browse files
authored
Org reader: Recognize "fast access" characters in TODO state definitions (#10990)
1 parent f000fa1 commit b84fa66

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/Text/Pandoc/Readers/Org/Meta.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,11 @@ todoSequence = try $ do
252252

253253
where
254254
todoKeyword :: Monad m => OrgParser m Text
255-
todoKeyword = many1Char nonspaceChar <* skipSpaces
255+
todoKeyword = do
256+
keyword <- many1Char nonspaceChar
257+
let cleanKeyword = T.takeWhile (/= '(') keyword
258+
skipSpaces
259+
return cleanKeyword
256260

257261
todoKeywords :: Monad m => OrgParser m [Text]
258262
todoKeywords = try $

test/Tests/Readers/Org/Block/Header.hs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,13 @@ tests =
118118
in headerWith ("compile", [], []) 1 (waiting <> space <> "compile")
119119
<> headerWith ("lunch", [], []) 1 (cancelled <> space <> "lunch")
120120
<> headerWith ("todo-feature", [], []) 1 (done <> space <> "todo-feature")
121+
122+
, "Fast access TODO states" =:
123+
T.unlines [ "#+TODO: TODO(t) | DONE(d)"
124+
, "* TODO test"
125+
] =?>
126+
let todoSpan = spanWith ("", ["todo", "TODO"], []) "TODO"
127+
in headerWith ("test", [], []) 1 (todoSpan <> space <> "test")
121128
]
122129

123130
, "Tagged headers" =:

0 commit comments

Comments
 (0)