diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-10-25 12:10:07 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-10-25 12:10:07 -0700 |
commit | 45df87cf15b36815c28ea6306a380e673bcd0e68 (patch) | |
tree | 2deed0218712961fd84b6a5abf69b2470cd20ad3 /src/Text/Pandoc/Readers | |
parent | f3e559c43c72ef399321abfd5569bb609ba3b6a8 (diff) | |
parent | 27a8603278529cf3e1fcf0cdbaf94bc005c5472a (diff) | |
download | pandoc-45df87cf15b36815c28ea6306a380e673bcd0e68.tar.gz |
Merge pull request #2477 from tarleb/org-toggling-header-args
Org reader: allow toggling header args
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r-- | src/Text/Pandoc/Readers/Org.hs | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/Org.hs b/src/Text/Pandoc/Readers/Org.hs index 9db0f2e65..2585ace21 100644 --- a/src/Text/Pandoc/Readers/Org.hs +++ b/src/Text/Pandoc/Readers/Org.hs @@ -532,10 +532,16 @@ rundocBlockClass :: String rundocBlockClass = rundocPrefix ++ "block" blockOption :: OrgParser (String, String) -blockOption = try $ (,) <$> orgArgKey <*> orgParamValue +blockOption = try $ do + argKey <- orgArgKey + paramValue <- option "yes" orgParamValue + return (argKey, paramValue) inlineBlockOption :: OrgParser (String, String) -inlineBlockOption = try $ (,) <$> orgArgKey <*> orgInlineParamValue +inlineBlockOption = try $ do + argKey <- orgArgKey + paramValue <- option "yes" orgInlineParamValue + return (argKey, paramValue) orgArgKey :: OrgParser String orgArgKey = try $ @@ -544,11 +550,17 @@ orgArgKey = try $ orgParamValue :: OrgParser String orgParamValue = try $ - skipSpaces *> many1 (noneOf "\t\n\r ") <* skipSpaces + skipSpaces + *> notFollowedBy (char ':' ) + *> many1 (noneOf "\t\n\r ") + <* skipSpaces orgInlineParamValue :: OrgParser String orgInlineParamValue = try $ - skipSpaces *> many1 (noneOf "\t\n\r ]") <* skipSpaces + skipSpaces + *> notFollowedBy (char ':') + *> many1 (noneOf "\t\n\r ]") + <* skipSpaces orgArgWordChar :: OrgParser Char orgArgWordChar = alphaNum <|> oneOf "-_" |