diff options
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | man/man1/pandoc.1.md | 2 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 3 | ||||
-rw-r--r-- | src/Text/Pandoc/Shared.hs | 4 | ||||
-rw-r--r-- | src/pandoc.hs | 12 |
5 files changed, 12 insertions, 11 deletions
@@ -384,7 +384,7 @@ For further documentation, see the `pandoc(1)` man page. is specified, *references* is used regardless of the presence of this option. -`--default-code-classes`*=classes* +`--indented-code-classes`*=classes* : specifies classes to use for indented code blocks--for example, `perl,numberLines` or `haskell`. Multiple classes may be separated by spaces or commas. diff --git a/man/man1/pandoc.1.md b/man/man1/pandoc.1.md index f587526fa..6876f3e90 100644 --- a/man/man1/pandoc.1.md +++ b/man/man1/pandoc.1.md @@ -154,7 +154,7 @@ to Pandoc. Or use `html2markdown`(1), a wrapper around `pandoc`. If `--strict` is specified, *references* is used regardless of the presence of this option. -\--default-code-classes*=classes* +\--indented-code-classes*=classes* : Specify classes to use for indented code blocks--for example, `perl,numberLines` or `haskell`. Multiple classes may be separated by spaces or commas. diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index cfd9c8b5c..4f0d1b6ad 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -395,7 +395,8 @@ codeBlockIndented = do return $ b ++ l)) optional blanklines st <- getState - return $ CodeBlock ("", stateDefaultCodeClasses st, []) $ stripTrailingNewlines $ concat contents + return $ CodeBlock ("", stateIndentedCodeClasses st, []) $ + stripTrailingNewlines $ concat contents lhsCodeBlock :: GenParser Char ParserState Block lhsCodeBlock = do diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index 13f4ec3dc..6ca693b77 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -672,7 +672,7 @@ data ParserState = ParserState stateLiterateHaskell :: Bool, -- ^ Treat input as literate haskell stateColumns :: Int, -- ^ Number of columns in terminal stateHeaderTable :: [HeaderType], -- ^ Ordered list of header types used - stateDefaultCodeClasses :: [String] -- ^ Classes to use for indented code blocks + stateIndentedCodeClasses :: [String] -- ^ Classes to use for indented code blocks } deriving Show @@ -697,7 +697,7 @@ defaultParserState = stateLiterateHaskell = False, stateColumns = 80, stateHeaderTable = [], - stateDefaultCodeClasses = [] } + stateIndentedCodeClasses = [] } data HeaderType = SingleHeader Char -- ^ Single line of characters underneath diff --git a/src/pandoc.hs b/src/pandoc.hs index 937491a6a..e24d621bf 100644 --- a/src/pandoc.hs +++ b/src/pandoc.hs @@ -153,7 +153,7 @@ data Opt = Opt , optSanitizeHTML :: Bool -- ^ Sanitize HTML , optPlugins :: [Pandoc -> IO Pandoc] -- ^ Plugins to apply , optEmailObfuscation :: ObfuscationMethod - , optDefaultCodeClasses :: [String] -- ^ Default classes for indented code blocks + , optIndentedCodeClasses :: [String] -- ^ Default classes for indented code blocks #ifdef _CITEPROC , optBiblioFile :: String , optBiblioFormat :: String @@ -190,7 +190,7 @@ defaultOpts = Opt , optSanitizeHTML = False , optPlugins = [] , optEmailObfuscation = JavascriptObfuscation - , optDefaultCodeClasses = [] + , optIndentedCodeClasses = [] #ifdef _CITEPROC , optBiblioFile = [] , optBiblioFormat = [] @@ -314,9 +314,9 @@ options = "none|javascript|references") "" -- "Method for obfuscating email in HTML" - , Option "" ["default-code-classes"] + , Option "" ["indented-code-classes"] (ReqArg - (\arg opt -> return opt { optDefaultCodeClasses = words $ + (\arg opt -> return opt { optIndentedCodeClasses = words $ map (\c -> if c == ',' then ' ' else c) arg }) "STRING") "" -- "Classes (whitespace- or comma-separated) to use for indented code-blocks" @@ -540,7 +540,7 @@ main = do , optWrapText = wrap , optSanitizeHTML = sanitize , optEmailObfuscation = obfuscationMethod - , optDefaultCodeClasses = codeBlockClasses + , optIndentedCodeClasses = codeBlockClasses #ifdef _CITEPROC , optBiblioFile = biblioFile , optBiblioFormat = biblioFormat @@ -597,7 +597,7 @@ main = do ["latex", "context", "man"], stateColumns = columns, stateStrict = strict, - stateDefaultCodeClasses = codeBlockClasses } + stateIndentedCodeClasses = codeBlockClasses } let csslink = if null css then "" else concatMap |