Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/cm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ impl<'a, 'o, 'c> CommonMarkFormatter<'a, 'o, 'c> {
NodeValue::DescriptionItem(..) => (),
NodeValue::DescriptionTerm => (),
NodeValue::DescriptionDetails => self.format_description_details(entering),
NodeValue::Heading(ref nch) => self.format_heading(nch, entering),
NodeValue::Heading(ref nh) => self.format_heading(nh, entering),
NodeValue::CodeBlock(ref ncb) => self.format_code_block(node, ncb, entering),
NodeValue::HtmlBlock(ref nhb) => self.format_html_block(nhb, entering),
NodeValue::ThematicBreak => self.format_thematic_break(entering),
Expand Down Expand Up @@ -538,9 +538,9 @@ impl<'a, 'o, 'c> CommonMarkFormatter<'a, 'o, 'c> {
}
}

fn format_heading(&mut self, nch: &NodeHeading, entering: bool) {
fn format_heading(&mut self, nh: &NodeHeading, entering: bool) {
if entering {
for _ in 0..nch.level {
for _ in 0..nh.level {
write!(self, "#").unwrap();
}
write!(self, " ").unwrap();
Expand Down
8 changes: 4 additions & 4 deletions src/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -619,15 +619,15 @@ fn render_heading<'a, T>(
node: &'a AstNode<'a>,
entering: bool,
) -> io::Result<ChildRendering> {
let NodeValue::Heading(ref nch) = node.data.borrow().value else {
let NodeValue::Heading(ref nh) = node.data.borrow().value else {
unreachable!()
};

match context.plugins.render.heading_adapter {
None => {
if entering {
context.cr()?;
write!(context, "<h{}", nch.level)?;
write!(context, "<h{}", nh.level)?;
render_sourcepos(context, node)?;
context.write_all(b">")?;

Expand All @@ -644,15 +644,15 @@ fn render_heading<'a, T>(
)?;
}
} else {
writeln!(context, "</h{}>", nch.level)?;
writeln!(context, "</h{}>", nh.level)?;
}
}
Some(adapter) => {
let mut text_content = Vec::with_capacity(20);
collect_text(node, &mut text_content);
let content = String::from_utf8(text_content).unwrap();
let heading = HeadingMeta {
level: nch.level,
level: nh.level,
content,
};

Expand Down
4 changes: 2 additions & 2 deletions src/xml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ impl<'o, 'c> XmlFormatter<'o, 'c> {
NodeValue::DescriptionItem(..) => (),
NodeValue::DescriptionTerm => {}
NodeValue::DescriptionDetails => {}
NodeValue::Heading(ref nch) => {
write!(self.output, " level=\"{}\"", nch.level)?;
NodeValue::Heading(ref nh) => {
write!(self.output, " level=\"{}\"", nh.level)?;
}
NodeValue::CodeBlock(ref ncb) => {
if !ncb.info.is_empty() {
Expand Down