aboutsummaryrefslogtreecommitdiff
path: root/src/pandoc.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/pandoc.hs')
-rw-r--r--src/pandoc.hs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/pandoc.hs b/src/pandoc.hs
index e24d621bf..c2cc9b75e 100644
--- a/src/pandoc.hs
+++ b/src/pandoc.hs
@@ -153,6 +153,7 @@ data Opt = Opt
, optSanitizeHTML :: Bool -- ^ Sanitize HTML
, optPlugins :: [Pandoc -> IO Pandoc] -- ^ Plugins to apply
, optEmailObfuscation :: ObfuscationMethod
+ , optIdentifierPrefix :: String
, optIndentedCodeClasses :: [String] -- ^ Default classes for indented code blocks
#ifdef _CITEPROC
, optBiblioFile :: String
@@ -190,6 +191,7 @@ defaultOpts = Opt
, optSanitizeHTML = False
, optPlugins = []
, optEmailObfuscation = JavascriptObfuscation
+ , optIdentifierPrefix = ""
, optIndentedCodeClasses = []
#ifdef _CITEPROC
, optBiblioFile = []
@@ -314,6 +316,12 @@ options =
"none|javascript|references")
"" -- "Method for obfuscating email in HTML"
+ , Option "" ["id-prefix"]
+ (ReqArg
+ (\arg opt -> return opt { optIdentifierPrefix = arg })
+ "STRING")
+ "" -- "Prefix to add to automatically generated HTML identifiers"
+
, Option "" ["indented-code-classes"]
(ReqArg
(\arg opt -> return opt { optIndentedCodeClasses = words $
@@ -540,6 +548,7 @@ main = do
, optWrapText = wrap
, optSanitizeHTML = sanitize
, optEmailObfuscation = obfuscationMethod
+ , optIdentifierPrefix = idPrefix
, optIndentedCodeClasses = codeBlockClasses
#ifdef _CITEPROC
, optBiblioFile = biblioFile
@@ -627,7 +636,8 @@ main = do
lhsExtension [outputFile],
writerEmailObfuscation = if strict
then ReferenceObfuscation
- else obfuscationMethod }
+ else obfuscationMethod,
+ writerIdentifierPrefix = idPrefix }
when (isNonTextOutput writerName' && outputFile == "-") $
do hPutStrLn stderr ("Error: Cannot write " ++ writerName ++ " output to stdout.\n" ++