Skip to content

Releases: hexydec/htmldoc

HTMLdoc v1.2.0

08 May 15:12
Compare
Choose a tag to compare

This release fixes a number of bugs, improves performance and adds some features. Minified output will now also be smaller in certain cases:

  • HTMLdoc now implements \ArrayAccess to enable you to iterate through nodes when searching through documents
  • Improved performance and reliablility of how closing </script> and </style> are detected. Note that you cannot have for example a closing script tag in a javascript string, and still correctly detect the end of the tag, this is for performance reasons and this bug will remain
  • Split the tokenise() method off into its own project
  • Added tests/performance.php which downloads the HTML for 125 different wordpress sites and minifies them, the results are shown in a table
  • Added option to cache minified CSS and Javascript to files, which in performance.php halves the time it takes to process the sites
  • Improved how config is handled internally
  • Added SVG self-closing tags to the config to make sure that self-closing SVG tags are output correctly
  • Configuration is now handled within a separate class which HTMLdoc extends, to make the code more manageable
  • Removed functionality that sorted class names in HTML attributes, as it didn't produce reliable reductions in size whilst taking on average a quarter of the total minification time
  • Updated the class setting in the attributes array to trim any unneeded whitespace from the class attribute
  • Fixed issue where attribute values were trimmed in tag::minify() when $minify['attributes'] was set regardless of the contained settings, it is now contained in a new setting $minify['attributes']['trim']
  • Updated tag::html() to improve how attributes are encoded, now only & and < plus the quote specified as the quote style is encoded
  • Expanded the functionality of the minimal setting in tag::html() to switch to single quotes when there are double quotes in the attribute value to make the encoded output smaller
  • Moved all files up a level in the src folder as it is pointless the files being in another folder
  • Fixed bugs in tag::parse() and tag::parseChildren() where missing closing tags were not handled correctly, before the system only checked the parent tag to know whether the closing tag was missing and didn't handle a closing parent tag correctly. It now closes all tags up to the close tag that is detected, otherwise they are discarded, and uses the entire parent tag chain to detect this
  • String comparisons are now strict where possible
  • Fixed bug in htmldoc::open() where the charset could end up being set to false, which then caused the load() method to fail
  • Fixed issue in tag::html() where the attribute value can be null, but it wasn't converted to a string for a string operation
  • Explicitly namespaced all native functions into the root namespace, as it is clearer and performs better
  • Updated config::__construct() to only recursively merge the config when a custom config has been supplied
  • Reworked script::minify() and style::minify() to implement caching which is controlled by a config
  • Restructured the custom config for style and script to make it simpler

HTMLDoc v1.0.1

15 Mar 18:45
Compare
Choose a tag to compare

This is a bug fix release to resolve an issue with a mishandled variable when specifying not to minify style or script tags.

HTMLDoc v1.0.0

13 Mar 15:45
Compare
Choose a tag to compare

This release marks the software as stable and ready for production use. There are a number of performance improvements and bug fixes:

  • The tokeniser is now an object that processes tokens as they are requested, this significantly reduces memory consumption, especially in larger documents
  • Attribute capture performance is improved through capturing whitespace with the attribute, rather than a separate whitespace token
  • Optimised token capture order so matches are captured faster
  • Tokens are now captured with numeric indexes only rather than both associatively and numerically
  • Memory usage is now measured as peak usage in index.php
  • Fixed ambiguity in comments config, where there wasn't a spacific option to turn the feature on or off
  • Fixed cast issues with mb_strtolower()
  • Fixed bug where the value attribute was removed if the value was an empty string, but for checkboxes/radio buttons, the default value is "on"
  • Updated composer to version 2
  • \hexydec\jslite\jslite is now the default javascript minifier

HTMLdoc v0.9.0

11 Jul 23:12
Compare
Choose a tag to compare

This version updates how certain tags are handled internally to make processing them more extensible, and removes the classes that handled CSS minification as this is now a separate project:

  • Removed CSSdoc as it is now a separate project (https://github.com/hexydec/cssdoc), added as a composer dependency
  • Updated how custom tags are handled, they can now be configured through a separate config, and built in handlers are supplied for script and style tags
  • Style tag handler uses CSSdoc if it is available
  • You can now specify minifier options for specific elements, and defaults are setup to handle elements that are by default white-space: pre;
  • Can now specify output options per element, this enables SVG's to be output as XML compliant
  • Added a test for SVG output

HTMLdoc v0.8.6

11 Mar 23:17
Compare
Choose a tag to compare

This release makes type handling stricter internally and fixes a number of strict type handling errors:

  • Added declare(strict_types=1) to all files and fixed type errors.
  • Added code comments to index.php.
  • comment class is now implementing the token interface.
  • Fixed bug in htmldoc::open() where fopen had the context argument in the wrong place.
  • Fixed bug in htmldoc::htmlentities() where preg_split() has an incorrect argument.
  • Fixed bugs in tag::parseChildren() where strcasecmp() can't handle nulls.
  • Fixed bug in tag::minify() where trim cannot accept a null.

HTMLdoc v0.8.5

02 Mar 21:19
Compare
Choose a tag to compare

First Release.

Code is now stable enough for production usage, CSS minifier still needs some work.