aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/Org/Blocks.hs7
-rw-r--r--test/Tests/Readers/Org.hs9
2 files changed, 14 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Org/Blocks.hs b/src/Text/Pandoc/Readers/Org/Blocks.hs
index 3cb9c7ed8..fb942608d 100644
--- a/src/Text/Pandoc/Readers/Org/Blocks.hs
+++ b/src/Text/Pandoc/Readers/Org/Blocks.hs
@@ -589,9 +589,12 @@ blockOption = try $ do
orgParamValue :: Monad m => OrgParser m String
orgParamValue = try $
skipSpaces
- *> notFollowedBy (char ':' )
- *> many1 nonspaceChar
+ *> notFollowedBy orgArgKey
+ *> noneOf "\n\r" `many1Till` endOfValue
<* skipSpaces
+ where
+ endOfValue = lookAhead $ (try $ skipSpaces <* oneOf "\n\r")
+ <|> (try $ skipSpaces1 <* orgArgKey)
--
diff --git a/test/Tests/Readers/Org.hs b/test/Tests/Readers/Org.hs
index 55fa00d1a..7a7960396 100644
--- a/test/Tests/Readers/Org.hs
+++ b/test/Tests/Readers/Org.hs
@@ -1559,6 +1559,15 @@ tests =
params = [ ("data-org-language", "sh"), ("startFrom", "10") ]
in codeBlockWith ("", classes, params) ":() { :|:& };:\n"
+ , "Source block with multi-word parameter values" =:
+ unlines [ "#+BEGIN_SRC dot :cmdline -Kdot -Tpng "
+ , "digraph { id [label=\"ID\"] }"
+ , "#+END_SRC"
+ ] =?>
+ let classes = [ "dot" ]
+ params = [ ("cmdline", "-Kdot -Tpng") ]
+ in codeBlockWith ("", classes, params) "digraph { id [label=\"ID\"] }\n"
+
, "Example block" =:
unlines [ "#+begin_example"
, "A chosen representation of"