diff options
| -rw-r--r-- | data/templates/default.org | 6 | ||||
| -rw-r--r-- | src/Text/Pandoc/Writers/Org.hs | 11 | ||||
| -rw-r--r-- | test/command/10919.md | 21 |
3 files changed, 38 insertions, 0 deletions
diff --git a/data/templates/default.org b/data/templates/default.org index ee073c6e5..38b6e6fcc 100644 --- a/data/templates/default.org +++ b/data/templates/default.org @@ -9,6 +9,12 @@ $if(date)$ #+date: $date$ $endif$ +$if(options/pairs)$ +$for(options/pairs)$ +#+options: ${it.key}:${it.value} +$endfor$ + +$endif$ $for(header-includes)$ $header-includes$ diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs index 6c05467cb..f1a516a66 100644 --- a/src/Text/Pandoc/Writers/Org.hs +++ b/src/Text/Pandoc/Writers/Org.hs @@ -71,6 +71,17 @@ pandocToOrg (Pandoc meta blocks) = do let main = body $+$ notes let context = defField "body" main . defField "math" hasMath + . defField "options" + (M.fromList + ((if isEnabled Ext_smart_quotes opts + then (("'", "t"):) + else id) . + (if not (isEnabled Ext_special_strings opts) + then (("-", "nil"):) + else id) + $ ([] :: [(Text, Text)]))) + . defField "option-special-strings" + (isEnabled Ext_special_strings opts) $ metadata return $ render colwidth $ case writerTemplate opts of diff --git a/test/command/10919.md b/test/command/10919.md new file mode 100644 index 000000000..6f03c8371 --- /dev/null +++ b/test/command/10919.md @@ -0,0 +1,21 @@ +# Org output with smart quotes turned on + +``` +% pandoc -t org+smart_quotes -s +"It's nice" she said. +^D +#+options: ':t + +"It's nice" she said. +``` + +Same test, but with special strings turned off. +``` +% pandoc -t org+smart_quotes-special_strings -s +"It's nice" she said. +^D +#+options: ':t +#+options: -:nil + +"It’s nice" she said. +``` |
