diff options
| author | Albert Krewinkel <[email protected]> | 2025-08-14 19:32:39 +0200 |
|---|---|---|
| committer | Albert Krewinkel <[email protected]> | 2025-08-14 19:35:37 +0200 |
| commit | de31a9f1305bc84e27bc255dac6383c7278529f2 (patch) | |
| tree | b784936f676cec199e88445db89cb3207ab07956 | |
| parent | a6a5be132a5aa53f9744850f33a52e25aecf2628 (diff) | |
Org reader: accept quoted values as argument values.
Fixes: #8869
| -rw-r--r-- | src/Text/Pandoc/Readers/Org/Blocks.hs | 5 | ||||
| -rw-r--r-- | test/command/8869.md | 20 |
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" +] +``` |
