html5ever

所属分类:collect
开发工具:Rust
文件大小:0KB
下载次数:0
上传日期:2023-06-21 10:41:23
上 传 者sh-1993
说明:  高性能浏览器级HTML5解析器,
(High-performance browser-grade HTML5 parser,)

文件列表:
AUTHORS (724, 2023-09-05)
COPYRIGHT (422, 2023-09-05)
Cargo.toml (105, 2023-09-05)
LICENSE-APACHE (10847, 2023-09-05)
LICENSE-MIT (1076, 2023-09-05)
html5ever/ (0, 2023-09-05)
html5ever/Cargo.toml (746, 2023-09-05)
html5ever/LICENSE-APACHE (10847, 2023-09-05)
html5ever/LICENSE-MIT (1076, 2023-09-05)
html5ever/benches/ (0, 2023-09-05)
html5ever/benches/html5ever.rs (2637, 2023-09-05)
html5ever/build.rs (1223, 2023-09-05)
html5ever/data/ (0, 2023-09-05)
html5ever/data/bench/ (0, 2023-09-05)
html5ever/data/bench/lipsum-zh.html (3611, 2023-09-05)
html5ever/data/bench/lipsum.html (12665, 2023-09-05)
html5ever/data/bench/medium-fragment.html (4523, 2023-09-05)
html5ever/data/bench/small-fragment.html (811, 2023-09-05)
html5ever/data/bench/strong.html (1024, 2023-09-05)
html5ever/data/bench/tiny-fragment.html (21, 2023-09-05)
html5ever/examples/ (0, 2023-09-05)
html5ever/examples/arena.rs (10137, 2023-09-05)
html5ever/examples/capi/ (0, 2023-09-05)
html5ever/examples/capi/tokenize.c (1793, 2023-09-05)
html5ever/examples/noop-tokenize.rs (1367, 2023-09-05)
html5ever/examples/noop-tree-builder.rs (3185, 2023-09-05)
html5ever/examples/print-tree-actions.rs (4851, 2023-09-05)
html5ever/examples/tokenize.rs (3165, 2023-09-05)
html5ever/fuzz/ (0, 2023-09-05)
html5ever/fuzz/Cargo.toml (471, 2023-09-05)
html5ever/fuzz/fuzz_targets/ (0, 2023-09-05)
html5ever/fuzz/fuzz_targets/fuzz_document_parse.rs (947, 2023-09-05)
... ...

# html5ever [![Build Status](https://github.com/servo/html5ever/actions/workflows/main.yml/badge.svg)](https://github.com/servo/html5ever/actions) [![crates.io](https://img.shields.io/crates/v/html5ever.svg)](https://crates.io/crates/html5ever) [API Documentation][API documentation] html5ever is an HTML parser developed as part of the [Servo][] project. It can parse and serialize HTML according to the [WHATWG](https://whatwg.org/) specs (aka "HTML5"). However, there are some differences in the actual behavior currently, most of which are documented [in the bug tracker][]. html5ever passes all tokenizer tests from [html5lib-tests][], with most tree builder tests outside of the unimplemented features. The goal is to pass all html5lib tests, while also providing all hooks needed by a production web browser, e.g. `document.write`. Note that the HTML syntax is very similar to XML. For correct parsing of XHTML, use an XML parser (That said, many XHTML documents in the wild are serialized in an HTML-compatible form). html5ever is written in [Rust][], therefore it avoids the notorious security problems that come along with using C. Being built with Rust also makes the library come with the high-grade performance you would expect from an HTML parser written in C. html5ever is basically a C HTML parser, but without needing a garbage collector or other heavy runtime processes. ## Getting started in Rust Add html5ever as a dependency in your [`Cargo.toml`](https://crates.io/) file: ```toml [dependencies] html5ever = "0.26" ``` You should also take a look at [`examples/html2html.rs`], [`examples/print-rcdom.rs`], and the [API documentation][]. ## Getting started in other languages Bindings for Python and other languages are much desired. ## Working on html5ever To fetch the test suite, you need to run ``` git submodule update --init ``` Run `cargo doc` in the repository root to build local documentation under `target/doc/`. ## Details html5ever uses callbacks to manipulate the DOM, therefore it does not provide any DOM tree representation. html5ever exclusively uses UTF-8 to represent strings. In the future it will support other document encodings (and UCS-2 `document.write`) by converting input. The code is cross-referenced with the WHATWG syntax spec, and eventually we will have a way to present code and spec side-by-side. html5ever builds against the official stable releases of Rust, though some optimizations are only supported on nightly releases. [API documentation]: https://doc.servo.org/html5ever/index.html [Servo]: https://github.com/servo/servo [Rust]: https://www.rust-lang.org/ [in the bug tracker]: https://github.com/servo/html5ever/issues?q=is%3Aopen+is%3Aissue+label%3Aweb-compat [html5lib-tests]: https://github.com/html5lib/html5lib-tests [`examples/html2html.rs`]: https://github.com/servo/html5ever/blob/master/rcdom/examples/html2html.rs [`examples/print-rcdom.rs`]: https://github.com/servo/html5ever/blob/master/rcdom/examples/print-rcdom.rs

近期下载者

相关文件


收藏者