'--no-wrap' option now prevents the addition of structural whitespace
in HTML output, minimizing the file size. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1053 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
parent
a81613df34
commit
447b99e35d
4 changed files with 17 additions and 9 deletions
4
README
4
README
|
@ -331,8 +331,8 @@ For further documentation, see the `pandoc(1)` man page.
|
|||
sections are not numbered.
|
||||
|
||||
`--no-wrap`
|
||||
: disables text-wrapping in Markdown, reStructuredText, DocBook, and man
|
||||
output.
|
||||
: disables text-wrapping in Markdown, reStructuredText, DocBook, HTML,
|
||||
and man output.
|
||||
|
||||
`--dump-args`
|
||||
: is intended to make it easier to create wrapper scripts that use
|
||||
|
|
6
debian/changelog
vendored
6
debian/changelog
vendored
|
@ -84,13 +84,15 @@ pandoc (0.45) unstable; urgency=low
|
|||
addition to "\r\n" and '\n').
|
||||
|
||||
* Added a writer option for wrapped text and a command-line option
|
||||
'--no-wrap', which disables text wrapping. (Resolves Issue #26.)
|
||||
'--no-wrap', which disables text wrapping and minimizes whitespace
|
||||
in HTML. (Resolves Issue #26.)
|
||||
|
||||
+ Added support for '--no-wrap' to Main.hs.
|
||||
+ Added wrapIfNeeded function to Text.Pandoc.Shared.
|
||||
+ Use wrapIfNeeded instead of wrapped in the RST, Man, Docbook, and
|
||||
Markdown writers.
|
||||
+ Note: Not yet implemented in HTML, LaTeX, or ConTeXt writers.
|
||||
+ Added render and renderFragment helpers to HTML writer.
|
||||
+ Note: Not yet implemented in LaTeX or ConTeXt writers.
|
||||
|
||||
* Modified html2markdown to run tidy only if the HTML cannot be
|
||||
parsed. Previously html2markdown piped all input through tidy
|
||||
|
|
|
@ -115,8 +115,8 @@ to Pandoc. Or use `html2markdown`(1), a wrapper around `pandoc`.
|
|||
them.)
|
||||
|
||||
\--no-wrap
|
||||
: Disable text wrapping in Markdown, reStructuredText, DocBook, and man
|
||||
output. (Default is to wrap text.)
|
||||
: Disable text wrapping in Markdown, reStructuredText, DocBook, HTML,
|
||||
and man output. (Default is to wrap text.)
|
||||
|
||||
\--toc, \--table-of-contents
|
||||
: Include an automatically generated table of contents (HTML, markdown,
|
||||
|
|
|
@ -51,12 +51,18 @@ defaultWriterState :: WriterState
|
|||
defaultWriterState = WriterState {stNotes= [], stIds = [],
|
||||
stMath = False, stCSS = S.empty}
|
||||
|
||||
-- Helpers to render HTML with the appropriate function.
|
||||
render opts = if writerWrapText opts then renderHtml else showHtml
|
||||
renderFragment opts = if writerWrapText opts
|
||||
then renderHtmlFragment
|
||||
else showHtmlFragment
|
||||
|
||||
-- | Convert Pandoc document to Html string.
|
||||
writeHtmlString :: WriterOptions -> Pandoc -> String
|
||||
writeHtmlString opts =
|
||||
if writerStandalone opts
|
||||
then renderHtml . writeHtml opts
|
||||
else renderHtmlFragment . writeHtml opts
|
||||
then render opts . writeHtml opts
|
||||
else renderFragment opts . writeHtml opts
|
||||
|
||||
-- | Convert Pandoc document to Html structure.
|
||||
writeHtml :: WriterOptions -> Pandoc -> Html
|
||||
|
@ -406,7 +412,7 @@ inlineToHtml opts inline =
|
|||
linkText
|
||||
(Image txt (source,tit)) -> do
|
||||
alternate <- inlineListToHtml opts txt
|
||||
let alternate' = renderHtmlFragment alternate
|
||||
let alternate' = renderFragment opts alternate
|
||||
let attributes = [src source] ++
|
||||
(if null tit
|
||||
then []
|
||||
|
|
Loading…
Add table
Reference in a new issue