Skip to content

Commit e5338dc

Browse files
committed
Expose HtmlSerializer for customizing output
1 parent d09dd0f commit e5338dc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

html5ever/src/serialize/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ impl Default for SerializeOpts {
4646
}
4747

4848
#[derive(Default)]
49-
struct ElemInfo {
49+
pub struct ElemInfo {
5050
html_name: Option<LocalName>,
5151
ignore_children: bool,
5252
processed_first_child: bool,
5353
}
5454

55-
struct HtmlSerializer<Wr: Write> {
56-
writer: Wr,
55+
pub struct HtmlSerializer<Wr: Write> {
56+
pub writer: Wr,
5757
opts: SerializeOpts,
5858
stack: Vec<ElemInfo>,
5959
}
@@ -71,7 +71,7 @@ fn tagname(name: &QualName) -> LocalName {
7171
}
7272

7373
impl<Wr: Write> HtmlSerializer<Wr> {
74-
fn new(writer: Wr, opts: SerializeOpts) -> Self {
74+
pub fn new(writer: Wr, opts: SerializeOpts) -> Self {
7575
let html_name = match opts.traversal_scope {
7676
TraversalScope::IncludeNode | TraversalScope::ChildrenOnly(None) => None,
7777
TraversalScope::ChildrenOnly(Some(ref n)) => Some(tagname(n))

0 commit comments

Comments
 (0)