parse

Go parsers for web formats

MIT License

Stars
403

Bot releases are hidden (Show)

parse - v2.4.2

Published by tdewolff almost 5 years ago

  • Add many hashes for CSS
  • Add amp-boilerplate hash for HTML
  • NewError now has fmt-style function signature
  • Append 0x00 to signal EOF even if source already ends in 0x00 (which may be valid)
parse - v2.4.1

Published by tdewolff almost 5 years ago

CSS: add Invert and Solid hashes

parse - v2.4.0

Published by tdewolff almost 5 years ago

  • XML and HTML: Text() []byte returns nil for start tag closers
  • XML and HTML: Text() []byte returns textual content for TextToken, CommentToken, ...
  • Added Offset() int for all lexers and parsers that returns the current character offset in the input stream
  • CSS: EOF after \ now properly handled as DelimToken and not EscapeToken in some cases
parse - v2.3.15

Published by tdewolff almost 5 years ago

Bugfix: bad URL encoding resulted in no decoding at all, the new EncodeURL and DecodeURL are faster and never fail
Bugfix: get correct Position if it is in the middle of a unicode codepoint

parse - v2.3.14

Published by tdewolff almost 5 years ago

  • Re-parse input immediately when encountering parse error. Previously this was only done if the error was actually read which would save us from re-parsing the file (i.e. better performance). However, an error is (a) rare and (b) happens only once per file. Re-parsing on errors does not impact the performance of well formatted files, and a reliable error message is valued more.
  • Bugfix: prevent infinite loop on error on input file that contains unicode code points (i.e. any character bigger than 0xC0 usually followed by more bytes).
  • Improve error messages for parsers to include parser name and print offending byte(s)
parse - v2.3.13

Published by tdewolff almost 5 years ago

  • Improve performance of ReplaceMultipleWhitespace by 20%--25%
  • Add ReplaceEntities and ReplaceMultipleWhitespaceAndEntities to replace QuoteEntity. These allow to do replacements such as: " => ", " => ", " => ", ’ => ’, ' => '.
  • Update list of HTML entity rewrites
parse - v2.3.12

Published by tdewolff almost 5 years ago

Revert v2.3.11 and readd html.Keygen hash.

parse - v2.3.11

Published by tdewolff almost 5 years ago

Add ReplaceEntities and remove entity replacement from EscapeAttrVal

parse - v2.3.10

Published by tdewolff almost 5 years ago

Add and remove hashes for CSS and HTML

parse - v2.3.9

Published by tdewolff about 5 years ago

CSS: keep whitespace in unknown at rules

parse - v2.3.8

Published by tdewolff over 5 years ago

  • Remove import comments
  • Fix bug in CSS parsing when encountering } in CSS inline
parse - v2.3.7

Published by tdewolff over 5 years ago

  • Fix position information on errors
  • CSS: fix error position
parse -

Published by tdewolff over 5 years ago

  • Prevent panic when returning Bytes() on empty buffer
  • Set proper context in errors
  • Limit the length in context in errors
  • In EqualFold only match upper/lower case on alphabet characters
  • Add option to EscapeAttrVal to handle attribute values for XML (use double quotes)
  • HTML: add hashes for RDFa attribute names
  • JS: accept NULL characters as code
  • JSON: report errors NULL characters
parse - Fix CSS parsing of bad declarations

Published by tdewolff almost 6 years ago

  • CSS: fix parsing of bad declarations
  • CSS: handle comments within declarations
  • CSS: reintroduce IE star hack *color: white
  • CSS: add keywords to hash table
parse - Go modules support

Published by tdewolff almost 6 years ago

Add Go modules support by using the github.com/tdewolff/parse/v2 import path.

parse - Release for minify-v2.3.5

Published by tdewolff over 6 years ago

parse - Bugfixes for NULL handling

Published by tdewolff almost 7 years ago

This fixes a couple of bugs in the HTML, XML and JS implementations that caused out-of-bounds panics. The HTML parser now allows NULL bytes to be in the source.

parse - Remove dependencies on buffer and strconv

Published by tdewolff almost 7 years ago

parse - Performance

Published by tdewolff almost 7 years ago

  • Use a new buffer that holds all data in memory, giving significant speed-ups for parsing
  • Speed-up JSON consumeString
  • Break CSS selectors at the commas, this reduces memory requirements for (mostly) SASS/LESS generated CSS
  • Add position tracking upon errors, showing line number and column in the error message
parse - v2.2.0

Published by tdewolff almost 7 years ago

This v2.2 release is synchronous with tdewolff/minify v2.2

Changelog:

  • JS: improved parsing of edge cases
  • JS: allow HTML inline comments
  • CSS: improved parsing of bad declarations
  • CSS: parse custom properties

Thanks to @RReverser for improvements on the JS parser.