On March 13, after four months of development, the release of the high-performance library 2.7.0 took place lexbor, designed for processing HTML 5 and CSS formats.
Key features of the project:
- full support for WHATWG, W3C, and Unicode specifications: HTML5, CSS Syntax 3, Encoding, URL, Unicode Standard Annex #15, Unicode Technical Standard #46, Punycode, Unicode Standard Annex #15, Unicode Technical Standard #46;
- manipulation of DOM elements and attributes: adding, modifying, deleting, etc.;
- support for parsing HTML fragments;
- passing all DOM tree construction tests;
- tested on over 200 million HTML pages using ASAN;
- support for determining encoding from the byte stream;
- CSS style analysis in tag attributes and in the <style> tag;
- searching HTML elements using CSS selectors;
- support for 40 encodings in encoding and decoding;
- support for unbuffered and buffered encoding and decoding;
- written in C (C99 standard) without third-party dependencies and distributed under the Apache 2.0 license;
- the library is divided into modules (Core, CSS, DOM, Encoding, Engine, HTML, NS, Punycode, Selectors, Tag, Unicode, URL, Utils), which can be compiled and used as separate libraries (with the CMake option LEXBOR_BUILD_SEPARATELY=ON);
- third-party bindings and wrappers for the languages Crystal, D, Elixir, Julia, PHP, Python and Ruby.
Key Changes:
- Support for amalgamation (combining source files into one file) has been added. This simplifies the integration of the library into projects – just connect one file instead of using the entire build system. For more details, see the documentation.
- A large-scale refactoring of the code responsible for parsing CSS has been carried out in preparation for the implementation of layout.
- Input stream checks in the HTML parser have been added (this is necessary solely for outputting parsing errors per the specification). Disabled by default, see html/#tokenizer-options.
- Preparation of the code for the release of the layout engine.
- General improvements and bug fixes.
Source: linux.org.ru
