Skip to content
Permalink
Browse files
Fix #1795 -- tidy5 config and defaults
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jun 13, 2015
1 parent 11cb0bf commit 59f51e4a44786f688cfc5f32b5b3e351ac789e22
Showing with 16 additions and 6 deletions.
  1. +5 −2 CHANGES.txt
  2. +3 −0 docs/manual.txt
  3. +8 −4 nikola/filters.py
@@ -4,13 +4,16 @@ New in master
Features
--------

* Add support for ``html_tidy_withconfig`` to use a ``tidy5.conf`` file
(Issue #1795)
* Change default tidy5 filters not to drop empty elements (Issue #1795)
* Apply per-post filters via metadata (Issue #914)

Bugfixes
--------

* Fix crash in wordpress code importer (Issue #1819)
* Wrong command was called in nikola auto.
* Call correct command in ``nikola auto``

New in v7.5.1
=============
@@ -19,7 +22,7 @@ Features
--------

* Suggest misspelled commands (Issue #1807)
* New implementation of the ``nikola auto`` command.
* New implementation of the ``nikola auto`` command
* ``requests`` is now required for all Nikola sites
* New ``nikola version --check`` option (Issue #1767)

@@ -1367,6 +1367,9 @@ html_tidy_wrap_attr
html_tidy_mini
Minify HTML 5 into smaller documents with `tidy5 <http://www.html-tidy.org/>`_

html_tidy_withconfig
Run `tidy5 <http://www.html-tidy.org/>`_ with ``tidy5.conf`` as the config file (supplied by user)

html5lib_minify
Minify HTML5 using html5lib_minify

@@ -147,20 +147,24 @@ def jpegoptim(infile):
return runinplace(r"jpegoptim -p --strip-all -q %1", infile)


def html_tidy_withconfig(infile):
return _html_tidy_runner(infile, r"-quiet --show-info no --show-warnings no -utf8 -indent -config tidy5.conf -modify %1")


def html_tidy_nowrap(infile):
return _html_tidy_runner(infile, r"-quiet --show-info no --show-warnings no -utf8 -indent --indent-attributes no --sort-attributes alpha --wrap 0 --wrap-sections no --tidy-mark no -modify %1")
return _html_tidy_runner(infile, r"-quiet --show-info no --show-warnings no -utf8 -indent --indent-attributes no --sort-attributes alpha --wrap 0 --wrap-sections no --drop-empty-elements no --tidy-mark no -modify %1")


def html_tidy_wrap(infile):
return _html_tidy_runner(infile, r"-quiet --show-info no --show-warnings no -utf8 -indent --indent-attributes no --sort-attributes alpha --wrap 80 --wrap-sections no --tidy-mark no -modify %1")
return _html_tidy_runner(infile, r"-quiet --show-info no --show-warnings no -utf8 -indent --indent-attributes no --sort-attributes alpha --wrap 80 --wrap-sections no --drop-empty-elements no --tidy-mark no -modify %1")


def html_tidy_wrap_attr(infile):
return _html_tidy_runner(infile, r"-quiet --show-info no --show-warnings no -utf8 -indent --indent-attributes yes --sort-attributes alpha --wrap 80 --wrap-sections no --tidy-mark no -modify %1")
return _html_tidy_runner(infile, r"-quiet --show-info no --show-warnings no -utf8 -indent --indent-attributes yes --sort-attributes alpha --wrap 80 --wrap-sections no --drop-empty-elements no --tidy-mark no -modify %1")


def html_tidy_mini(infile):
return _html_tidy_runner(infile, r"-quiet --show-info no --show-warnings no -utf8 --indent-attributes no --sort-attributes alpha --wrap 0 --wrap-sections no --tidy-mark no -modify %1")
return _html_tidy_runner(infile, r"-quiet --show-info no --show-warnings no -utf8 --indent-attributes no --sort-attributes alpha --wrap 0 --wrap-sections no --tidy-mark no --drop-empty-elements no -modify %1")


def _html_tidy_runner(infile, options):

0 comments on commit 59f51e4

Please sign in to comment.