summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-01-20 22:48:20 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2011-01-20 22:48:20 -0800
commit9bb5b54102d06fa67961a8c344aa30d3905c3d67 (patch)
tree99ddddc80b79123bba76b90aabfc190d9c8f0e74
parente5e2b0f9abc96fd30bfcec1b2653374e34b9c6dd (diff)
Added --normalize option.
-rw-r--r--README4
-rw-r--r--src/pandoc.hs8
2 files changed, 11 insertions, 1 deletions
diff --git a/README b/README
index 2e598aed8..bdfdeab67 100644
--- a/README
+++ b/README
@@ -186,6 +186,10 @@ Options
equivalents in standard markdown (e.g. definition lists or strikeout
text) will be parsed as raw HTML.
+`--normalize`
+: Normalize the document after reading: merge adjacent
+ `Str` or `Emph` elements, for example, and remove repeated `Space`s.
+
`--reference-links`
: Use reference-style links, rather than inline links, in writing markdown
or reStructuredText. By default inline links are used.
diff --git a/src/pandoc.hs b/src/pandoc.hs
index 22cf7fc8b..58a3330d3 100644
--- a/src/pandoc.hs
+++ b/src/pandoc.hs
@@ -32,7 +32,7 @@ module Main where
import Text.Pandoc
import Text.Pandoc.S5 (s5HeaderIncludes)
import Text.Pandoc.Shared ( tabFilter, ObfuscationMethod (..), readDataFile,
- headerShift, findDataFile )
+ headerShift, findDataFile, normalize )
#ifdef _HIGHLIGHTING
import Text.Pandoc.Highlighting ( languages )
#endif
@@ -215,6 +215,12 @@ options =
(\opt -> return opt { optStrict = True } ))
"" -- "Disable markdown syntax extensions"
+ , Option "" ["normalize"]
+ (NoArg
+ (\opt -> return opt { optTransforms =
+ normalize : optTransforms opt } ))
+ "" -- "Normalize the Pandoc AST"
+
, Option "" ["reference-links"]
(NoArg
(\opt -> return opt { optReferenceLinks = True } ))