@@ -1768,6 +1768,13 @@ fn generate_element(
1768 ElementKind::Noscript => "noscript",
1768 ElementKind::Noscript => "noscript",
1769 ElementKind::Address => "address",
1769 ElementKind::Address => "address",
1770 ElementKind::Search => "search",
1770 ElementKind::Search => "search",
1771+ // Heading elements
1772+ ElementKind::H1 => "h1",
1773+ ElementKind::H2 => "h2",
1774+ ElementKind::H3 => "h3",
1775+ ElementKind::H4 => "h4",
1776+ ElementKind::H5 => "h5",
1777+ ElementKind::H6 => "h6",
1771 ElementKind::Image
1778 ElementKind::Image
1772 | ElementKind::Input
1779 | ElementKind::Input
1773 | ElementKind::HorizontalRule
1780 | ElementKind::HorizontalRule
@@ -1845,6 +1852,12 @@ fn generate_element(
1845 ElementKind::Noscript => "noscript",
1852 ElementKind::Noscript => "noscript",
1846 ElementKind::Address => "address",
1853 ElementKind::Address => "address",
1847 ElementKind::Search => "search",
1854 ElementKind::Search => "search",
1855+ ElementKind::H1 => "h1",
1856+ ElementKind::H2 => "h2",
1857+ ElementKind::H3 => "h3",
1858+ ElementKind::H4 => "h4",
1859+ ElementKind::H5 => "h5",
1860+ ElementKind::H6 => "h6",
1848 _ => "",
1861 _ => "",
@@ -2000,6 +2013,12 @@ fn generate_element(
2000 | ElementKind::Tooltip
2013 | ElementKind::Tooltip
2001 | ElementKind::Chip
2014 | ElementKind::Chip
2002 | ElementKind::Tag
2015 | ElementKind::Tag
2003 ) && let Some(text) = &elem.argument
2022 ) && let Some(text) = &elem.argument
2005 out.push_str(&html_escape(text));
2024 out.push_str(&html_escape(text));
@@ -2007,7 +2026,16 @@ fn generate_element(
2008 // Children
2027 // Children
2009 ctx.depth += 1;
2028 ctx.depth += 1;
2029+ let is_paragraph = matches!(
2010− let is_paragraph = elem.kind == ElementKind::Paragraph;
2031+ ElementKind::Paragraph
2011 for (i, child) in elem.children.iter().enumerate() {
2039 for (i, child) in elem.children.iter().enumerate() {
2012 generate_node(child, Some(&elem.kind), out, styles, ctx);
2040 generate_node(child, Some(&elem.kind), out, styles, ctx);
2013 if is_paragraph && i < elem.children.len() - 1 {
2041 if is_paragraph && i < elem.children.len() - 1 {
@@ -2537,7 +2565,13 @@ fn attrs_to_css(
2537 | ElementKind::Form
2565 | ElementKind::Form
2538 | ElementKind::Details
2566 | ElementKind::Details
2539 | ElementKind::Dialog => css.push_str(FLEX_COLUMN),
2567 | ElementKind::Dialog => css.push_str(FLEX_COLUMN),
2540− ElementKind::Paragraph => css.push_str("margin:0;"),
2568+ ElementKind::Paragraph
2574+ | ElementKind::H6 => css.push_str("margin:0;"),
2541 // Lists: reset browser defaults
2575 // Lists: reset browser defaults
2542 ElementKind::List => css.push_str("margin:0;padding-left:0;list-style:none;"),
2576 ElementKind::List => css.push_str("margin:0;padding-left:0;list-style:none;"),
2543 // Figure / Blockquote: flex column with browser margin reset
2577 // Figure / Blockquote: flex column with browser margin reset