From 721c260fb3db26aa977a52a647a37ea88255fa64 Mon Sep 17 00:00:00 2001 From: Sebastian Wiesner Date: Thu, 26 Sep 2024 17:36:38 +0200 Subject: [PATCH 1/5] Update pulldown-cmark dependency --- CHANGELOG.md | 6 ++++++ Cargo.lock | 11 +++++++++-- Cargo.toml | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 666a2229..da5b2e91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ Use `cargo release` to create a new release. ## [Unreleased] +### Changed +- Update to pulldown-cmark 0.12 (see [GH-276]). + This brings several fixes and improvements. + +[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 } From 34f897edb4cd5ec14a8f360965af7f22968e51cb Mon Sep 17 00:00:00 2001 From: Sebastian Wiesner Date: Thu, 26 Sep 2024 17:44:49 +0200 Subject: [PATCH 2/5] Fix straightforward compiler errors Turn tuple variants into struct variants, and add TagEnd where required. --- pulldown-cmark-mdcat/src/render.rs | 81 +++++++++++++++++------------- 1 file changed, 45 insertions(+), 36 deletions(-) diff --git a/pulldown-cmark-mdcat/src/render.rs b/pulldown-cmark-mdcat/src/render.rs index 8cb77477..57ac622a 100644 --- a/pulldown-cmark-mdcat/src/render.rs +++ b/pulldown-cmark-mdcat/src/render.rs @@ -12,6 +12,7 @@ use std::io::Result; use anstyle::{Effects, Style}; use pulldown_cmark::Event::*; use pulldown_cmark::Tag::*; +use pulldown_cmark::TagEnd; use pulldown_cmark::{Event, LinkType}; use syntect::highlighting::HighlightIterator; use syntect::util::LinesWithEndings; @@ -69,7 +70,7 @@ pub fn write_event<'a, W: Write>( .and_data(data) .ok() } - (TopLevel(attrs), Start(Heading(level, _, _))) => { + (TopLevel(attrs), Start(Heading { level, .. })) => { let (data, links) = data.take_links(); write_link_refs(writer, environment, &settings.terminal_capabilities, links)?; if attrs.margin_before != NoMargin { @@ -87,7 +88,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)?; } @@ -190,7 +191,7 @@ pub fn write_event<'a, W: Write>( .and_data(data) .ok() } - (Stacked(stack, StyledBlock(attrs)), Start(BlockQuote)) => { + (Stacked(stack, StyledBlock(attrs)), Start(BlockQuote(_))) => { if attrs.margin_before != NoMargin { writeln!(writer)?; } @@ -217,7 +218,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)?; } @@ -346,7 +347,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 +376,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 +387,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 @@ -417,7 +418,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, @@ -444,7 +445,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 +467,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 +476,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 +485,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, @@ -603,13 +605,13 @@ pub fn write_event<'a, W: Write>( 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 +622,14 @@ 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, + .. + }), + ) => { let maybe_link = settings .terminal_capabilities .style @@ -628,9 +637,9 @@ 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) } }); @@ -667,7 +676,7 @@ pub fn write_event<'a, W: Write>( .and_data(data) .ok() } - (Stacked(stack, Inline(InlineLink, _)), End(Link(_, _, _))) => { + (Stacked(stack, Inline(InlineLink, _)), End(TagEnd::Link)) => { clear_link(writer)?; stack.pop().and_data(data).ok() } @@ -691,9 +700,9 @@ pub fn write_event<'a, W: Write>( } // Images - (Stacked(stack, Inline(state, attrs)), Start(Image(_, link, _))) => { + (Stacked(stack, Inline(state, attrs)), Start(Image { dest_url, .. })) => { 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() @@ -727,7 +736,7 @@ pub fn write_event<'a, W: Write>( (_, None) => None, } .unwrap_or_else(|| { - event!(Level::WARN, "Rendering image {} as inline text, without link", link); + 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 { @@ -746,12 +755,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. @@ -783,7 +792,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 +800,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 +808,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 +824,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 +843,19 @@ 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(_))) => stack.pop().and_data(data).ok(), + (Stacked(stack, _), End(TagEnd::List(_))) => stack.pop().and_data(data).ok(), // Impossible events (s, e) => panic!("Event {e:?} impossible in state {s:?}"), From 6abc439c4b9fe44d24f554ba70d3d0dc57f5581d Mon Sep 17 00:00:00 2001 From: Sebastian Wiesner Date: Thu, 26 Sep 2024 18:08:57 +0200 Subject: [PATCH 3/5] Handle reference links again Add a new data field to track pending links. Whenever we do not write an inline image or inline link we push the pending link to store the destination URL and title; in the corresponding end event we pop the pending link and add it as a new link reference definition. --- pulldown-cmark-mdcat/src/render.rs | 130 ++++++++++++++---------- pulldown-cmark-mdcat/src/render/data.rs | 45 +++++++- 2 files changed, 120 insertions(+), 55 deletions(-) diff --git a/pulldown-cmark-mdcat/src/render.rs b/pulldown-cmark-mdcat/src/render.rs index 57ac622a..a3f3f7af 100644 --- a/pulldown-cmark-mdcat/src/render.rs +++ b/pulldown-cmark-mdcat/src/render.rs @@ -71,7 +71,7 @@ pub fn write_event<'a, W: Write>( .ok() } (TopLevel(attrs), Start(Heading { level, .. })) => { - let (data, links) = data.take_links(); + let (data, links) = data.take_link_references(); write_link_refs(writer, environment, &settings.terminal_capabilities, links)?; if attrs.margin_before != NoMargin { writeln!(writer)?; @@ -627,6 +627,7 @@ pub fn write_event<'a, W: Write>( Start(Link { link_type, dest_url, + title, .. }), ) => { @@ -644,7 +645,10 @@ pub fn write_event<'a, W: Write>( }); 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) => { @@ -676,31 +680,41 @@ pub fn write_event<'a, W: Write>( .and_data(data) .ok() } - (Stacked(stack, Inline(InlineLink, _)), End(TagEnd::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 { dest_url, .. })) => { + ( + Stacked(stack, Inline(state, attrs)), + Start(Image { + dest_url, + title, + link_type, + .. + }), + ) => { let InlineAttrs { style, indent } = attrs; let resolved_link = environment.resolve_reference(&dest_url); let image_state = match (settings.terminal_capabilities.image, resolved_link) { @@ -734,18 +748,27 @@ pub fn write_event<'a, W: Write>( } }, (_, None) => None, - } - .unwrap_or_else(|| { - 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) - }; - 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) @@ -768,22 +791,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 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(), From b3c4965933788ae8a89e7b2fe344be0707f5d79c Mon Sep 17 00:00:00 2001 From: Sebastian Wiesner Date: Thu, 26 Sep 2024 20:10:39 +0200 Subject: [PATCH 4/5] Accept changes to heading rendering pulldown-cmark no longer generates empty Text events for some kind of empty headings, which changes how the code sequence looks like for headings, without any visual change. --- .../snapshots/render/ansi@commonmark-spec-079-atx_headings.snap | 2 +- .../render/ansi@commonmark-spec-082-setext_headings.snap | 2 +- .../render/iterm2@commonmark-spec-079-atx_headings.snap | 2 +- .../render/iterm2@commonmark-spec-082-setext_headings.snap | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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/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 From 2e38547addfc54d7a4c5436a6fe934dc58f63470 Mon Sep 17 00:00:00 2001 From: Sebastian Wiesner Date: Thu, 26 Sep 2024 21:46:31 +0200 Subject: [PATCH 5/5] Handle new split HTML blocks and inline HTML This clarifies the HTML handling code a bit, and improves whitespace output for HTML blocks and some inline HTML. --- CHANGELOG.md | 4 +- pulldown-cmark-mdcat/src/render.rs | 175 ++++++++++++------ pulldown-cmark-mdcat/src/render/state.rs | 33 ++-- .../ansi@commonmark-spec-148-html_blocks.snap | 2 +- .../ansi@commonmark-spec-150-html_blocks.snap | 2 +- .../ansi@commonmark-spec-183-html_blocks.snap | 2 +- .../ansi@commonmark-spec-184-html_blocks.snap | 2 +- .../ansi@commonmark-spec-187-html_blocks.snap | 2 +- .../ansi@commonmark-spec-190-html_blocks.snap | 12 +- .../ansi@commonmark-spec-191-html_blocks.snap | 8 +- ...k-spec-201-link_reference_definitions.snap | 2 +- .../ansi@commonmark-spec-523-links.snap | 2 +- .../ansi@commonmark-spec-535-links.snap | 2 +- .../ansi@commonmark-spec-616-raw_html.snap | 2 +- .../ansi@commonmark-spec-624-raw_html.snap | 2 +- .../ansi@commonmark-spec-625-raw_html.snap | 2 +- .../ansi@commonmark-spec-626-raw_html.snap | 4 +- .../ansi@commonmark-spec-627-raw_html.snap | 2 +- .../ansi@commonmark-spec-628-raw_html.snap | 2 +- .../ansi@commonmark-spec-629-raw_html.snap | 2 +- .../ansi@commonmark-spec-630-raw_html.snap | 2 +- .../ansi@commonmark-spec-631-raw_html.snap | 2 +- .../dumb@commonmark-spec-148-html_blocks.snap | 2 +- .../dumb@commonmark-spec-150-html_blocks.snap | 2 +- .../dumb@commonmark-spec-183-html_blocks.snap | 2 +- .../dumb@commonmark-spec-184-html_blocks.snap | 2 +- .../dumb@commonmark-spec-187-html_blocks.snap | 2 +- .../dumb@commonmark-spec-190-html_blocks.snap | 4 + .../dumb@commonmark-spec-191-html_blocks.snap | 6 +- ...k-spec-201-link_reference_definitions.snap | 2 +- .../dumb@commonmark-spec-523-links.snap | 2 +- .../dumb@commonmark-spec-535-links.snap | 2 +- .../dumb@commonmark-spec-616-raw_html.snap | 2 +- .../dumb@commonmark-spec-624-raw_html.snap | 2 +- .../dumb@commonmark-spec-627-raw_html.snap | 2 +- .../dumb@commonmark-spec-628-raw_html.snap | 2 +- .../dumb@commonmark-spec-629-raw_html.snap | 2 +- .../dumb@commonmark-spec-630-raw_html.snap | 2 +- .../dumb@commonmark-spec-631-raw_html.snap | 2 +- ...term2@commonmark-spec-148-html_blocks.snap | 2 +- ...term2@commonmark-spec-150-html_blocks.snap | 2 +- ...term2@commonmark-spec-183-html_blocks.snap | 2 +- ...term2@commonmark-spec-184-html_blocks.snap | 2 +- ...term2@commonmark-spec-187-html_blocks.snap | 2 +- ...term2@commonmark-spec-190-html_blocks.snap | 12 +- ...term2@commonmark-spec-191-html_blocks.snap | 8 +- ...k-spec-201-link_reference_definitions.snap | 2 +- .../iterm2@commonmark-spec-523-links.snap | 2 +- .../iterm2@commonmark-spec-535-links.snap | 2 +- .../iterm2@commonmark-spec-616-raw_html.snap | 2 +- .../iterm2@commonmark-spec-624-raw_html.snap | 2 +- .../iterm2@commonmark-spec-625-raw_html.snap | 2 +- .../iterm2@commonmark-spec-626-raw_html.snap | 4 +- .../iterm2@commonmark-spec-627-raw_html.snap | 2 +- .../iterm2@commonmark-spec-628-raw_html.snap | 2 +- .../iterm2@commonmark-spec-629-raw_html.snap | 2 +- .../iterm2@commonmark-spec-630-raw_html.snap | 2 +- .../iterm2@commonmark-spec-631-raw_html.snap | 2 +- 58 files changed, 223 insertions(+), 141 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da5b2e91..07cce5d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,9 @@ Use `cargo release` to create a new release. ### Changed - Update to pulldown-cmark 0.12 (see [GH-276]). - This brings several fixes and improvements. + 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 diff --git a/pulldown-cmark-mdcat/src/render.rs b/pulldown-cmark-mdcat/src/render.rs index a3f3f7af..4b0b2453 100644 --- a/pulldown-cmark-mdcat/src/render.rs +++ b/pulldown-cmark-mdcat/src/render.rs @@ -11,6 +11,7 @@ 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}; @@ -35,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; @@ -70,6 +71,23 @@ pub fn write_event<'a, W: Write>( .and_data(data) .ok() } + (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)?; @@ -163,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)) => { @@ -191,6 +195,22 @@ pub fn write_event<'a, W: Write>( .and_data(data) .ok() } + (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)?; @@ -264,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)) => { @@ -323,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; @@ -409,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') { @@ -427,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)) => { @@ -505,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( @@ -580,30 +662,6 @@ 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(TagEnd::Paragraph)) => { writeln!(writer)?; @@ -880,8 +938,9 @@ pub fn write_event<'a, W: Write>( } // Unconditional returns to previous states - (Stacked(stack, _), End(TagEnd::BlockQuote(_))) => stack.pop().and_data(data).ok(), - (Stacked(stack, _), End(TagEnd::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/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-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-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