aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/App.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/App.hs')
-rw-r--r--src/Text/Pandoc/App.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs
index f8e23b10c..e5be7e620 100644
--- a/src/Text/Pandoc/App.hs
+++ b/src/Text/Pandoc/App.hs
@@ -483,6 +483,7 @@ convertWithOpts opts = do
, readerTrackChanges = optTrackChanges opts
, readerAbbreviations = abbrevs
, readerExtensions = readerExts
+ , readerStripComments = optStripComments opts
}
let transforms = (case optBaseHeaderLevel opts of
@@ -666,6 +667,7 @@ data Opt = Opt
, optIncludeInHeader :: [FilePath] -- ^ Files to include in header
, optResourcePath :: [FilePath] -- ^ Path to search for images etc
, optEol :: LineEnding -- ^ Style of line-endings to use
+ , optStripComments :: Bool -- ^ Skip HTML comments
} deriving (Generic, Show)
instance ToJSON Opt where
@@ -742,6 +744,7 @@ defaultOpts = Opt
, optIncludeInHeader = []
, optResourcePath = ["."]
, optEol = Native
+ , optStripComments = False
}
addMetadata :: (String, String) -> Pandoc -> Pandoc
@@ -1114,6 +1117,11 @@ options =
"NUMBER")
"" -- "Length of line in characters"
+ , Option "" ["strip-comments"]
+ (NoArg
+ (\opt -> return opt { optStripComments = True }))
+ "" -- "Strip HTML comments"
+
, Option "" ["toc", "table-of-contents"]
(NoArg
(\opt -> return opt { optTableOfContents = True }))