diff options
| author | Albert Krewinkel <[email protected]> | 2025-07-24 11:27:12 +0200 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2025-08-06 12:54:12 -0700 |
| commit | 90afbea1db63dd0b84a17fdd5702dc43107725d8 (patch) | |
| tree | 1730fedbd9727bc8d801ecfc2d08e0ecb0995b92 | |
| parent | b24bba7a20b1d40b4b9de71015e29fa535a395f3 (diff) | |
Org writer: disable smart quotes by default
| -rw-r--r-- | src/Text/Pandoc/Writers/Org.hs | 12 | ||||
| -rw-r--r-- | test/writer.org | 16 |
2 files changed, 18 insertions, 10 deletions
diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs index 8def0cf8b..6c05467cb 100644 --- a/src/Text/Pandoc/Writers/Org.hs +++ b/src/Text/Pandoc/Writers/Org.hs @@ -496,10 +496,18 @@ inlineToOrg (Subscript lst) = do inlineToOrg (SmallCaps lst) = inlineListToOrg lst inlineToOrg (Quoted SingleQuote lst) = do contents <- inlineListToOrg lst - return $ "'" <> contents <> "'" + opts <- gets stOptions + return $ + if isEnabled Ext_smart opts || isEnabled Ext_smart_quotes opts + then "'" <> contents <> "'" + else "‘" <> contents <> "’" inlineToOrg (Quoted DoubleQuote lst) = do contents <- inlineListToOrg lst - return $ "\"" <> contents <> "\"" + opts <- gets stOptions + return $ + if isEnabled Ext_smart opts || isEnabled Ext_smart_quotes opts + then "\"" <> contents <> "\"" + else "“" <> contents <> "”" inlineToOrg (Cite cs lst) = do opts <- gets stOptions if isEnabled Ext_citations opts diff --git a/test/writer.org b/test/writer.org index ee081d35d..17e7ad3ac 100644 --- a/test/writer.org +++ b/test/writer.org @@ -563,16 +563,16 @@ a^b c^d, a~b c~d. :PROPERTIES: :CUSTOM_ID: smart-quotes-ellipses-dashes :END: -"Hello," said the spider. "'Shelob' is my name." +“Hello,” said the spider. “‘Shelob’ is my name.” -'A', 'B', and 'C' are letters. +‘A’, ‘B’, and ‘C’ are letters. -'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.' +‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’ -'He said, "I want to go."' Were you alive in the 70's? +‘He said, “I want to go.”’ Were you alive in the 70's? -Here is some quoted '=code=' and a -"[[http://example.com/?foo=1&bar=2][quoted link]]". +Here is some quoted ‘=code=’ and a +“[[http://example.com/?foo=1&bar=2][quoted link]]”. Some dashes: one---two --- three---four --- five. @@ -599,7 +599,7 @@ Ellipses...and...and.... These shouldn't be math: - To get the famous equation, write =$e = mc^2$=. -- $22,000 is a /lot/ of money. So is $34,000. (It worked if "lot" is +- $22,000 is a /lot/ of money. So is $34,000. (It worked if “lot” is emphasized.) - Shoes ($20) and socks ($5). - Escaped =$=: $73 /this should be emphasized/ 23$. @@ -762,7 +762,7 @@ or here: <http://example.com/> :PROPERTIES: :CUSTOM_ID: images :END: -From "Voyage dans la Lune" by Georges Melies (1902): +From “Voyage dans la Lune” by Georges Melies (1902): #+caption: lalune [[file:lalune.jpg]] |
