summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Org/ParserState.hs
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2016-06-03 11:10:18 +0200
committerAlbert Krewinkel <albert@zeitkraut.de>2016-06-03 11:41:23 +0200
commitf56792927fbcebfd25593c488476fee69d078b48 (patch)
treeb8f728a05881ab447e9204a92f86bc098e87fc7c /src/Text/Pandoc/Readers/Org/ParserState.hs
parentd4de8451b9eae1681b0026057757444127d18d43 (diff)
Org reader: support special strings export option
Parsing of special strings (like '...' as ellipsis or '--' as en dash) can be toggled using the `-` option.
Diffstat (limited to 'src/Text/Pandoc/Readers/Org/ParserState.hs')
-rw-r--r--src/Text/Pandoc/Readers/Org/ParserState.hs20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Readers/Org/ParserState.hs b/src/Text/Pandoc/Readers/Org/ParserState.hs
index 2fa5d920b..0c58183f9 100644
--- a/src/Text/Pandoc/Readers/Org/ParserState.hs
+++ b/src/Text/Pandoc/Readers/Org/ParserState.hs
@@ -45,6 +45,7 @@ module Text.Pandoc.Readers.Org.ParserState
, setExportDrawers
, setExportEmphasizedText
, setExportSmartQuotes
+ , setExportSpecialStrings
, setExportSubSuperscripts
, modifyExportSettings
, optionsToParserState
@@ -84,8 +85,9 @@ data ExportSettings = ExportSettings
-- ^ Specify drawer names which should be exported. @Left@ names are
-- explicitly excluded from the resulting output while @Right@ means that
-- only the listed drawer names should be included.
- , exportEmphasizedText :: Bool -- ^ Parse emphasized text.
- , exportSmartQuotes :: Bool -- ^ Parse quotes, ellipses, apostrophs smartly
+ , exportEmphasizedText :: Bool -- ^ Parse emphasized text
+ , exportSmartQuotes :: Bool -- ^ Parse quotes smartly
+ , exportSpecialStrings :: Bool -- ^ Parse ellipses and dashes smartly
, exportSubSuperscripts :: Bool -- ^ TeX-like syntax for sub- and superscripts
}
@@ -160,6 +162,7 @@ defaultExportSettings = ExportSettings
{ exportDrawers = Left ["LOGBOOK"]
, exportEmphasizedText = True
, exportSmartQuotes = True
+ , exportSpecialStrings = True
, exportSubSuperscripts = True
}
@@ -182,15 +185,20 @@ setExportDrawers val es = es { exportDrawers = val }
setExportEmphasizedText :: ExportSettingSetter Bool
setExportEmphasizedText val es = es { exportEmphasizedText = val }
+-- | Set export options for parsing of smart quotes.
+setExportSmartQuotes :: ExportSettingSetter Bool
+setExportSmartQuotes val es = es { exportSmartQuotes = val }
+
+-- | Set export options for parsing of special strings (like em/en dashes or
+-- ellipses).
+setExportSpecialStrings :: ExportSettingSetter Bool
+setExportSpecialStrings val es = es { exportSpecialStrings = val }
+
-- | Set export options for sub/superscript parsing. The short syntax will
-- not be parsed if this is set set to @False@.
setExportSubSuperscripts :: ExportSettingSetter Bool
setExportSubSuperscripts val es = es { exportSubSuperscripts = val }
--- | Set export options for parsing of smart quotes.
-setExportSmartQuotes :: ExportSettingSetter Bool
-setExportSmartQuotes val es = es { exportSmartQuotes = val }
-
-- | Modify a parser state
modifyExportSettings :: ExportSettingSetter a -> a -> OrgParserState -> OrgParserState
modifyExportSettings setter val state =