Skip to content

8.1.4 - Glorious Golden Lobster Edition

Choose a tag to compare

@kata198 kata198 released this 15 Nov 00:01
· 88 commits to master since this release
  • 8.1.4 - Nov 14 2018
  • Expand documentation in README

  • Add "slim" option to formatHTML, available with either -s or --slim. This will use either the AdvancedHTMLSlimTagFormatter (if in pretty mode, default) or AdvancedHTMLSlimTagMiniFormatter (if in mini mode, -m or --mini)

  • Intercept control+c in formatHTML when reading from stdin and exit cleanly instead of displaying error message

  • Add "--version" switch to formatHTML to print the AdvancedHTMLParser suite version

  • 8.1.3 - Oct 16 2018
  • Fix python2 inheritance issue with new SlimTag formatters
  • 8.1.2 - Oct 16 2018
  • Add two new formatters to AdvancedHTMLParser.Formatter - AdvancedHTMLSlimTagFormatter and AdvancedHTMLSlimTagMiniFormatter

    • These represent the pretty-printer and mini-printer respectively, but will omit the trailing space on start tags,

      e.x. will become

    • By default, self-closing tags will retain their trailing space, e.x.


      .
      This is for xhtml compatibility so that the "/" does not become part of the previous attribute or its own attribute

      This can be toggled-off by passing "slimSelfClosing=True" to either of the new formatters, and your output will be


  • Added tests and documentation for the two new formatter types

  • Ensure that AdvancedHTMLMiniFormatter is exported by the AdvancedHTMLParser.init.py

  • Add both new SlimTag formatters to be exported by AdvancedHTMLParser.init.py

  • Update the version reference within the pydoc url within the READMEs to bypass caching of previous versions

  • 8.1.1 - Oct 15 2018
  • Add AdvancedHTMLMiniFormatter to top-module level (so from AdvancedHTMLParser import AdvancedHTMLMiniFormatter works as well as from AdvancedHTMLParser.Formatter import AdvancedHTMLMiniFormatter)

  • Update "formatHTML" program

    • Expand --help - Now documents the options better.

    • Document the previously-implemented but unadvertised --indent=' ' argument to formatHTML, to set the level-indentation

    • Add "-p" or "--pretty" to toggle pretty-printer on formatHTML program (default mode)

    • Add "-m" or "--mini" to toggle the mini-printer on formatHTML program (new)

  • 8.1.0 - Oct 15 2018
  • Fix an issue where .classNames became no longer an attribute. [ Bug report and solution validation found by github user mninc [ https://github.com/mninc] ]

  • Fix an issue where under certain conditions binary attributes would have a value of string 'None' (like hidden="None" instead of just hidden in the output) [ Bug report and solution validation found by github user UntoSten [ https://github.com/UntoSten ] ]

  • Expand unit tests to explicitly test the above two scenarios

  • Fixed IndexedAdvancedHTMLParser not working in some conditions due to a typo in a previous change

  • Added a new formatter to AdvancedHTMLParser.Formatter - AdvancedHTMLMiniFormatter which will output mini html.

    This will have all non-functional whitespace removed (keeping single-spaces which take up 1 character width), and provide no indentation.

    For example, the following:

'''<title>Hello World</title>

Hello world And welcome to the show.
'''

If parsed and run through AdvancedHTMLMiniFormatter would come out as:

'<title >Hello World</title>

Hello world And welcome to the show.
'

retaining a space where one would not be ignored before, but removing all non-disregarded whitespace.

This feature is available on an AdvancedHTMLParser.AdvancedHTMLParser object via the new method "getMiniHTML"

As a reminder, "getHTML()" on a parser will retain all original whitespace,

"getFormattedHTML()" with an optional "indent" parameter (default 4 spaces per line) will pretty-print your HTML

and now "getMiniHTML()" will minify it.