aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/Org/Blocks.hs5
-rw-r--r--test/command/8869.md20
2 files changed, 23 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Org/Blocks.hs b/src/Text/Pandoc/Readers/Org/Blocks.hs
index 8c2b406b9..94e391be5 100644
--- a/src/Text/Pandoc/Readers/Org/Blocks.hs
+++ b/src/Text/Pandoc/Readers/Org/Blocks.hs
@@ -427,10 +427,11 @@ blockOption = try $ do
return (argKey, paramValue)
orgParamValue :: Monad m => OrgParser m Text
-orgParamValue = try $ fmap T.pack $
+orgParamValue = try $
skipSpaces
*> notFollowedBy orgArgKey
- *> noneOf "\n\r" `many1Till` endOfValue
+ *> ((char '"' *> manyChar (noneOf "\n\r\"") <* char '"') <|>
+ noneOf "\n\r" `many1TillChar` endOfValue)
<* skipSpaces
where
endOfValue = lookAhead $ try (skipSpaces <* oneOf "\n\r")
diff --git a/test/command/8869.md b/test/command/8869.md
new file mode 100644
index 000000000..eba564d38
--- /dev/null
+++ b/test/command/8869.md
@@ -0,0 +1,20 @@
+Org arguments can either be single words, or quoted.
+
+```
+% pandoc -f org -t native
+#+begin_src jupyter-julia :exports both
+1 + 2
+#+end_src
+
+#+begin_src jupyter-julia :exports "both"
+1 + 2
+#+end_src
+^D
+[ CodeBlock
+ ( "" , [ "julia" , "code" ] , [ ( "exports" , "both" ) ] )
+ "1 + 2\n"
+, CodeBlock
+ ( "" , [ "julia" , "code" ] , [ ( "exports" , "both" ) ] )
+ "1 + 2\n"
+]
+```