aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
blob: 40b691a39644a5f6881567a68a074889fa11b0da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#![warn(missing_docs)]
// This is an HTML parser. HTML can be untrusted input from the internet.
#![forbid(clippy::undocumented_unsafe_blocks)]
#![forbid(clippy::multiple_unsafe_ops_per_block)]
#![doc = concat!("[`examples/spans.rs`]: ", file_url!("examples/spans.rs"))]
#![doc = concat!("[changelog]: ", file_url!("CHANGELOG.md"))]
#![doc = concat!("[the LICENSE file]: ", file_url!("LICENSE"))]
#![doc = include_str!("../README.md")]

mod default_emitter;
mod emitter;
mod entities;
mod error;
mod let_else;
mod naive_parser;
mod tokenizer;

/// Types for HTML attributes.
pub mod attr {
    pub use crate::token::{
        AttrIntoIter, AttrIter, AttrValueSyntax, Attribute, AttributeMap, AttributeOwned,
    };
}
pub mod offset;
pub mod reader;
pub mod token;

pub use default_emitter::DefaultEmitter;
pub use emitter::Emitter;
pub use error::Error;
pub use naive_parser::NaiveParser;
pub use token::{Comment, Doctype, EndTag, StartTag, Token};
pub use tokenizer::{CdataAction, Event, State, Tokenizer};

#[cfg(feature = "integration-tests")]
pub use tokenizer::InternalState;

/// Relative links in the README.md don't work in rustdoc, so we have to override them.
macro_rules! file_url {
    ($path:literal) => {
        concat!(
            env!("CARGO_PKG_REPOSITORY"),
            "/tree/",
            $path,
            "?h=v",
            env!("CARGO_PKG_VERSION")
        )
    };
}