html: Do not export Node in the public API

It is not usable on its own and it is
not in the output of any public method.
This commit is contained in:
Kévin Commaille 2024-04-22 17:08:35 +02:00 committed by Kévin Commaille
parent 221e9c055c
commit d36f485b19
3 changed files with 8 additions and 3 deletions

View File

@ -1,5 +1,10 @@
# [unreleased]
Breaking Changes:
- Do not export `Node` in the public API, it is not usable on its own and it is
not in the output of any public method.
Improvements:
- Add support for deprecated HTML tags, according to Matrix 1.10

View File

@ -297,7 +297,7 @@ impl fmt::Display for Html {
/// An HTML node.
#[derive(Debug)]
#[non_exhaustive]
pub struct Node {
pub(crate) struct Node {
pub(crate) parent: Option<usize>,
pub(crate) prev_sibling: Option<usize>,
pub(crate) next_sibling: Option<usize>,
@ -320,7 +320,7 @@ impl Node {
}
/// Returns the data of this `Node` if it is an Element (aka an HTML tag).
pub fn as_element(&self) -> Option<&ElementData> {
pub(crate) fn as_element(&self) -> Option<&ElementData> {
as_variant!(&self.data, NodeData::Element)
}

View File

@ -16,6 +16,6 @@ mod sanitizer_config;
pub use self::{
helpers::*,
html::{ElementData, Html, Node},
html::{ElementData, Html},
sanitizer_config::SanitizerConfig,
};