diff --git a/CHANGELOG.md b/CHANGELOG.md index 666a2229..07cce5d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,14 @@ Use `cargo release` to create a new release. ## [Unreleased] +### Changed +- Update to pulldown-cmark 0.12 (see [GH-276]). + This notably improves whitespace handling for HTML blocks and inline HTML. +- mdcat now treats inline HTML like inline code, just with different styling (see [GH-276]). + Specifically, mdcat now wraps inline HTML. + +[GH-276]: https://github.com/swsnr/mdcat/pull/276 + ## [2.4.0] – 2024-09-20 ### Added diff --git a/Cargo.lock b/Cargo.lock index 45abe190..e751e55b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1654,15 +1654,22 @@ dependencies = [ [[package]] name = "pulldown-cmark" -version = "0.9.6" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" +checksum = "666f0f59e259aea2d72e6012290c09877a780935cc3c18b1ceded41f3890d59c" dependencies = [ "bitflags 2.6.0", "memchr", + "pulldown-cmark-escape", "unicase", ] +[[package]] +name = "pulldown-cmark-escape" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "007d8adb5ddab6f8e3f491ac63566a7d5002cc7ed73901f72057943fa71ae1ae" + [[package]] name = "pulldown-cmark-mdcat" version = "2.4.0" diff --git a/Cargo.toml b/Cargo.toml index afd9d0fd..a8f55777 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -68,7 +68,7 @@ rust-version = "1.76" [workspace.dependencies] mime = { version = "0.3.17", default-features = false } -pulldown-cmark = { version = "0.9.2", default-features = false } +pulldown-cmark = { version = "0.12.1", default-features = false } reqwest = { version = "0.12.7", default-features = false } similar-asserts = "1.6.0" syntect = { version = "5.2.0", default-features = false } diff --git a/pulldown-cmark-mdcat/src/render.rs b/pulldown-cmark-mdcat/src/render.rs index 8cb77477..4b0b2453 100644 --- a/pulldown-cmark-mdcat/src/render.rs +++ b/pulldown-cmark-mdcat/src/render.rs @@ -11,7 +11,9 @@ use std::io::Result; use anstyle::{Effects, Style}; use pulldown_cmark::Event::*; +use pulldown_cmark::Tag; use pulldown_cmark::Tag::*; +use pulldown_cmark::TagEnd; use pulldown_cmark::{Event, LinkType}; use syntect::highlighting::HighlightIterator; use syntect::util::LinesWithEndings; @@ -34,7 +36,7 @@ use state::*; use write::*; use crate::render::data::{CurrentLine, CurrentTable}; -use crate::render::state::MarginControl::{Margin, NoMargin}; +use crate::render::state::MarginControl::NoMargin; use crate::terminal::capabilities::StyleCapability; use crate::terminal::osc::{clear_link, set_link_url}; pub use data::StateData; @@ -69,8 +71,25 @@ pub fn write_event<'a, W: Write>( .and_data(data) .ok() } - (TopLevel(attrs), Start(Heading(level, _, _))) => { - let (data, links) = data.take_links(); + (TopLevel(attrs), Start(Tag::HtmlBlock)) => { + if attrs.margin_before != NoMargin { + writeln!(writer)?; + } + // We render HTML literally + State::stack_onto(TopLevelAttrs::margin_before()) + .current( + HtmlBlockAttrs { + indent: 0, + initial_indent: 0, + style: settings.theme.html_block_style, + } + .into(), + ) + .and_data(data) + .ok() + } + (TopLevel(attrs), Start(Heading { level, .. })) => { + let (data, links) = data.take_link_references(); write_link_refs(writer, environment, &settings.terminal_capabilities, links)?; if attrs.margin_before != NoMargin { writeln!(writer)?; @@ -87,7 +106,7 @@ pub fn write_event<'a, W: Write>( .and_data(data) .ok() } - (TopLevel(attrs), Start(BlockQuote)) => { + (TopLevel(attrs), Start(BlockQuote(_))) => { if attrs.margin_before != NoMargin { writeln!(writer)?; } @@ -162,20 +181,6 @@ pub fn write_event<'a, W: Write>( .and_data(data) .ok() } - (TopLevel(attrs), Html(html)) => { - if attrs.margin_before == Margin { - writeln!(writer)?; - } - write_styled( - writer, - &settings.terminal_capabilities, - &settings.theme.html_block_style, - html, - )?; - TopLevel(TopLevelAttrs::no_margin_for_html_only()) - .and_data(data) - .ok() - } // Nested blocks with style, e.g. paragraphs in quotes, etc. (Stacked(stack, StyledBlock(attrs)), Start(Paragraph)) => { @@ -190,7 +195,23 @@ pub fn write_event<'a, W: Write>( .and_data(data) .ok() } - (Stacked(stack, StyledBlock(attrs)), Start(BlockQuote)) => { + (Stacked(stack, StyledBlock(attrs)), Start(Tag::HtmlBlock)) => { + if attrs.margin_before != NoMargin { + writeln!(writer)?; + } + let state = HtmlBlockAttrs { + indent: attrs.indent, + initial_indent: attrs.indent, + style: settings.theme.html_block_style.on_top_of(&attrs.style), + } + .into(); + stack + .push(attrs.with_margin_before().into()) + .current(state) + .and_data(data) + .ok() + } + (Stacked(stack, StyledBlock(attrs)), Start(BlockQuote(_))) => { if attrs.margin_before != NoMargin { writeln!(writer)?; } @@ -217,7 +238,7 @@ pub fn write_event<'a, W: Write>( .and_data(data) .ok() } - (Stacked(stack, StyledBlock(attrs)), Start(Heading(level, _, _))) => { + (Stacked(stack, StyledBlock(attrs)), Start(Heading { level, .. })) => { if attrs.margin_before != NoMargin { writeln!(writer)?; } @@ -263,22 +284,6 @@ pub fn write_event<'a, W: Write>( .and_data(data) .ok() } - (Stacked(stack, StyledBlock(attrs)), Html(html)) => { - if attrs.margin_before == Margin { - writeln!(writer)?; - } - write_indent(writer, attrs.indent)?; - write_styled( - writer, - &settings.terminal_capabilities, - &settings.theme.html_block_style.on_top_of(&attrs.style), - html, - )?; - stack - .current(attrs.without_margin_for_html_only().into()) - .and_data(data) - .ok() - } // Lists (Stacked(stack, Inline(ListItem(kind, state), attrs)), Start(Item)) => { @@ -322,6 +327,27 @@ pub fn write_event<'a, W: Write>( .and_data(data) .ok() } + (Stacked(stack, Inline(ListItem(kind, state), attrs)), Start(Tag::HtmlBlock)) => { + let InlineAttrs { indent, style, .. } = attrs; + let initial_indent = if state == StartItem { + 0 + } else { + writeln!(writer)?; + indent + }; + stack + .push(Inline(ListItem(kind, ItemBlock), attrs)) + .current( + HtmlBlockAttrs { + style: settings.theme.html_block_style.on_top_of(&style), + indent, + initial_indent, + } + .into(), + ) + .and_data(data) + .ok() + } (Stacked(stack, Inline(ListItem(kind, _), attrs)), Start(CodeBlock(ck))) => { writeln!(writer)?; let InlineAttrs { indent, style, .. } = attrs; @@ -346,7 +372,7 @@ pub fn write_event<'a, W: Write>( .and_data(data) .ok() } - (Stacked(stack, Inline(ListItem(kind, state), attrs)), Start(Heading(level, _, _))) => { + (Stacked(stack, Inline(ListItem(kind, state), attrs)), Start(Heading { level, .. })) => { if state != StartItem { writeln!(writer)?; write_indent(writer, attrs.indent)?; @@ -375,7 +401,7 @@ pub fn write_event<'a, W: Write>( .and_data(data) .ok() } - (Stacked(stack, Inline(ListItem(kind, _), attrs)), Start(BlockQuote)) => { + (Stacked(stack, Inline(ListItem(kind, _), attrs)), Start(BlockQuote(_))) => { writeln!(writer)?; let block_quote = StyledBlockAttrs::from(&attrs) .without_margin_before() @@ -386,7 +412,7 @@ pub fn write_event<'a, W: Write>( .and_data(data) .ok() } - (Stacked(stack, Inline(ListItem(kind, state), attrs)), End(Item)) => { + (Stacked(stack, Inline(ListItem(kind, state), attrs)), End(TagEnd::Item)) => { let InlineAttrs { indent, style, .. } = attrs; let data = if state != ItemBlock { // End the inline text of this item @@ -408,7 +434,7 @@ pub fn write_event<'a, W: Write>( // Literal blocks without highlighting (Stacked(stack, LiteralBlock(attrs)), Text(text)) => { - let LiteralBlockAttrs { indent, style } = attrs; + let LiteralBlockAttrs { indent, style, .. } = attrs; for line in LinesWithEndings::from(&text) { write_styled(writer, &settings.terminal_capabilities, &style, line)?; if line.ends_with('\n') { @@ -417,7 +443,7 @@ pub fn write_event<'a, W: Write>( } stack.current(attrs.into()).and_data(data).ok() } - (Stacked(stack, LiteralBlock(_)), End(CodeBlock(_))) => { + (Stacked(stack, LiteralBlock(_)), End(TagEnd::CodeBlock)) => { write_code_block_border( writer, &settings.theme, @@ -426,6 +452,46 @@ pub fn write_event<'a, W: Write>( )?; stack.pop().and_data(data).ok() } + // HTML and extra text in a literal block, i.e HTML in an HTML block + (Stacked(stack, HtmlBlock(attrs)), Text(text)) => { + let HtmlBlockAttrs { + indent, + initial_indent, + style, + } = attrs; + for (n, line) in LinesWithEndings::from(&text).enumerate() { + let line_indent = if n == 0 { initial_indent } else { indent }; + write_indent(writer, line_indent)?; + write_styled(writer, &settings.terminal_capabilities, &style, line)?; + } + stack + .current( + HtmlBlockAttrs { + initial_indent: attrs.indent, + indent: attrs.indent, + style: attrs.style, + } + .into(), + ) + .and_data(data) + .ok() + } + (Stacked(stack, HtmlBlock(attrs)), Html(html)) => { + write_indent(writer, attrs.initial_indent)?; + // TODO: Split html into lines and properly account for initial indent + write_styled(writer, &settings.terminal_capabilities, &attrs.style, html)?; + stack + .current( + HtmlBlockAttrs { + initial_indent: attrs.indent, + indent: attrs.indent, + style: attrs.style, + } + .into(), + ) + .and_data(data) + .ok() + } // Highlighted code blocks (Stacked(stack, HighlightBlock(mut attrs)), Text(text)) => { @@ -444,7 +510,7 @@ pub fn write_event<'a, W: Write>( } stack.current(attrs.into()).and_data(data).ok() } - (Stacked(stack, HighlightBlock(_)), End(CodeBlock(_))) => { + (Stacked(stack, HighlightBlock(_)), End(TagEnd::CodeBlock)) => { write_code_block_border( writer, &settings.theme, @@ -466,7 +532,6 @@ pub fn write_event<'a, W: Write>( .and_data(data) .ok() } - (Stacked(stack, Inline(_, _)), End(Emphasis)) => stack.pop().and_data(data).ok(), (Stacked(stack, Inline(state, attrs)), Start(Strong)) => { let InlineAttrs { indent, .. } = attrs; let style = attrs.style.bold(); @@ -476,7 +541,6 @@ pub fn write_event<'a, W: Write>( .and_data(data) .ok() } - (Stacked(stack, Inline(_, _)), End(Strong)) => stack.pop().and_data(data).ok(), (Stacked(stack, Inline(state, attrs)), Start(Strikethrough)) => { let InlineAttrs { indent, .. } = attrs; let style = attrs.style.strikethrough(); @@ -486,7 +550,10 @@ pub fn write_event<'a, W: Write>( .and_data(data) .ok() } - (Stacked(stack, Inline(_, _)), End(Strikethrough)) => stack.pop().and_data(data).ok(), + ( + Stacked(stack, Inline(_, _)), + End(TagEnd::Strong | TagEnd::Emphasis | TagEnd::Strikethrough), + ) => stack.pop().and_data(data).ok(), (Stacked(stack, Inline(state, attrs)), Code(code)) => { let current_line = write_styled_and_wrapped( writer, @@ -503,6 +570,23 @@ pub fn write_event<'a, W: Write>( }; Ok(stack.current(Inline(state, attrs)).and_data(data)) } + + (Stacked(stack, Inline(state, attrs)), InlineHtml(html)) => { + let current_line = write_styled_and_wrapped( + writer, + &settings.terminal_capabilities, + &settings.theme.inline_html_style.on_top_of(&attrs.style), + settings.terminal_size.columns, + attrs.indent, + data.current_line, + html, + )?; + let data = StateData { + current_line, + ..data + }; + Ok(stack.current(Inline(state, attrs)).and_data(data)) + } (Stacked(stack, Inline(ListItem(kind, state), attrs)), TaskListMarker(checked)) => { let marker = if checked { "\u{2611}" } else { "\u{2610}" }; write_styled( @@ -578,38 +662,14 @@ pub fn write_event<'a, W: Write>( ..data })) } - // Inline HTML - (Stacked(stack, Inline(ListItem(kind, ItemBlock), attrs)), Html(html)) => { - // Fresh text after a new block, so indent again. - write_indent(writer, attrs.indent)?; - write_styled( - writer, - &settings.terminal_capabilities, - &settings.theme.inline_html_style.on_top_of(&attrs.style), - html, - )?; - stack - .current(Inline(ListItem(kind, ItemText), attrs)) - .and_data(data) - .ok() - } - (Stacked(stack, Inline(state, attrs)), Html(html)) => { - write_styled( - writer, - &settings.terminal_capabilities, - &settings.theme.inline_html_style.on_top_of(&attrs.style), - html, - )?; - stack.current(Inline(state, attrs)).and_data(data).ok() - } // Ending inline text - (Stacked(stack, Inline(_, _)), End(Paragraph)) => { + (Stacked(stack, Inline(_, _)), End(TagEnd::Paragraph)) => { writeln!(writer)?; Ok(stack .pop() .and_data(data.current_line(CurrentLine::empty()))) } - (Stacked(stack, Inline(_, _)), End(Heading(_, _, _))) => { + (Stacked(stack, Inline(_, _)), End(TagEnd::Heading(_))) => { writeln!(writer)?; Ok(stack .pop() @@ -620,7 +680,15 @@ pub fn write_event<'a, W: Write>( // // Links need a bit more work than standard inline markup because we // need to keep track of link references if we can't write inline links. - (Stacked(stack, Inline(state, attrs)), Start(Link(link_type, target, _))) => { + ( + Stacked(stack, Inline(state, attrs)), + Start(Link { + link_type, + dest_url, + title, + .. + }), + ) => { let maybe_link = settings .terminal_capabilities .style @@ -628,14 +696,17 @@ pub fn write_event<'a, W: Write>( .and_then(|_| { if let LinkType::Email = link_type { // Turn email autolinks (i.e. ) into mailto inline links - Url::parse(&format!("mailto:{target}")).ok() + Url::parse(&format!("mailto:{dest_url}")).ok() } else { - environment.resolve_reference(&target) + environment.resolve_reference(&dest_url) } }); let (link_state, data) = match maybe_link { - None => (InlineText, data), + None => ( + InlineText, + data.push_pending_link(link_type, dest_url, title), + ), Some(url) => { let data = match data.current_line.trailing_space.as_ref() { Some(space) => { @@ -667,33 +738,43 @@ pub fn write_event<'a, W: Write>( .and_data(data) .ok() } - (Stacked(stack, Inline(InlineLink, _)), End(Link(_, _, _))) => { - clear_link(writer)?; - stack.pop().and_data(data).ok() - } - // When closing email or autolinks in inline text just return because link, being identical - // to the link text, was already written. - (Stacked(stack, Inline(InlineText, _)), End(Link(LinkType::Autolink, _, _))) => { - stack.pop().and_data(data).ok() - } - (Stacked(stack, Inline(InlineText, _)), End(Link(LinkType::Email, _, _))) => { - stack.pop().and_data(data).ok() - } - (Stacked(stack, Inline(InlineText, attrs)), End(Link(_, target, title))) => { - let (data, index) = data.add_link(target, title, settings.theme.link_style); - write_styled( - writer, - &settings.terminal_capabilities, - &settings.theme.link_style.on_top_of(&attrs.style), - format!("[{index}]"), - )?; - stack.pop().and_data(data).ok() + (Stacked(stack, Inline(InlineText, attrs)), End(TagEnd::Link)) => { + let (data, link) = data.pop_pending_link(); + match link.link_type { + LinkType::Autolink | LinkType::Email => { + // When closing email or autolinks in inline text just return because link, being identical + // to the link text, was already written. + stack.pop().and_data(data).ok() + } + _ => { + let (data, index) = data.add_link_reference( + link.dest_url, + link.title, + settings.theme.link_style, + ); + write_styled( + writer, + &settings.terminal_capabilities, + &settings.theme.link_style.on_top_of(&attrs.style), + format!("[{index}]"), + )?; + stack.pop().and_data(data).ok() + } + } } // Images - (Stacked(stack, Inline(state, attrs)), Start(Image(_, link, _))) => { + ( + Stacked(stack, Inline(state, attrs)), + Start(Image { + dest_url, + title, + link_type, + .. + }), + ) => { let InlineAttrs { style, indent } = attrs; - let resolved_link = environment.resolve_reference(&link); + let resolved_link = environment.resolve_reference(&dest_url); let image_state = match (settings.terminal_capabilities.image, resolved_link) { (Some(capability), Some(ref url)) => capability .image_protocol() @@ -725,18 +806,27 @@ pub fn write_event<'a, W: Write>( } }, (_, None) => None, - } - .unwrap_or_else(|| { - event!(Level::WARN, "Rendering image {} as inline text, without link", link); - // Inside an inline link keep the link style; we cannot nest links so we - // should clarify that clicking the link follows the link target and not the image. - let style = if let InlineLink = state { - style - } else { - settings.theme.image_link_style.on_top_of(&style) - }; - Inline(InlineText, InlineAttrs { style, indent }) - }); + }; + + let (image_state, data) = match image_state { + Some(state) => (state, data), + None => { + event!( + Level::WARN, + "Rendering image {} as inline text, without link", + dest_url + ); + // Inside an inline link keep the link style; we cannot nest links so we + // should clarify that clicking the link follows the link target and not the image. + let style = if let InlineLink = state { + style + } else { + settings.theme.image_link_style.on_top_of(&style) + }; + let state = Inline(InlineText, InlineAttrs { style, indent }); + (state, data.push_pending_link(link_type, dest_url, title)) + } + }; stack .push(Inline(state, attrs)) .current(image_state) @@ -746,12 +836,12 @@ pub fn write_event<'a, W: Write>( // To correctly handle nested images in the image description, we push a dummy rendered // image state so to maintain a correct state stack at the end of image event, where the // tail of the stack gets popped. - (Stacked(stack, RenderedImage), Start(Image(_, _, _))) => stack + (Stacked(stack, RenderedImage), Start(Image { .. })) => stack .push(RenderedImage) .current(RenderedImage) .and_data(data) .ok(), - (Stacked(stack, RenderedImage), End(Image(_, _, _))) => stack.pop().and_data(data).ok(), + (Stacked(stack, RenderedImage), End(TagEnd::Image)) => stack.pop().and_data(data).ok(), // Immediately after the start of image event comes the alt text, which we do not support // for rendered images. So we just ignore all events other than image events, which are // handled above. @@ -759,22 +849,25 @@ pub fn write_event<'a, W: Write>( // See also https://docs.rs/pulldown-cmark/0.9.6/src/pulldown_cmark/html.rs.html#280-290 for // how the upstream handles images. (Stacked(stack, RenderedImage), _) => Stacked(stack, RenderedImage).and_data(data).ok(), - (Stacked(stack, Inline(state, attrs)), End(Image(_, target, title))) => { - if let InlineLink = state { - clear_link(writer)?; - stack.pop().and_data(data).ok() - } else { - let (data, index) = data.add_link(target, title, settings.theme.image_link_style); - write_styled( - writer, - &settings.terminal_capabilities, - // Regardless of text style always colour the reference to make clear it points to - // an image - &settings.theme.image_link_style.on_top_of(&attrs.style), - format!("[{index}]"), - )?; - stack.pop().and_data(data).ok() - } + (Stacked(stack, Inline(InlineText, attrs)), End(TagEnd::Image)) => { + let (data, link) = data.pop_pending_link(); + let (data, index) = + data.add_link_reference(link.dest_url, link.title, settings.theme.image_link_style); + write_styled( + writer, + &settings.terminal_capabilities, + // Regardless of text style always colour the reference to make clear it points to + // an image + &settings.theme.image_link_style.on_top_of(&attrs.style), + format!("[{index}]"), + )?; + stack.pop().and_data(data).ok() + } + + // End any kind of inline link, either a proper link, or an image written out as inline link + (Stacked(stack, Inline(InlineLink, _)), End(TagEnd::Link | TagEnd::Image)) => { + clear_link(writer)?; + stack.pop().and_data(data).ok() } // Tables @@ -783,7 +876,7 @@ pub fn write_event<'a, W: Write>( | (Stacked(stack, TableBlock), Start(TableCell)) => { Stacked(stack, TableBlock).and_data(data).ok() } - (Stacked(stack, TableBlock), End(TableHead)) => { + (Stacked(stack, TableBlock), End(TagEnd::TableHead)) => { let current_table = data.current_table.end_head(); let data = StateData { current_table, @@ -791,7 +884,7 @@ pub fn write_event<'a, W: Write>( }; Stacked(stack, TableBlock).and_data(data).ok() } - (Stacked(stack, TableBlock), End(TableRow)) => { + (Stacked(stack, TableBlock), End(TagEnd::TableRow)) => { let current_table = data.current_table.end_row(); let data = StateData { current_table, @@ -799,7 +892,7 @@ pub fn write_event<'a, W: Write>( }; Stacked(stack, TableBlock).and_data(data).ok() } - (Stacked(stack, TableBlock), End(TableCell)) => { + (Stacked(stack, TableBlock), End(TagEnd::TableCell)) => { let current_table = data.current_table.end_cell(); let data = StateData { current_table, @@ -815,7 +908,7 @@ pub fn write_event<'a, W: Write>( }; Stacked(stack, TableBlock).and_data(data).ok() } - (Stacked(stack, TableBlock), End(Table(_))) => { + (Stacked(stack, TableBlock), End(TagEnd::Table)) => { write_table( writer, &settings.terminal_capabilities, @@ -834,19 +927,20 @@ pub fn write_event<'a, W: Write>( (Stacked(stack, TableBlock), Start(Emphasis)) | (Stacked(stack, TableBlock), Start(Strong)) | (Stacked(stack, TableBlock), Start(Strikethrough)) - | (Stacked(stack, TableBlock), Start(Link(_, _, _))) - | (Stacked(stack, TableBlock), Start(Image(_, _, _))) - | (Stacked(stack, TableBlock), End(Emphasis)) - | (Stacked(stack, TableBlock), End(Strong)) - | (Stacked(stack, TableBlock), End(Strikethrough)) - | (Stacked(stack, TableBlock), End(Link(_, _, _))) - | (Stacked(stack, TableBlock), End(Image(_, _, _))) => { + | (Stacked(stack, TableBlock), Start(Link { .. })) + | (Stacked(stack, TableBlock), Start(Image { .. })) + | (Stacked(stack, TableBlock), End(TagEnd::Emphasis)) + | (Stacked(stack, TableBlock), End(TagEnd::Strong)) + | (Stacked(stack, TableBlock), End(TagEnd::Strikethrough)) + | (Stacked(stack, TableBlock), End(TagEnd::Link)) + | (Stacked(stack, TableBlock), End(TagEnd::Image)) => { Stacked(stack, TableBlock).and_data(data).ok() } // Unconditional returns to previous states - (Stacked(stack, _), End(BlockQuote)) => stack.pop().and_data(data).ok(), - (Stacked(stack, _), End(List(_))) => stack.pop().and_data(data).ok(), + (Stacked(stack, _), End(TagEnd::BlockQuote(_) | TagEnd::List(_) | TagEnd::HtmlBlock)) => { + stack.pop().and_data(data).ok() + } // Impossible events (s, e) => panic!("Event {e:?} impossible in state {s:?}"), diff --git a/pulldown-cmark-mdcat/src/render/data.rs b/pulldown-cmark-mdcat/src/render/data.rs index 055f97ab..050a9b41 100644 --- a/pulldown-cmark-mdcat/src/render/data.rs +++ b/pulldown-cmark-mdcat/src/render/data.rs @@ -5,7 +5,18 @@ // file, You can obtain one at http://mozilla.org/MPL/2.0/. use anstyle::Style; -use pulldown_cmark::{Alignment, CowStr}; +use pulldown_cmark::{Alignment, CowStr, LinkType}; + +/// A pending link. +#[derive(Debug, PartialEq)] +pub struct PendingLink<'a> { + /// The type of this link. + pub(crate) link_type: LinkType, + /// The destination URL of this link. + pub(crate) dest_url: CowStr<'a>, + /// The link title as it appeared in Markdown. + pub(crate) title: CowStr<'a>, +} /// The definition of a reference link, i.e. a numeric index for a link. #[derive(Debug, PartialEq)] @@ -133,6 +144,10 @@ impl<'a> CurrentTable<'a> { /// concerns which are manipulated across all states. #[derive(Debug)] pub struct StateData<'a> { + /// A list of pending links. + /// + /// These are links which we still need to create a reference number for. + pub(super) pending_links: Vec>, /// A list of pending reference link definitions. /// /// These are links which mdcat already created a reference number for @@ -154,12 +169,35 @@ impl<'a> StateData<'a> { } } + /// Push a pending link. + pub(crate) fn push_pending_link( + mut self, + link_type: LinkType, + dest_url: CowStr<'a>, + title: CowStr<'a>, + ) -> Self { + self.pending_links.push(PendingLink { + link_type, + dest_url, + title, + }); + self + } + + /// Pop a pending link. + /// + /// Panics if there is no pending link. + pub(crate) fn pop_pending_link(mut self) -> (Self, PendingLink<'a>) { + let link = self.pending_links.pop().unwrap(); + (self, link) + } + /// Add a pending link to the state data. /// /// `target` is the link target, and `title` the link title to show after the URL. /// `colour` is the colour to use for foreground text to differentiate between /// different types of links. - pub(crate) fn add_link( + pub(crate) fn add_link_reference( mut self, target: CowStr<'a>, title: CowStr<'a>, @@ -176,7 +214,7 @@ impl<'a> StateData<'a> { (self, index) } - pub(crate) fn take_links(self) -> (Self, Vec>) { + pub(crate) fn take_link_references(self) -> (Self, Vec>) { let links = self.pending_link_definitions; ( StateData { @@ -191,6 +229,7 @@ impl<'a> StateData<'a> { impl<'a> Default for StateData<'a> { fn default() -> Self { StateData { + pending_links: Vec::new(), pending_link_definitions: Vec::new(), next_link: 1, current_line: CurrentLine::empty(), diff --git a/pulldown-cmark-mdcat/src/render/state.rs b/pulldown-cmark-mdcat/src/render/state.rs index 7a53c11d..2997e98d 100644 --- a/pulldown-cmark-mdcat/src/render/state.rs +++ b/pulldown-cmark-mdcat/src/render/state.rs @@ -16,8 +16,6 @@ pub(super) enum MarginControl { Margin, /// Always add no margin. NoMargin, - /// Add margin unless the current event is a HTML event. - NoMarginForHtmlOnly, } /// State attributes for inline text. @@ -122,13 +120,6 @@ impl StyledBlockAttrs { } } - pub(super) fn without_margin_for_html_only(self) -> Self { - StyledBlockAttrs { - margin_before: MarginControl::NoMarginForHtmlOnly, - ..self - } - } - pub(super) fn block_quote(self) -> Self { StyledBlockAttrs { indent: self.indent + 4, @@ -181,6 +172,16 @@ pub struct LiteralBlockAttrs { pub(super) style: Style, } +#[derive(Debug, PartialEq)] +pub struct HtmlBlockAttrs { + /// The initial indent for this block. + pub(super) initial_indent: u16, + /// Indent for the remainder of this block. + pub(super) indent: u16, + /// The base style for this block. + pub(super) style: Style, +} + #[derive(Debug, PartialEq)] pub enum StackedState { /// Styled block. @@ -191,6 +192,8 @@ pub enum StackedState { HighlightBlock(HighlightBlockAttrs), /// A literal block without highlighting. LiteralBlock(LiteralBlockAttrs), + /// A block of HTML contents. + HtmlBlock(HtmlBlockAttrs), /// A rendered inline image. /// /// We move to this state when we can render an image directly to the terminal, in order to @@ -220,6 +223,12 @@ impl From for StackedState { } } +impl From for StackedState { + fn from(attrs: HtmlBlockAttrs) -> Self { + StackedState::HtmlBlock(attrs) + } +} + /// State attributes for top level. #[derive(Debug, Clone, PartialEq, Eq)] pub struct TopLevelAttrs { @@ -232,12 +241,6 @@ impl TopLevelAttrs { margin_before: MarginControl::Margin, } } - - pub(super) fn no_margin_for_html_only() -> Self { - TopLevelAttrs { - margin_before: MarginControl::NoMarginForHtmlOnly, - } - } } impl Default for TopLevelAttrs { diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-079-atx_headings.snap b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-079-atx_headings.snap index b776851d..b10b17e7 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-079-atx_headings.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-079-atx_headings.snap @@ -8,4 +8,4 @@ input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/079-atx_headings ┄ -┄┄┄ +┄┄┄ diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-082-setext_headings.snap b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-082-setext_headings.snap index 96736aac..562cc73c 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-082-setext_headings.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-082-setext_headings.snap @@ -4,4 +4,4 @@ assertion_line: 123 expression: "render_to_string(markdown_file, &ansi_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/082-setext_headings.md --- -┄Foo barbaz +┄Foo barbaz diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-148-html_blocks.snap b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-148-html_blocks.snap index 18e87772..4032a295 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-148-html_blocks.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-148-html_blocks.snap @@ -8,7 +8,7 @@ input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/148-html_blocks. 
 **Hello**,
 
-world.
 +world.    diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-150-html_blocks.snap b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-150-html_blocks.snap index 4e4ebfe0..b851767b 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-150-html_blocks.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-150-html_blocks.snap @@ -4,7 +4,7 @@ assertion_line: 123 expression: "render_to_string(markdown_file, &ansi_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/150-html_blocks.md --- -
+ 
 *hello*   diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-183-html_blocks.snap b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-183-html_blocks.snap index b921522b..d71c7b16 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-183-html_blocks.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-183-html_blocks.snap @@ -4,7 +4,7 @@ assertion_line: 123 expression: "render_to_string(markdown_file, &ansi_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/183-html_blocks.md --- - +   ────────────────────  diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-184-html_blocks.snap b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-184-html_blocks.snap index 9dd71da8..20e2c5c2 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-184-html_blocks.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-184-html_blocks.snap @@ -4,7 +4,7 @@ assertion_line: 123 expression: "render_to_string(markdown_file, &ansi_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/184-html_blocks.md --- -
+ 
 ──────────────────── 
diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-187-html_blocks.snap b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-187-html_blocks.snap index 7cfeb5c5..60a991c0 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-187-html_blocks.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-187-html_blocks.snap @@ -4,4 +4,4 @@ assertion_line: 123 expression: "render_to_string(markdown_file, &ansi_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/187-html_blocks.md --- -Foo baz +Foo  baz diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-190-html_blocks.snap b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-190-html_blocks.snap index 8fd657c0..796a0c8d 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-190-html_blocks.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-190-html_blocks.snap @@ -5,10 +5,14 @@ expression: "render_to_string(markdown_file, &ansi_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/190-html_blocks.md ---  - - + + - -
+ +
Hi 
+ + + +  diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-191-html_blocks.snap b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-191-html_blocks.snap index e2ae1ef2..ec9c74e7 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-191-html_blocks.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-191-html_blocks.snap @@ -5,7 +5,8 @@ expression: "render_to_string(markdown_file, &ansi_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/191-html_blocks.md ---  - + +   ────────────────────  ──────────────────── - -
@@ -13,6 +14,7 @@ input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/191-html_blocks. 
+  + +  diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-201-link_reference_definitions.snap b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-201-link_reference_definitions.snap index 849fa21b..b34ac9e3 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-201-link_reference_definitions.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-201-link_reference_definitions.snap @@ -4,6 +4,6 @@ assertion_line: 123 expression: "render_to_string(markdown_file, &ansi_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/201-link_reference_definitions.md --- -[foo]: (baz) +[foo]: (baz) [foo] diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-523-links.snap b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-523-links.snap index 01d11df7..7fa822f1 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-523-links.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-523-links.snap @@ -4,4 +4,4 @@ assertion_line: 123 expression: "render_to_string(markdown_file, &ansi_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/523-links.md --- -[foo +[foo  diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-535-links.snap b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-535-links.snap index 5117ed50..5ac1312f 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-535-links.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-535-links.snap @@ -4,4 +4,4 @@ assertion_line: 123 expression: "render_to_string(markdown_file, &ansi_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/535-links.md --- -[foo +[foo  diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-616-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-616-raw_html.snap index 3074994d..131f2263 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-616-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-616-raw_html.snap @@ -4,4 +4,4 @@ assertion_line: 123 expression: "render_to_string(markdown_file, &ansi_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/616-raw_html.md --- -Foo +Foo  diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-624-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-624-raw_html.snap index 64af9bbc..50942b41 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-624-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-624-raw_html.snap @@ -4,5 +4,5 @@ assertion_line: 123 expression: "render_to_string(markdown_file, &ansi_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/624-raw_html.md --- -foo diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-625-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-625-raw_html.snap index cbe9e422..d5231927 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-625-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-625-raw_html.snap @@ -4,4 +4,4 @@ assertion_line: 123 expression: "render_to_string(markdown_file, &ansi_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/625-raw_html.md --- -foo +foo  diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-626-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-626-raw_html.snap index 1f6fff99..016a4e0b 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-626-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-626-raw_html.snap @@ -4,6 +4,6 @@ assertion_line: 123 expression: "render_to_string(markdown_file, &ansi_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/626-raw_html.md --- -foo foo --> +foo  foo --> -foo +foo  diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-627-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-627-raw_html.snap index 50422fc1..2dfb81af 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-627-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-627-raw_html.snap @@ -4,4 +4,4 @@ assertion_line: 123 expression: "render_to_string(markdown_file, &ansi_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/627-raw_html.md --- -foo +foo  diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-628-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-628-raw_html.snap index df235346..83cffcfb 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-628-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-628-raw_html.snap @@ -4,4 +4,4 @@ assertion_line: 123 expression: "render_to_string(markdown_file, &ansi_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/628-raw_html.md --- -foo +foo  diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-629-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-629-raw_html.snap index 61626aaf..1cc1491b 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-629-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-629-raw_html.snap @@ -4,4 +4,4 @@ assertion_line: 123 expression: "render_to_string(markdown_file, &ansi_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/629-raw_html.md --- -foo&<]]> +foo &<]]> diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-630-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-630-raw_html.snap index 61c50858..5db6fbac 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-630-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-630-raw_html.snap @@ -4,4 +4,4 @@ assertion_line: 123 expression: "render_to_string(markdown_file, &ansi_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/630-raw_html.md --- -foo
 +foo  diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-631-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-631-raw_html.snap index 3cfb6a45..d7822195 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-631-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/ansi@commonmark-spec-631-raw_html.snap @@ -4,4 +4,4 @@ assertion_line: 123 expression: "render_to_string(markdown_file, &ansi_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/631-raw_html.md --- -foo +foo  diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-148-html_blocks.snap b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-148-html_blocks.snap index fa0d5308..2f3f0f6b 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-148-html_blocks.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-148-html_blocks.snap @@ -8,6 +8,6 @@ input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/148-html_blocks.
 **Hello**,
 
-world.
+world. diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-150-html_blocks.snap b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-150-html_blocks.snap index b741f63b..fb667cd5 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-150-html_blocks.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-150-html_blocks.snap @@ -4,6 +4,6 @@ assertion_line: 122 expression: "render_to_string(markdown_file, &dumb_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/150-html_blocks.md --- -
+
*hello* diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-183-html_blocks.snap b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-183-html_blocks.snap index 78a07b35..2efaaee7 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-183-html_blocks.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-183-html_blocks.snap @@ -4,7 +4,7 @@ assertion_line: 122 expression: "render_to_string(markdown_file, &dumb_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/183-html_blocks.md --- - + ──────────────────── diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-184-html_blocks.snap b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-184-html_blocks.snap index 5fffd95b..5ba893d7 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-184-html_blocks.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-184-html_blocks.snap @@ -4,7 +4,7 @@ assertion_line: 122 expression: "render_to_string(markdown_file, &dumb_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/184-html_blocks.md --- -
+
────────────────────
diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-187-html_blocks.snap b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-187-html_blocks.snap index e7ed288f..c4cab95f 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-187-html_blocks.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-187-html_blocks.snap @@ -4,4 +4,4 @@ assertion_line: 122 expression: "render_to_string(markdown_file, &dumb_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/187-html_blocks.md --- -Foo baz +Foo baz diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-190-html_blocks.snap b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-190-html_blocks.snap index 74bfbd69..a172007b 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-190-html_blocks.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-190-html_blocks.snap @@ -5,9 +5,13 @@ expression: "render_to_string(markdown_file, &dumb_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/190-html_blocks.md --- + + + +
Hi
diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-191-html_blocks.snap b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-191-html_blocks.snap index ba66d98d..a2f1bbe7 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-191-html_blocks.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-191-html_blocks.snap @@ -5,7 +5,8 @@ expression: "render_to_string(markdown_file, &dumb_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/191-html_blocks.md --- - + + ──────────────────── ──────────────────── - + +
@@ -13,5 +14,6 @@ input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/191-html_blocks.
diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-201-link_reference_definitions.snap b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-201-link_reference_definitions.snap index 4c134b8a..97d90ffc 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-201-link_reference_definitions.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-201-link_reference_definitions.snap @@ -4,6 +4,6 @@ assertion_line: 122 expression: "render_to_string(markdown_file, &dumb_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/201-link_reference_definitions.md --- -[foo]: (baz) +[foo]: (baz) [foo] diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-523-links.snap b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-523-links.snap index 239f693b..43eb6d54 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-523-links.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-523-links.snap @@ -4,4 +4,4 @@ assertion_line: 122 expression: "render_to_string(markdown_file, &dumb_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/523-links.md --- -[foo +[foo diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-535-links.snap b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-535-links.snap index e0a08a08..85dae554 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-535-links.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-535-links.snap @@ -4,4 +4,4 @@ assertion_line: 122 expression: "render_to_string(markdown_file, &dumb_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/535-links.md --- -[foo +[foo diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-616-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-616-raw_html.snap index 3092d658..cc100e26 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-616-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-616-raw_html.snap @@ -4,4 +4,4 @@ assertion_line: 122 expression: "render_to_string(markdown_file, &dumb_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/616-raw_html.md --- -Foo +Foo diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-624-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-624-raw_html.snap index d40d5541..f59d7e99 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-624-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-624-raw_html.snap @@ -4,5 +4,5 @@ assertion_line: 122 expression: "render_to_string(markdown_file, &dumb_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/624-raw_html.md --- -foo diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-627-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-627-raw_html.snap index 7e9c9ec6..3ef9896b 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-627-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-627-raw_html.snap @@ -4,4 +4,4 @@ assertion_line: 122 expression: "render_to_string(markdown_file, &dumb_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/627-raw_html.md --- -foo +foo diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-628-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-628-raw_html.snap index 94ecd4a7..b1ded9b1 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-628-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-628-raw_html.snap @@ -4,4 +4,4 @@ assertion_line: 122 expression: "render_to_string(markdown_file, &dumb_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/628-raw_html.md --- -foo +foo diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-629-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-629-raw_html.snap index a365b70b..915e15bd 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-629-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-629-raw_html.snap @@ -4,4 +4,4 @@ assertion_line: 122 expression: "render_to_string(markdown_file, &dumb_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/629-raw_html.md --- -foo&<]]> +foo &<]]> diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-630-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-630-raw_html.snap index c3d50a40..ca7632f4 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-630-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-630-raw_html.snap @@ -4,4 +4,4 @@ assertion_line: 122 expression: "render_to_string(markdown_file, &dumb_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/630-raw_html.md --- -foo
+foo diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-631-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-631-raw_html.snap index 58cf3618..e5d1ec02 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-631-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/dumb@commonmark-spec-631-raw_html.snap @@ -4,4 +4,4 @@ assertion_line: 122 expression: "render_to_string(markdown_file, &dumb_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/631-raw_html.md --- -foo +foo diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-079-atx_headings.snap b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-079-atx_headings.snap index ace13e36..7cbaa959 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-079-atx_headings.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-079-atx_headings.snap @@ -8,4 +8,4 @@ input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/079-atx_headings ]1337;SetMark\┄ -]1337;SetMark\┄┄┄ +]1337;SetMark\┄┄┄ diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-082-setext_headings.snap b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-082-setext_headings.snap index f89afa76..a51024ff 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-082-setext_headings.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-082-setext_headings.snap @@ -4,4 +4,4 @@ assertion_line: 124 expression: "render_to_string(markdown_file, &iterm2_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/082-setext_headings.md --- -]1337;SetMark\┄Foo barbaz +]1337;SetMark\┄Foo barbaz diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-148-html_blocks.snap b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-148-html_blocks.snap index c86672b6..815e88df 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-148-html_blocks.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-148-html_blocks.snap @@ -8,7 +8,7 @@ input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/148-html_blocks. 
 **Hello**,
 
-world.
 +world.    diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-150-html_blocks.snap b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-150-html_blocks.snap index 4e9bee41..fcf92200 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-150-html_blocks.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-150-html_blocks.snap @@ -4,7 +4,7 @@ assertion_line: 124 expression: "render_to_string(markdown_file, &iterm2_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/150-html_blocks.md --- -
+ 
 *hello*   diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-183-html_blocks.snap b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-183-html_blocks.snap index 69727f95..2ea98848 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-183-html_blocks.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-183-html_blocks.snap @@ -4,7 +4,7 @@ assertion_line: 124 expression: "render_to_string(markdown_file, &iterm2_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/183-html_blocks.md --- - +   ────────────────────  diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-184-html_blocks.snap b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-184-html_blocks.snap index 2a972077..8ef7fc8f 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-184-html_blocks.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-184-html_blocks.snap @@ -4,7 +4,7 @@ assertion_line: 124 expression: "render_to_string(markdown_file, &iterm2_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/184-html_blocks.md --- -
+ 
 ──────────────────── 
diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-187-html_blocks.snap b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-187-html_blocks.snap index 420eaf74..a8601dd4 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-187-html_blocks.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-187-html_blocks.snap @@ -4,4 +4,4 @@ assertion_line: 124 expression: "render_to_string(markdown_file, &iterm2_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/187-html_blocks.md --- -Foo baz +Foo  baz diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-190-html_blocks.snap b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-190-html_blocks.snap index bb819d30..93c932d3 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-190-html_blocks.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-190-html_blocks.snap @@ -5,10 +5,14 @@ expression: "render_to_string(markdown_file, &iterm2_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/190-html_blocks.md ---  - - + + - -
+ +
Hi 
+ + + +  diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-191-html_blocks.snap b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-191-html_blocks.snap index 99f5a04a..3cf08d21 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-191-html_blocks.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-191-html_blocks.snap @@ -5,7 +5,8 @@ expression: "render_to_string(markdown_file, &iterm2_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/191-html_blocks.md ---  - + +   ────────────────────  ──────────────────── - -
@@ -13,6 +14,7 @@ input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/191-html_blocks. 
+  + +  diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-201-link_reference_definitions.snap b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-201-link_reference_definitions.snap index 41e78206..2388cbf0 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-201-link_reference_definitions.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-201-link_reference_definitions.snap @@ -4,6 +4,6 @@ assertion_line: 124 expression: "render_to_string(markdown_file, &iterm2_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/201-link_reference_definitions.md --- -[foo]: (baz) +[foo]: (baz) [foo] diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-523-links.snap b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-523-links.snap index 811e9e8f..568b055d 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-523-links.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-523-links.snap @@ -4,4 +4,4 @@ assertion_line: 124 expression: "render_to_string(markdown_file, &iterm2_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/523-links.md --- -[foo +[foo  diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-535-links.snap b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-535-links.snap index 5cec5233..566107ad 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-535-links.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-535-links.snap @@ -4,4 +4,4 @@ assertion_line: 124 expression: "render_to_string(markdown_file, &iterm2_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/535-links.md --- -[foo +[foo  diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-616-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-616-raw_html.snap index d0aab1e7..aa12d187 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-616-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-616-raw_html.snap @@ -4,4 +4,4 @@ assertion_line: 124 expression: "render_to_string(markdown_file, &iterm2_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/616-raw_html.md --- -Foo +Foo  diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-624-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-624-raw_html.snap index 4c09fc2d..5fd262d3 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-624-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-624-raw_html.snap @@ -4,5 +4,5 @@ assertion_line: 124 expression: "render_to_string(markdown_file, &iterm2_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/624-raw_html.md --- -foo diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-625-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-625-raw_html.snap index e4362201..e2494863 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-625-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-625-raw_html.snap @@ -4,4 +4,4 @@ assertion_line: 124 expression: "render_to_string(markdown_file, &iterm2_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/625-raw_html.md --- -foo +foo  diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-626-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-626-raw_html.snap index 2c091ecb..5b50e9bb 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-626-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-626-raw_html.snap @@ -4,6 +4,6 @@ assertion_line: 124 expression: "render_to_string(markdown_file, &iterm2_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/626-raw_html.md --- -foo foo --> +foo  foo --> -foo +foo  diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-627-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-627-raw_html.snap index 0e8d525a..01fc56a6 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-627-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-627-raw_html.snap @@ -4,4 +4,4 @@ assertion_line: 124 expression: "render_to_string(markdown_file, &iterm2_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/627-raw_html.md --- -foo +foo  diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-628-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-628-raw_html.snap index 72f01648..5476ef67 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-628-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-628-raw_html.snap @@ -4,4 +4,4 @@ assertion_line: 124 expression: "render_to_string(markdown_file, &iterm2_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/628-raw_html.md --- -foo +foo  diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-629-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-629-raw_html.snap index 8b60822e..865c9bde 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-629-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-629-raw_html.snap @@ -4,4 +4,4 @@ assertion_line: 124 expression: "render_to_string(markdown_file, &iterm2_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/629-raw_html.md --- -foo&<]]> +foo &<]]> diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-630-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-630-raw_html.snap index f37fc6f5..2313f6b2 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-630-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-630-raw_html.snap @@ -4,4 +4,4 @@ assertion_line: 124 expression: "render_to_string(markdown_file, &iterm2_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/630-raw_html.md --- -foo
 +foo  diff --git a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-631-raw_html.snap b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-631-raw_html.snap index 92961bff..95280e70 100644 --- a/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-631-raw_html.snap +++ b/pulldown-cmark-mdcat/tests/snapshots/render/iterm2@commonmark-spec-631-raw_html.snap @@ -4,4 +4,4 @@ assertion_line: 124 expression: "render_to_string(markdown_file, &iterm2_settings)" input_file: pulldown-cmark-mdcat/tests/markdown/commonmark-spec/631-raw_html.md --- -foo +foo