From 514e5f8ad7853d239f8209f269474e0609e0ee50 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Thu, 20 Jun 2024 18:19:54 -0700 Subject: [PATCH 001/180] Implement commonmark-hs compatible definition lists --- .../examples/parser-map-tag-print.rs | 3 + pulldown-cmark/specs/definition_lists.txt | 522 ++++++++++++++++ pulldown-cmark/src/firstpass.rs | 141 ++++- pulldown-cmark/src/html.rs | 30 + pulldown-cmark/src/lib.rs | 20 + pulldown-cmark/src/parse.rs | 21 + pulldown-cmark/src/scanners.rs | 23 + pulldown-cmark/src/tree.rs | 15 + pulldown-cmark/tests/lib.rs | 1 + .../tests/suite/definition_lists.rs | 565 ++++++++++++++++++ pulldown-cmark/tests/suite/mod.rs | 1 + 11 files changed, 1331 insertions(+), 11 deletions(-) create mode 100644 pulldown-cmark/specs/definition_lists.txt create mode 100644 pulldown-cmark/tests/suite/definition_lists.rs diff --git a/pulldown-cmark/examples/parser-map-tag-print.rs b/pulldown-cmark/examples/parser-map-tag-print.rs index 30b1919e..886befa1 100644 --- a/pulldown-cmark/examples/parser-map-tag-print.rs +++ b/pulldown-cmark/examples/parser-map-tag-print.rs @@ -60,6 +60,9 @@ fn main() { "List ordered_list_first_item_number: {:?}", ordered_list_first_item_number ), + Tag::DefinitionList => println!("Definition list"), + Tag::DefinitionListTitle => println!("Definition title (definition list item)"), + Tag::DefinitionListDefinition => println!("Definition (definition list item)"), Tag::Item => println!("Item (this is a list item)"), Tag::Emphasis => println!("Emphasis (this is a span tag)"), Tag::Strong => println!("Strong (this is a span tag)"), diff --git a/pulldown-cmark/specs/definition_lists.txt b/pulldown-cmark/specs/definition_lists.txt new file mode 100644 index 00000000..c41e5d16 --- /dev/null +++ b/pulldown-cmark/specs/definition_lists.txt @@ -0,0 +1,522 @@ +## Definition lists + +Based on https://github.com/jgm/commonmark-hs/blob/e3747fd282c806cd2f8e83226e85f1b83ee889c3/commonmark-extensions/test/definition_lists.md + +The term is given on a line by itself, followed by +one or more definitions. Each definition must begin +with `:` (after 0-2 spaces); subsequent lines must +be indented unless they are lazy paragraph +continuations. + +Commonmark-HS allows definition lists to use `~`. +We can't do that, because we already use `~` for strikethrough. + +The list is tight if there is no blank line between +the term and the first definition, otherwise loose. + +```````````````````````````````` example +apple +: red fruit + +orange +: orange fruit +. +
+
apple
+
red fruit
+
orange
+
orange fruit
+
+```````````````````````````````` + +Loose: + +```````````````````````````````` example +apple + +: red fruit + +orange + +: orange fruit +. +
+
apple
+
+

red fruit

+
+
orange
+
+

orange fruit

+
+
+```````````````````````````````` + +Also loose: + +```````````````````````````````` example +apple + +: red fruit +. +
+
apple
+
+

red fruit

+
+
+```````````````````````````````` + +Indented marker: + +```````````````````````````````` example +apple + : red fruit + +orange + : orange fruit +. +
+
apple
+
red fruit
+
orange
+
orange fruit
+
+```````````````````````````````` + +```````````````````````````````` example +apple + + : red fruit + +orange + + : orange fruit +. +
+
apple
+
+

red fruit

+
+
orange
+
+

orange fruit

+
+
+```````````````````````````````` + +Multiple blocks in a definition: + +```````````````````````````````` example +*apple* + +: red fruit + + contains seeds, + crisp, pleasant to taste + +*orange* + +: orange fruit + + { orange code block } + + > orange block quote +. +
+
apple
+
+

red fruit

+

contains seeds, +crisp, pleasant to taste

+
+
orange
+
+

orange fruit

+
{ orange code block }
+
+
+

orange block quote

+
+
+
+```````````````````````````````` + +Nested lists: + +```````````````````````````````` example +term + +: 1. Para one + + Para two +. +
+
term
+
+
    +
  1. Para one

    +

    Para two

  2. +
+
+
+```````````````````````````````` + +Multiple definitions, tight: + +```````````````````````````````` example +apple +: red fruit +: computer company + +orange +: orange fruit +: telecom company +. +
+
apple
+
red fruit
+
computer company
+
orange
+
orange fruit
+
telecom company
+
+```````````````````````````````` + +Multiple definitions, loose: + +```````````````````````````````` example +apple + +: red fruit + +: computer company + +orange + +: orange fruit +: telecom company +. +
+
apple
+
+

red fruit

+
+
+

computer company

+
+
orange
+
+

orange fruit

+
+
+

telecom company

+
+
+```````````````````````````````` + +Lazy line continuations: + +```````````````````````````````` example +apple + +: red fruit + +: computer +company + +orange + +: orange +fruit +: telecom company +. +
+
apple
+
+

red fruit

+
+
+

computer +company

+
+
orange
+
+

orange +fruit

+
+
+

telecom company

+
+
+```````````````````````````````` + +Definition terms may span multiple lines: + +```````````````````````````````` example +a +b\ +c + +: foo +. +
+
a +b
+c
+
+

foo

+
+
+```````````````````````````````` + +Definition list with preceding paragraph +(): + +```````````````````````````````` example +Foo + +bar +: baz + +bim +: bor +. +

Foo

+
+
bar
+
baz
+
bim
+
bor
+
+```````````````````````````````` + +Definition list followed by paragraph. + +```````````````````````````````` example +bar +: baz + +bim +: bor + +Bloze +. +
+
bar
+
baz
+
bim
+
bor
+
+

Bloze

+```````````````````````````````` + +The total indentation for a definition list cannot exceed four. +This means you can't have one start with four spaces. + +```````````````````````````````` example +bar + :baz + +Bloze +. +

bar +:baz

+

Bloze

+```````````````````````````````` + +You can follow one with four spaces, +because it'll "eat" the three spaces after it. + +```````````````````````````````` example +bar +: baz + +Bloze +. +
+
bar
+
baz
+
+

Bloze

+```````````````````````````````` + +To use an indented code block inside of a definition, +you need to have a total of eight spaces of indentation. +This can be done by having a colon followed by seven spaces, +or three spaces followed by four. + +```````````````````````````````` example +bar +: baz + +bar + : baz + +bar + : baz + +bar + : baz + +bar + : baz +. +
+
bar
+
baz
+
+
bar
+
baz
+
+
bar
+
baz
+
+
bar
+
baz
+
+
+

bar +: baz

+```````````````````````````````` + + +Definition titles can't be tables. + +```````````````````````````````` example +Test|Table +----|----- +: first +. + +
TestTable
+

: first

+```````````````````````````````` + +```````````````````````````````` example +first +: second + +Test|Table +----|----- +: fourth +. +
+
first
+
second
+
+ +
TestTable
+

: fourth

+```````````````````````````````` + + +Definition titles can't be headers + +```````````````````````````````` example +My section +========== +: first +. +

My section

+

: first

+```````````````````````````````` + +```````````````````````````````` example +first +: second + +My section +========== +: fourth +. +
+
first
+
second
+
+

My section

+

: fourth

+```````````````````````````````` + +```````````````````````````````` example +## My subsection +: first +. +

My subsection

+

: first

+```````````````````````````````` + +```````````````````````````````` example +first +: second + +## My subsection +: fourth +. +
+
first
+
second
+
+

My subsection

+

: fourth

+```````````````````````````````` + + +Definition titles can't end with hard line breaks. + +```````````````````````````````` example +first\ +: second + +third +: fourth +. +
+
first\
+
second
+
third
+
fourth
+
+```````````````````````````````` + + +Definition titles can't be HTML blocks, but inline's fine. + +```````````````````````````````` example +
first
+: second + +first +: second +
third
+: fourth +. +
first
+: second +
+
first
+
second
+
+
third
+: fourth +```````````````````````````````` + +```````````````````````````````` example +first +: second + +third +: fourth + +fifth +: sixth +. +
+
first
+
second
+
third
+
fourth
+
fifth
+
sixth
+
+```````````````````````````````` diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 89eb3e06..b1548d09 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -165,6 +165,66 @@ impl<'a, 'b> FirstPass<'a, 'b> { body: ItemBody::TaskListMarker(is_checked), }); } + } else if let Some(( + indent, + child, + item, + )) = self + .options + .contains(Options::ENABLE_DEFINITION_LIST) + .then(|| + self.tree + .cur() + .map(|cur| (self.tree[cur].child, &mut self.tree[cur].item)) + ) + .flatten() + .filter(|(_, item)| matches!(item, Item { + body: ItemBody::Paragraph | ItemBody::MaybeDefinitionListTitle | ItemBody::DefinitionListDefinition(_), + .. + })) + .and_then(|item| Some((line_start.scan_definition_list_definition_marker()?, item.0, item.1))) + { + match item.body { + ItemBody::Paragraph => { + item.body = ItemBody::DefinitionList(true); + let Item { start, end, .. } = *item; + let list_idx = self.tree.cur().unwrap(); + let title_idx = self.tree.create_node(Item { + start, + end, // will get updated later if item not empty + body: ItemBody::DefinitionListTitle, + }); + self.tree[title_idx].child = child; + self.tree[list_idx].child = Some(title_idx); + self.tree.push(); + } + ItemBody::MaybeDefinitionListTitle => { + item.body = ItemBody::DefinitionListTitle; + } + ItemBody::DefinitionListDefinition(_) => {} + _ => unreachable!(), + } + let after_marker_index = start_ix + line_start.bytes_scanned(); + self.tree.append(Item { + start: container_start, + end: after_marker_index, // will get updated later if item not empty + body: ItemBody::DefinitionListDefinition(indent), + }); + if let Some(ItemBody::DefinitionList(ref mut is_tight)) = + self.tree + .peek_up() + .map(|cur| &mut self.tree[cur].item.body) + { + if self.last_line_blank { + *is_tight = false; + self.last_line_blank = false; + } + } + self.tree.push(); + if let Some(n) = scan_blank_line(&bytes[after_marker_index..]) { + self.begin_list_item = Some(after_marker_index + n); + return after_marker_index + n; + } } else if line_start.scan_blockquote_marker() { let kind = if self.options.contains(Options::ENABLE_GFM) { line_start.scan_blockquote_tag() @@ -216,7 +276,8 @@ impl<'a, 'b> FirstPass<'a, 'b> { if let Some(node_ix) = self.tree.peek_up() { match &mut self.tree[node_ix].item.body { ItemBody::BlockQuote(..) => (), - ItemBody::ListItem(indent) if self.begin_list_item.is_some() => { + ItemBody::ListItem(indent) + | ItemBody::DefinitionListDefinition(indent) if self.begin_list_item.is_some() => { self.last_line_blank = true; // This is a blank list item. // While the list itself can be continued no matter how many blank lines @@ -228,17 +289,18 @@ impl<'a, 'b> FirstPass<'a, 'b> { self.last_line_blank = true; } } + } else { + self.last_line_blank = true; } return ix + n; } - self.finish_list(start_ix); - // Save `remaining_space` here to avoid needing to backtrack `line_start` for HTML blocks let remaining_space = line_start.remaining_space(); let indent = line_start.scan_space_upto(4); if indent == 4 { + self.finish_list(start_ix); let ix = start_ix + line_start.bytes_scanned(); let remaining_space = line_start.remaining_space(); return self.parse_indented_code_block(ix, remaining_space); @@ -255,6 +317,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { self.options .contains(Options::ENABLE_PLUSES_DELIMITED_METADATA_BLOCKS), ) { + self.finish_list(start_ix); return self.parse_metadata_block(ix, metadata_block_ch); } } @@ -264,6 +327,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { // Types 1-5 are all detected by one function and all end with the same // pattern if let Some(html_end_tag) = get_html_end_tag(&bytes[(ix + 1)..]) { + self.finish_list(start_ix); return self.parse_html_block_type_1_to_5( ix, html_end_tag, @@ -274,24 +338,29 @@ impl<'a, 'b> FirstPass<'a, 'b> { // Detect type 6 if starts_html_block_type_6(&bytes[(ix + 1)..]) { + self.finish_list(start_ix); return self.parse_html_block_type_6_or_7(ix, remaining_space, indent); } // Detect type 7 if let Some(_html_bytes) = scan_html_type_7(&bytes[ix..]) { + self.finish_list(start_ix); return self.parse_html_block_type_6_or_7(ix, remaining_space, indent); } } if let Ok(n) = scan_hrule(&bytes[ix..]) { + self.finish_list(start_ix); return self.parse_hrule(n, ix); } if let Some(atx_size) = scan_atx_heading(&bytes[ix..]) { + self.finish_list(start_ix); return self.parse_atx_heading(ix, atx_size); } if let Some((n, fence_ch)) = scan_code_fence(&bytes[ix..]) { + self.finish_list(start_ix); return self.parse_fenced_code_block(ix, indent, fence_ch, n); } @@ -331,6 +400,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { current_container, ) { + self.finish_list(start_ix); return ix; } else { line_start = lazy_line_start; @@ -338,6 +408,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { start_ix = ix; } } else { + self.finish_list(start_ix); return ix; } } @@ -482,6 +553,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { &bytes[ix..], current_container, self.options.has_gfm_footnotes(), + self.options.contains(Options::ENABLE_DEFINITION_LIST), &self.tree, ) { return None; @@ -493,10 +565,18 @@ impl<'a, 'b> FirstPass<'a, 'b> { /// Returns offset of line start after paragraph. fn parse_paragraph(&mut self, start_ix: usize) -> usize { + let body = if let Some(ItemBody::DefinitionList(_)) = self.tree.peek_up().map(|idx| self.tree[idx].item.body) { + // blank lines between the previous definition and this one don't count + self.last_line_blank = false; + ItemBody::MaybeDefinitionListTitle + } else { + self.finish_list(start_ix); + ItemBody::Paragraph + }; let node_ix = self.tree.append(Item { start: start_ix, end: 0, // will get set later - body: ItemBody::Paragraph, + body, }); self.tree.push(); @@ -527,6 +607,9 @@ impl<'a, 'b> FirstPass<'a, 'b> { // be a cleaner way self.tree[node_ix].child = None; self.tree.pop(); + if body == ItemBody::MaybeDefinitionListTitle { + self.finish_list(ix); + } self.tree.push(); if let Some(ix) = self.parse_table(table_cols, ix, next_ix) { return ix; @@ -557,8 +640,11 @@ impl<'a, 'b> FirstPass<'a, 'b> { if let Some(pos) = trailing_backslash_pos { self.tree.append_text(pos, pos + 1, false); } - ix = ix_setext; - break; + self.pop(ix_setext); + if body == ItemBody::MaybeDefinitionListTitle { + self.finish_list(ix); + } + return ix_setext; } } // first check for non-empty lists, then for other interrupts @@ -1401,7 +1487,11 @@ impl<'a, 'b> FirstPass<'a, 'b> { fn pop(&mut self, ix: usize) { let cur_ix = self.tree.pop().unwrap(); self.tree[cur_ix].item.end = ix; - if let ItemBody::List(true, _, _) = self.tree[cur_ix].item.body { + if let ItemBody::DefinitionList(_) = self.tree[cur_ix].item.body { + fixup_end_of_definition_list(&mut self.tree, cur_ix); + self.begin_list_item = None; + } + if let ItemBody::List(true, _, _) | ItemBody::DefinitionList(true) = self.tree[cur_ix].item.body { surgerize_tight_list(&mut self.tree, cur_ix); self.begin_list_item = None; } @@ -1412,13 +1502,13 @@ impl<'a, 'b> FirstPass<'a, 'b> { fn finish_list(&mut self, ix: usize) { self.finish_empty_list_item(); if let Some(node_ix) = self.tree.peek_up() { - if let ItemBody::List(_, _, _) = self.tree[node_ix].item.body { + if let ItemBody::List(_, _, _) | ItemBody::DefinitionList(_) = self.tree[node_ix].item.body { self.pop(ix); } } if self.last_line_blank { if let Some(node_ix) = self.tree.peek_grandparent() { - if let ItemBody::List(ref mut is_tight, _, _) = self.tree[node_ix].item.body { + if let ItemBody::List(ref mut is_tight, _, _) | ItemBody::DefinitionList(ref mut is_tight) = self.tree[node_ix].item.body { *is_tight = false; } } @@ -1431,7 +1521,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { if self.last_line_blank { // A list item can begin with at most one blank line. if let Some(node_ix) = self.tree.peek_up() { - if let ItemBody::ListItem(_) = self.tree[node_ix].item.body { + if let ItemBody::ListItem(_) | ItemBody::DefinitionListDefinition(_) = self.tree[node_ix].item.body { self.pop(begin_list_item); } } @@ -1854,7 +1944,13 @@ impl<'a, 'b> FirstPass<'a, 'b> { /// Checks whether we should break a paragraph on the given input. fn scan_paragraph_interrupt(&self, bytes: &[u8], current_container: bool) -> bool { let gfm_footnote = self.options.has_gfm_footnotes(); - if scan_paragraph_interrupt_no_table(bytes, current_container, gfm_footnote, &self.tree) { + if scan_paragraph_interrupt_no_table( + bytes, + current_container, + gfm_footnote, + self.options.contains(Options::ENABLE_DEFINITION_LIST), + &self.tree, + ) { return true; } // pulldown-cmark allows heavy tables, that have a `|` on the header row, @@ -2010,6 +2106,7 @@ fn scan_paragraph_interrupt_no_table( bytes: &[u8], current_container: bool, gfm_footnote: bool, + definition_list: bool, tree: &Tree, ) -> bool { scan_eol(bytes).is_some() @@ -2027,6 +2124,7 @@ fn scan_paragraph_interrupt_no_table( }) || bytes.starts_with(b"<") && (get_html_end_tag(&bytes[1..]).is_some() || starts_html_block_type_6(&bytes[1..])) + || definition_list && bytes.starts_with(b":") || (gfm_footnote && bytes.starts_with(b"[^") && scan_link_label_rest( @@ -2126,6 +2224,27 @@ fn surgerize_tight_list(tree: &mut Tree, list_ix: TreeIndex) { } } +fn fixup_end_of_definition_list(tree: &mut Tree, list_ix: TreeIndex) { + let mut list_item = tree[list_ix].child; + let mut previous_list_item = None; + while let Some(listitem_ix) = list_item { + match &mut tree[listitem_ix].item.body { + ItemBody::DefinitionListTitle | ItemBody::DefinitionListDefinition(_) => { + previous_list_item = list_item; + list_item = tree[listitem_ix].next; + } + body @ ItemBody::MaybeDefinitionListTitle => { + *body = ItemBody::Paragraph; + break; + } + _ => break, + } + } + if let Some(previous_list_item) = previous_list_item { + tree.truncate_to_parent(previous_list_item); + } +} + /// Determines whether the delimiter run starting at given index is /// left-flanking, as defined by the commonmark spec (and isn't intraword /// for _ delims). diff --git a/pulldown-cmark/src/html.rs b/pulldown-cmark/src/html.rs index 54005bdc..85609095 100644 --- a/pulldown-cmark/src/html.rs +++ b/pulldown-cmark/src/html.rs @@ -300,6 +300,27 @@ where self.write("\n
  • ") } } + Tag::DefinitionList => { + if self.end_newline { + self.write("
    \n") + } else { + self.write("\n
    \n") + } + } + Tag::DefinitionListTitle => { + if self.end_newline { + self.write("
    ") + } else { + self.write("\n
    ") + } + } + Tag::DefinitionListDefinition => { + if self.end_newline { + self.write("
    ") + } else { + self.write("\n
    ") + } + } Tag::Emphasis => self.write(""), Tag::Strong => self.write(""), Tag::Strikethrough => self.write(""), @@ -414,6 +435,15 @@ where TagEnd::Item => { self.write("
  • \n")?; } + TagEnd::DefinitionList => { + self.write("\n")?; + } + TagEnd::DefinitionListTitle => { + self.write("\n")?; + } + TagEnd::DefinitionListDefinition => { + self.write("\n")?; + } TagEnd::Emphasis => { self.write("")?; } diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index 82c28fcd..616d8b58 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -177,6 +177,10 @@ pub enum Tag<'a> { #[cfg_attr(feature = "serde", serde(borrow))] FootnoteDefinition(CowStr<'a>), + DefinitionList, + DefinitionListTitle, + DefinitionListDefinition, + /// A table. Contains a vector describing the text-alignment for each of its columns. Table(Vec), /// A table header. Contains only `TableCell`s. Note that the table body starts immediately @@ -235,6 +239,9 @@ impl<'a> Tag<'a> { Tag::Link { .. } => TagEnd::Link, Tag::Image { .. } => TagEnd::Image, Tag::MetadataBlock(kind) => TagEnd::MetadataBlock(*kind), + Tag::DefinitionList => TagEnd::DefinitionList, + Tag::DefinitionListTitle => TagEnd::DefinitionListTitle, + Tag::DefinitionListDefinition => TagEnd::DefinitionListDefinition, } } } @@ -256,6 +263,10 @@ pub enum TagEnd { Item, FootnoteDefinition, + DefinitionList, + DefinitionListTitle, + DefinitionListDefinition, + Table, TableHead, TableRow, @@ -486,6 +497,15 @@ bitflags::bitflags! { /// The following features are currently behind this tag: /// - Blockquote tags ([!NOTE], [!TIP], [!IMPORTANT], [!WARNING], [!CAUTION]). const ENABLE_GFM = 1 << 11; + /// Commonmark-HS-Extensions compatible definition lists. + /// + /// ```markdown + /// title 1 + /// : definition 1 + /// title 2 + /// : definition 2 + /// ``` + const ENABLE_DEFINITION_LIST = 1 << 12; } } diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 8fef6657..6c08dff0 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -104,6 +104,14 @@ pub(crate) enum ItemBody { FootnoteDefinition(CowIndex), MetadataBlock(MetadataBlockKind), + // Definition lists + DefinitionList(bool), // is_tight + // gets turned into either a paragraph or a definition list title, + // depending on whether there's a definition after it + MaybeDefinitionListTitle, + DefinitionListTitle, + DefinitionListDefinition(usize), + // Tables Table(AlignmentIndex), TableHead, @@ -1294,6 +1302,13 @@ pub(crate) fn scan_containers( break; } } + ItemBody::DefinitionListDefinition(indent) => { + let save = line_start.clone(); + if !line_start.scan_space(indent) && !line_start.is_at_eol() { + *line_start = save; + break; + } + } ItemBody::FootnoteDefinition(..) if gfm_footnotes => { let save = line_start.clone(); if !line_start.scan_space(4) && !line_start.is_at_eol() { @@ -2042,6 +2057,9 @@ fn body_to_tag_end(body: &ItemBody) -> TagEnd { ItemBody::Table(..) => TagEnd::Table, ItemBody::FootnoteDefinition(..) => TagEnd::FootnoteDefinition, ItemBody::MetadataBlock(kind) => TagEnd::MetadataBlock(kind), + ItemBody::DefinitionList(_) => TagEnd::DefinitionList, + ItemBody::DefinitionListTitle => TagEnd::DefinitionListTitle, + ItemBody::DefinitionListDefinition(_) => TagEnd::DefinitionListDefinition, _ => panic!("unexpected item body {:?}", body), } } @@ -2126,6 +2144,9 @@ fn item_to_event<'a>(item: Item, text: &'a str, allocs: &mut Allocations<'a>) -> Event::InlineMath(allocs.take_cow(cow_ix)) } } + ItemBody::DefinitionList(_) => Tag::DefinitionList, + ItemBody::DefinitionListTitle => Tag::DefinitionListTitle, + ItemBody::DefinitionListDefinition(_) => Tag::DefinitionListDefinition, _ => panic!("unexpected item body {:?}", item.body), }; diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index 274e3455..160d1c8c 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -271,6 +271,29 @@ impl<'a> LineStart<'a> { } } + /// Scan a definition marker. + /// + /// Definition markers are single colons, preceded by at most three spaces + /// and followed by at most three spaces. The indentation of following + /// lines is equal to the whole size of the marker, including the colon. + /// + /// If one is found, it will make the preceding paragraph into a definition + /// list title. + /// + /// Return value is the amount of indentation, or `None` if it's not a + /// definition list marker. + pub(crate) fn scan_definition_list_definition_marker(&mut self) -> Option { + let save = self.clone(); + let indent = self.scan_space_upto(4); + if indent < 4 && self.scan_ch(b':') { + let remaining = 4 - (indent + 1); + Some(indent + 1 + self.scan_space_upto(remaining)) + } else { + *self = save; + None + } + } + /// Scan a list marker. /// /// Return value is the character, the start index, and the indent in spaces. diff --git a/pulldown-cmark/src/tree.rs b/pulldown-cmark/src/tree.rs index 9b2ce208..cca6208e 100644 --- a/pulldown-cmark/src/tree.rs +++ b/pulldown-cmark/src/tree.rs @@ -175,6 +175,21 @@ impl Tree { self.cur = self[cur_ix].next; self.cur } + + pub(crate) fn truncate_to_parent(&mut self, child_ix: TreeIndex) { + let next = self[child_ix].next; + self[child_ix].next = None; + if let Some(cur) = self.cur { + self[cur].next = next; + } else if let Some(&parent) = self.spine.last() { + self[parent].child = next; + } + if next.is_some() { + self.cur = next; + } else { + self.pop(); + } + } } impl Tree { diff --git a/pulldown-cmark/tests/lib.rs b/pulldown-cmark/tests/lib.rs index 4c16ae06..e34cb2a9 100644 --- a/pulldown-cmark/tests/lib.rs +++ b/pulldown-cmark/tests/lib.rs @@ -33,6 +33,7 @@ pub fn test_markdown_html( opts.insert(Options::ENABLE_SMART_PUNCTUATION); } opts.insert(Options::ENABLE_HEADING_ATTRIBUTES); + opts.insert(Options::ENABLE_DEFINITION_LIST); let p = Parser::new_ext(input, opts); pulldown_cmark::html::push_html(&mut s, p); diff --git a/pulldown-cmark/tests/suite/definition_lists.rs b/pulldown-cmark/tests/suite/definition_lists.rs new file mode 100644 index 00000000..408a3345 --- /dev/null +++ b/pulldown-cmark/tests/suite/definition_lists.rs @@ -0,0 +1,565 @@ +// This file is auto-generated by the build script +// Please, do not modify it manually + +use super::test_markdown_html; + +#[test] +fn definition_lists_test_1() { + let original = r##"apple +: red fruit + +orange +: orange fruit +"##; + let expected = r##"
    +
    apple
    +
    red fruit
    +
    orange
    +
    orange fruit
    +
    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_2() { + let original = r##"apple + +: red fruit + +orange + +: orange fruit +"##; + let expected = r##"
    +
    apple
    +
    +

    red fruit

    +
    +
    orange
    +
    +

    orange fruit

    +
    +
    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_3() { + let original = r##"apple + +: red fruit +"##; + let expected = r##"
    +
    apple
    +
    +

    red fruit

    +
    +
    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_4() { + let original = r##"apple + : red fruit + +orange + : orange fruit +"##; + let expected = r##"
    +
    apple
    +
    red fruit
    +
    orange
    +
    orange fruit
    +
    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_5() { + let original = r##"apple + + : red fruit + +orange + + : orange fruit +"##; + let expected = r##"
    +
    apple
    +
    +

    red fruit

    +
    +
    orange
    +
    +

    orange fruit

    +
    +
    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_6() { + let original = r##"*apple* + +: red fruit + + contains seeds, + crisp, pleasant to taste + +*orange* + +: orange fruit + + { orange code block } + + > orange block quote +"##; + let expected = r##"
    +
    apple
    +
    +

    red fruit

    +

    contains seeds, +crisp, pleasant to taste

    +
    +
    orange
    +
    +

    orange fruit

    +
    { orange code block }
    +
    +
    +

    orange block quote

    +
    +
    +
    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_7() { + let original = r##"term + +: 1. Para one + + Para two +"##; + let expected = r##"
    +
    term
    +
    +
      +
    1. Para one

      +

      Para two

    2. +
    +
    +
    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_8() { + let original = r##"apple +: red fruit +: computer company + +orange +: orange fruit +: telecom company +"##; + let expected = r##"
    +
    apple
    +
    red fruit
    +
    computer company
    +
    orange
    +
    orange fruit
    +
    telecom company
    +
    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_9() { + let original = r##"apple + +: red fruit + +: computer company + +orange + +: orange fruit +: telecom company +"##; + let expected = r##"
    +
    apple
    +
    +

    red fruit

    +
    +
    +

    computer company

    +
    +
    orange
    +
    +

    orange fruit

    +
    +
    +

    telecom company

    +
    +
    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_10() { + let original = r##"apple + +: red fruit + +: computer +company + +orange + +: orange +fruit +: telecom company +"##; + let expected = r##"
    +
    apple
    +
    +

    red fruit

    +
    +
    +

    computer +company

    +
    +
    orange
    +
    +

    orange +fruit

    +
    +
    +

    telecom company

    +
    +
    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_11() { + let original = r##"a +b\ +c + +: foo +"##; + let expected = r##"
    +
    a +b
    +c
    +
    +

    foo

    +
    +
    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_12() { + let original = r##"Foo + +bar +: baz + +bim +: bor +"##; + let expected = r##"

    Foo

    +
    +
    bar
    +
    baz
    +
    bim
    +
    bor
    +
    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_13() { + let original = r##"bar +: baz + +bim +: bor + +Bloze +"##; + let expected = r##"
    +
    bar
    +
    baz
    +
    bim
    +
    bor
    +
    +

    Bloze

    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_14() { + let original = r##"bar + :baz + +Bloze +"##; + let expected = r##"

    bar +:baz

    +

    Bloze

    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_15() { + let original = r##"bar +: baz + +Bloze +"##; + let expected = r##"
    +
    bar
    +
    baz
    +
    +

    Bloze

    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_16() { + let original = r##"bar +: baz + +bar + : baz + +bar + : baz + +bar + : baz + +bar + : baz +"##; + let expected = r##"
    +
    bar
    +
    baz
    +
    +
    bar
    +
    baz
    +
    +
    bar
    +
    baz
    +
    +
    bar
    +
    baz
    +
    +
    +

    bar +: baz

    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_17() { + let original = r##"Test|Table +----|----- +: first +"##; + let expected = r##" +
    TestTable
    +

    : first

    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_18() { + let original = r##"first +: second + +Test|Table +----|----- +: fourth +"##; + let expected = r##"
    +
    first
    +
    second
    +
    + +
    TestTable
    +

    : fourth

    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_19() { + let original = r##"My section +========== +: first +"##; + let expected = r##"

    My section

    +

    : first

    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_20() { + let original = r##"first +: second + +My section +========== +: fourth +"##; + let expected = r##"
    +
    first
    +
    second
    +
    +

    My section

    +

    : fourth

    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_21() { + let original = r##"## My subsection +: first +"##; + let expected = r##"

    My subsection

    +

    : first

    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_22() { + let original = r##"first +: second + +## My subsection +: fourth +"##; + let expected = r##"
    +
    first
    +
    second
    +
    +

    My subsection

    +

    : fourth

    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_23() { + let original = r##"first\ +: second + +third +: fourth +"##; + let expected = r##"
    +
    first\
    +
    second
    +
    third
    +
    fourth
    +
    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_24() { + let original = r##"
    first
    +: second + +first +: second +
    third
    +: fourth +"##; + let expected = r##"
    first
    +: second +
    +
    first
    +
    second
    +
    +
    third
    +: fourth +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_25() { + let original = r##"first +: second + +third +: fourth + +fifth +: sixth +"##; + let expected = r##"
    +
    first
    +
    second
    +
    third
    +
    fourth
    +
    fifth
    +
    sixth
    +
    +"##; + + test_markdown_html(original, expected, false, false, false); +} diff --git a/pulldown-cmark/tests/suite/mod.rs b/pulldown-cmark/tests/suite/mod.rs index 0f4a250a..7a3fd142 100644 --- a/pulldown-cmark/tests/suite/mod.rs +++ b/pulldown-cmark/tests/suite/mod.rs @@ -4,6 +4,7 @@ pub use super::test_markdown_html; mod blockquotes_tags; +mod definition_lists; mod footnotes; mod gfm_strikethrough; mod gfm_table; From 6a1e562ddfbeda31d31b7c4c4f3e834487d32c1b Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Tue, 13 Aug 2024 21:07:06 +0300 Subject: [PATCH 002/180] Add regression test for #655 --- pulldown-cmark/specs/regression.txt | 9 +++++++++ pulldown-cmark/tests/suite/regression.rs | 11 +++++++++++ 2 files changed, 20 insertions(+) diff --git a/pulldown-cmark/specs/regression.txt b/pulldown-cmark/specs/regression.txt index 0a2bf3df..7b6cb7fc 100644 --- a/pulldown-cmark/specs/regression.txt +++ b/pulldown-cmark/specs/regression.txt @@ -2635,3 +2635,12 @@ bar

    bar

    ```````````````````````````````` + +ISSUE #655 + +```````````````````````````````` example +` +` +. +

    +```````````````````````````````` diff --git a/pulldown-cmark/tests/suite/regression.rs b/pulldown-cmark/tests/suite/regression.rs index 31236311..14f2833a 100644 --- a/pulldown-cmark/tests/suite/regression.rs +++ b/pulldown-cmark/tests/suite/regression.rs @@ -3142,3 +3142,14 @@ bar test_markdown_html(original, expected, false, true, false); } + +#[test] +fn regression_test_200() { + let original = r##"` +` +"##; + let expected = r##"

    +"##; + + test_markdown_html(original, expected, false, false, false); +} From edd532b57ff058ec7dd88d671591e874dbc339e1 Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Tue, 13 Aug 2024 20:20:19 +0300 Subject: [PATCH 003/180] Rewrite and refactor TextMergeStream/WithOffset Rewrite TextMergeWithOffset to work similarly to the original TextMergeStream. Implement TextMergeStream in terms of this new implementation (with dummy offsets), so that their behavior is the same. --- pulldown-cmark/src/utils.rs | 141 ++++++++++++++++-------------------- 1 file changed, 62 insertions(+), 79 deletions(-) diff --git a/pulldown-cmark/src/utils.rs b/pulldown-cmark/src/utils.rs index 7e4e5566..67fad8d0 100644 --- a/pulldown-cmark/src/utils.rs +++ b/pulldown-cmark/src/utils.rs @@ -9,16 +9,13 @@ //! Its author proposed the solution in //! . -use crate::{ - BrokenLinkCallback, CowStr, DefaultBrokenLinkCallback, Event, OffsetIter, Options, Parser, -}; -use std::{iter::Peekable, ops::Range}; +use crate::{CowStr, Event}; +use std::ops::Range; /// Merge consecutive `Event::Text` events into only one. #[derive(Debug)] pub struct TextMergeStream<'a, I> { - iter: I, - last_event: Option>, + inner: TextMergeWithOffset<'a, DummyOffsets>, } impl<'a, I> TextMergeStream<'a, I> @@ -27,8 +24,7 @@ where { pub fn new(iter: I) -> Self { Self { - iter, - last_event: None, + inner: TextMergeWithOffset::new(DummyOffsets(iter)), } } } @@ -39,17 +35,69 @@ where { type Item = Event<'a>; + fn next(&mut self) -> Option { + self.inner.next().map(|(event, _)| event) + } +} + +#[derive(Debug)] +struct DummyOffsets(I); + +impl<'a, I> Iterator for DummyOffsets +where + I: Iterator>, +{ + type Item = (Event<'a>, Range); + + fn next(&mut self) -> Option { + self.0.next().map(|event| (event, 0..0)) + } +} + +/// Merge consecutive `Event::Text` events into only one, with offsets. +/// +/// Compatible with with [`OffsetIter`](crate::OffsetIter). +#[derive(Debug)] +pub struct TextMergeWithOffset<'a, I> { + iter: I, + last_event: Option<(Event<'a>, Range)>, +} + +impl<'a, I> TextMergeWithOffset<'a, I> +where + I: Iterator, Range)>, +{ + pub fn new(iter: I) -> Self { + Self { + iter, + last_event: None, + } + } +} + +impl<'a, I> Iterator for TextMergeWithOffset<'a, I> +where + I: Iterator, Range)>, +{ + type Item = (Event<'a>, Range); + fn next(&mut self) -> Option { match (self.last_event.take(), self.iter.next()) { - (Some(Event::Text(last_text)), Some(Event::Text(next_text))) => { + ( + Some((Event::Text(last_text), last_offset)), + Some((Event::Text(next_text), next_offset)), + ) => { // We need to start merging consecutive text events together into one let mut string_buf: String = last_text.into_string(); string_buf.push_str(&next_text); + let mut offset = last_offset; + offset.end = next_offset.end; loop { // Avoid recursion to avoid stack overflow and to optimize concatenation match self.iter.next() { - Some(Event::Text(next_text)) => { + Some((Event::Text(next_text), next_offset)) => { string_buf.push_str(&next_text); + offset.end = next_offset.end; } next_event => { self.last_event = next_event; @@ -57,9 +105,10 @@ where // Discard text event(s) altogether if there is no text break self.next(); } else { - break Some(Event::Text(CowStr::Boxed( - string_buf.into_boxed_str(), - ))); + break Some(( + Event::Text(CowStr::Boxed(string_buf.into_boxed_str())), + offset, + )); } } } @@ -82,69 +131,3 @@ where } } } - -/// Merge consecutive `Event::Text` events into only one with offsets. -#[derive(Debug)] -pub struct TextMergeWithOffset<'input, F = DefaultBrokenLinkCallback> -where - F: BrokenLinkCallback<'input>, -{ - source: &'input str, - parser: Peekable>, -} - -impl<'input, F> TextMergeWithOffset<'input, F> -where - F: BrokenLinkCallback<'input>, -{ - pub fn new_ext(source: &'input str, options: Options) -> Self { - Self { - source, - parser: Parser::new_with_broken_link_callback(source, options, None) - .into_offset_iter() - .peekable(), - } - } - pub fn new_ext_with_broken_link_callback( - source: &'input str, - options: Options, - callback: Option, - ) -> Self { - Self { - source, - parser: Parser::new_with_broken_link_callback(source, options, callback) - .into_offset_iter() - .peekable(), - } - } -} - -impl<'input, F> Iterator for TextMergeWithOffset<'input, F> -where - F: BrokenLinkCallback<'input>, -{ - type Item = (Event<'input>, Range); - fn next(&mut self) -> Option { - let is_empty_text = |x: Option<&(Event<'input>, Range)>| match x { - Some(e) => matches!(&e.0, Event::Text(t) if t.is_empty()), - None => false, - }; - - while is_empty_text(self.parser.peek()) { - self.parser.next(); - } - - match self.parser.peek()? { - (Event::Text(_), range) => { - let start = range.start; - let mut end = range.end; - while let Some((Event::Text(_), _)) = self.parser.peek() { - end = self.parser.next().unwrap().1.end; - } - - Some((Event::Text(self.source[start..end].into()), start..end)) - } - _ => self.parser.next(), - } - } -} From 2bb59f38c186b983897f5aaec3efd42f49614c0b Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Tue, 13 Aug 2024 20:23:17 +0300 Subject: [PATCH 004/180] Add simple tests to TextMergeStream/WithOffset --- pulldown-cmark/src/utils.rs | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/pulldown-cmark/src/utils.rs b/pulldown-cmark/src/utils.rs index 67fad8d0..977f9702 100644 --- a/pulldown-cmark/src/utils.rs +++ b/pulldown-cmark/src/utils.rs @@ -131,3 +131,51 @@ where } } } + +#[cfg(test)] +mod test { + use super::*; + use crate::Parser; + + #[test] + fn text_merge_stream_indent() { + let source = r#" + first line + second line +"#; + let parser = TextMergeStream::new(Parser::new(source)); + let text_events: Vec<_> = parser.filter(|e| matches!(e, Event::Text(_))).collect(); + assert_eq!( + text_events, + [Event::Text("first line\nsecond line\n".into())] + ); + } + + #[test] + fn text_merge_with_offset_indent() { + let source = r#" + first line + second line +"#; + let parser = TextMergeWithOffset::new(Parser::new(source).into_offset_iter()); + let text_events: Vec<_> = parser + .filter(|e| matches!(e, (Event::Text(_), _))) + .collect(); + assert_eq!( + text_events, + [(Event::Text("first line\nsecond line\n".into()), 5..32)] + ); + } + + #[test] + fn text_merge_empty_is_discarded() { + let events = [ + Event::Rule, + Event::Text("".into()), + Event::Text("".into()), + Event::Rule, + ]; + let result: Vec<_> = TextMergeStream::new(events.into_iter()).collect(); + assert_eq!(result, [Event::Rule, Event::Rule]); + } +} From 614e6996f500e9efeb96812a36f536cdf4a9e1b5 Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Fri, 16 Aug 2024 02:09:54 +0300 Subject: [PATCH 005/180] fuzzer: update crates --- fuzzer/Cargo.lock | 538 +++++++++++++++--------------------------- fuzzer/Cargo.toml | 17 +- fuzzer/src/scoring.rs | 2 +- 3 files changed, 194 insertions(+), 363 deletions(-) diff --git a/fuzzer/Cargo.lock b/fuzzer/Cargo.lock index 8dbb2cc8..54c2e0fc 100644 --- a/fuzzer/Cargo.lock +++ b/fuzzer/Cargo.lock @@ -4,78 +4,70 @@ version = 3 [[package]] name = "anstream" -version = "0.6.11" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.5" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2faccea4cc4ab4a667ce676a30e8ec13922a692c99bb8f5b11f1502c72e04220" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "autocfg" -version = "0.1.8" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" -dependencies = [ - "autocfg 1.1.0", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "bitflags" -version = "1.3.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] -name = "bitflags" -version = "2.4.2" +name = "byteorder" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cfg-if" @@ -85,9 +77,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.18" +version = "4.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" +checksum = "11d8838454fda655dafd3accb2b6e2bea645b9e4078abe84a22ceb947235c5cc" dependencies = [ "clap_builder", "clap_derive", @@ -95,9 +87,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.18" +version = "4.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" +checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" dependencies = [ "anstream", "anstyle", @@ -107,54 +99,39 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" dependencies = [ "heck", - "proc-macro2 1.0.78", - "quote 1.0.35", - "syn 2.0.48", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" - -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags 1.3.2", -] +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "either" -version = "1.9.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "fuzzer" @@ -162,17 +139,17 @@ version = "0.1.0" dependencies = [ "clap", "crossbeam-utils", - "itertools 0.8.2", + "itertools", "libc", "ndarray", "ndarray-stats", "num_cpus", "pulldown-cmark", - "rand 0.7.3", + "rand", "rand_xoshiro", "serde", "serde_json", - "syn 0.15.44", + "syn", "walkdir", ] @@ -187,9 +164,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.16" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -204,15 +181,15 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.4" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "indexmap" @@ -220,118 +197,115 @@ version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ - "autocfg 1.1.0", + "autocfg", "hashbrown", ] [[package]] -name = "itertools" -version = "0.7.11" +name = "is_terminal_polyfill" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d47946d458e94a1b7bcabbf6521ea7c037062c81f534615abcad76e84d4970d" -dependencies = [ - "either", -] +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" -version = "0.8.2" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "a5f43f184355eefb8d17fc948dbecf6c13be3c141f20d834ae842193a448c72a" [[package]] name = "matrixmultiply" -version = "0.1.15" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcad67dcec2d58ff56f6292582377e6921afdf3bfbd533e26fb8900ae575e002" +checksum = "9380b911e3e96d10c1f415da0876389aaf1b56759054eeb0de7df940c456ba1a" dependencies = [ + "autocfg", "rawpointer", ] [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "ndarray" -version = "0.12.1" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cf380a8af901ad627594013a3bbac903ae0a6f94e176e47e46b5bbc1877b928" +checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" dependencies = [ - "itertools 0.7.11", "matrixmultiply", "num-complex", + "num-integer", "num-traits", + "rawpointer", ] [[package]] name = "ndarray-stats" -version = "0.2.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4570b4f029fb2a8bd5f1f629753fb0b01c0cc8343f5eb77c9dc6699d9cf7b036" +checksum = "af5a8477ac96877b5bd1fd67e0c28736c12943aba24eda92b127e036b0c8f400" dependencies = [ "indexmap", - "itertools 0.8.2", + "itertools", "ndarray", "noisy_float", "num-integer", "num-traits", - "rand 0.6.5", + "rand", ] [[package]] name = "noisy_float" -version = "0.1.15" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3deb89f8062c0dce4c805a987daff07f92e17c560f7c3ed631282555af902258" +checksum = "978fe6e6ebc0bf53de533cd456ca2d9de13de13856eda1518a285d7705a213af" dependencies = [ "num-traits", ] [[package]] name = "num-complex" -version = "0.2.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ - "autocfg 1.1.0", "num-traits", ] [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg 1.1.0", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ - "autocfg 1.1.0", + "autocfg", ] [[package]] @@ -346,33 +320,27 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "proc-macro2" -version = "0.4.30" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ - "unicode-xid", + "zerocopy", ] [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "pulldown-cmark" -version = "0.10.0" +version = "0.11.0" dependencies = [ - "bitflags 2.4.2", + "bitflags", "getopts", "memchr", "pulldown-cmark-escape", @@ -381,202 +349,67 @@ dependencies = [ [[package]] name = "pulldown-cmark-escape" -version = "0.10.0" - -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", -] +version = "0.11.0" [[package]] name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2 1.0.78", -] - -[[package]] -name = "rand" -version = "0.6.5" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ - "autocfg 0.1.8", - "libc", - "rand_chacha 0.1.1", - "rand_core 0.4.2", - "rand_hc 0.1.0", - "rand_isaac", - "rand_jitter", - "rand_os", - "rand_pcg", - "rand_xorshift", - "winapi", + "proc-macro2", ] [[package]] name = "rand" -version = "0.7.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "getrandom", "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc 0.2.0", + "rand_chacha", + "rand_core", ] [[package]] name = "rand_chacha" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" -dependencies = [ - "autocfg 0.1.8", - "rand_core 0.3.1", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", -] - -[[package]] -name = "rand_core" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ - "rand_core 0.4.2", + "ppv-lite86", + "rand_core", ] [[package]] name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - -[[package]] -name = "rand_core" -version = "0.5.1" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ "getrandom", ] -[[package]] -name = "rand_hc" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_isaac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_jitter" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" -dependencies = [ - "libc", - "rand_core 0.4.2", - "winapi", -] - -[[package]] -name = "rand_os" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" -dependencies = [ - "cloudabi", - "fuchsia-cprng", - "libc", - "rand_core 0.4.2", - "rdrand", - "winapi", -] - -[[package]] -name = "rand_pcg" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" -dependencies = [ - "autocfg 0.1.8", - "rand_core 0.4.2", -] - -[[package]] -name = "rand_xorshift" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -dependencies = [ - "rand_core 0.3.1", -] - [[package]] name = "rand_xoshiro" -version = "0.4.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9fcdd2e881d02f1d9390ae47ad8e5696a9e4be7b547a1da2afbc61973217004" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" dependencies = [ - "rand_core 0.5.1", + "rand_core", ] [[package]] name = "rawpointer" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebac11a9d2e11f2af219b8b8d833b76b1ea0e054aa0e8d8e9e4cbde353bdf019" - -[[package]] -name = "rdrand" -version = "0.4.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -589,60 +422,50 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.196" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", - "syn 2.0.48", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "syn" -version = "0.15.44" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "unicode-xid", -] +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.48" +version = "2.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "unicode-ident", ] @@ -663,33 +486,27 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-width" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" - -[[package]] -name = "unicode-xid" -version = "0.1.0" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -697,59 +514,47 @@ dependencies = [ [[package]] name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "winapi" -version = "0.3.9" +name = "winapi-util" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "windows-sys 0.59.0", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.6" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "winapi", + "windows-targets", ] -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-sys" -version = "0.52.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", "windows_i686_gnu", + "windows_i686_gnullvm", "windows_i686_msvc", "windows_x86_64_gnu", "windows_x86_64_gnullvm", @@ -758,42 +563,69 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/fuzzer/Cargo.toml b/fuzzer/Cargo.toml index ffa76435..491472c4 100644 --- a/fuzzer/Cargo.toml +++ b/fuzzer/Cargo.toml @@ -5,15 +5,15 @@ authors = ["oberien "] edition = "2018" [dependencies] -syn = { version = "0.15", features = ["full"] } -itertools = "0.8" -walkdir = "2.2" +syn = { version = "2", features = ["full", "visit"] } +itertools = "0.10" +walkdir = "2.5" pulldown-cmark = { path = "../pulldown-cmark" } -ndarray = "0.12" -ndarray-stats = "0.2" -rand = "0.7" -rand_xoshiro = "0.4" -num_cpus = "1.10" +ndarray = "0.15" +ndarray-stats = "0.5" +rand = "0.8" +rand_xoshiro = "0.6" +num_cpus = "1.16" crossbeam-utils = "0.8" libc = "0.2" serde = { version = "1.0", features = ["derive"] } @@ -26,4 +26,3 @@ lto = "fat" # Prevent this from interfering with workspaces [workspace] members = ["."] - diff --git a/fuzzer/src/scoring.rs b/fuzzer/src/scoring.rs index d1e74a38..833785ee 100644 --- a/fuzzer/src/scoring.rs +++ b/fuzzer/src/scoring.rs @@ -12,7 +12,7 @@ pub fn pearson_correlation(time_samples: &[(f64, f64)]) -> (f64, bool) { vec.extend(time_samples.iter().cloned().map(|(x, y)| [x, y])); let time_samples = Array2::from(vec); let time_samples = time_samples.t(); - let corr = time_samples.pearson_correlation()[[1, 0]]; + let corr = time_samples.pearson_correlation().expect("no time samples given")[[1, 0]]; (corr, corr < super::ACCEPTANCE_CORRELATION) } From 71cdadf03b2d2df38d620f48e30af4ac479e2aa2 Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Fri, 16 Aug 2024 02:12:37 +0300 Subject: [PATCH 006/180] fuzzer: correct source code path --- fuzzer/src/literals.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fuzzer/src/literals.rs b/fuzzer/src/literals.rs index 0db656f8..b601d7a3 100644 --- a/fuzzer/src/literals.rs +++ b/fuzzer/src/literals.rs @@ -17,7 +17,7 @@ use walkdir::WalkDir; pub fn get() -> Vec> { // Get relevant literals from pulldown-cmark's source code. // See documentaiton of `literals`-module for more information. - let walkdir = WalkDir::new("../src") + let walkdir = WalkDir::new("../pulldown-cmark/src") .into_iter() .filter_map(|e| e.ok()) .filter(|e| e.file_type().is_file()) @@ -31,7 +31,10 @@ pub fn get() -> Vec> { let mut literal_parser = LiteralParser::new(); - let skipped_files = &[Path::new("../src/entities.rs"), Path::new("../src/main.rs")]; + let skipped_files = &[ + Path::new("../pulldown-cmark/src/entities.rs"), + Path::new("../pulldown-cmark/src/main.rs"), + ]; for file in walkdir { if skipped_files.contains(&file.path()) { continue; From 82f811d57f9cc73b2bce83ee0979b3f3c8a03079 Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Fri, 16 Aug 2024 02:14:36 +0300 Subject: [PATCH 007/180] fuzzer: rewrite literal parser with syn::visit syn had to be updated to support new Rust syntax, and the update would have necessiated a lot of changes to the literal parser anyway. I switched to the visitor pattern (syn::visit) which should reduce unnecessary code needed only for traversing the AST. --- fuzzer/src/literals.rs | 324 +++++++++-------------------------------- 1 file changed, 67 insertions(+), 257 deletions(-) diff --git a/fuzzer/src/literals.rs b/fuzzer/src/literals.rs index b601d7a3..5192bb96 100644 --- a/fuzzer/src/literals.rs +++ b/fuzzer/src/literals.rs @@ -2,7 +2,7 @@ use std::collections::HashSet; use std::fs; use std::path::Path; -use syn::{Expr, ExprArray, ExprCall, ExprMethodCall, ExprTuple, ImplItem, Item, Lit, Pat, Stmt}; +use syn::{visit::Visit, Lit}; use walkdir::WalkDir; /// Get all relevant literals from pulldown-cmark to generate fuzzing input from. @@ -87,87 +87,19 @@ impl LiteralParser { let path = path.as_ref(); let content = fs::read_to_string(path).expect(&format!("unable to read file {:?}", path)); let parsed = syn::parse_file(&content).expect(&format!("unable to parse file {:?}", path)); - self.extract_literals_from_items(parsed.items); - } - - fn extract_literals_from_items(&mut self, items: Vec) { - for item in items { - self.extract_literals_from_item(item); - } - } - - fn extract_literals_from_item(&mut self, item: Item) { - match item { - Item::ExternCrate(_) - | Item::Use(_) - | Item::ForeignMod(_) - | Item::Type(_) - | Item::Existential(_) - | Item::Struct(_) - | Item::Enum(_) - | Item::Union(_) - | Item::Trait(_) - | Item::TraitAlias(_) - | Item::Verbatim(_) => (), - Item::Static(item) => { - self.in_static = true; - self.extract_literals_from_expr(*item.expr); - self.in_static = false; - } - Item::Const(item) => { - self.in_const = true; - self.extract_literals_from_expr(*item.expr); - self.in_const = false; - } - Item::Fn(item) => self.extract_literals_from_stmts(item.block.stmts), - Item::Mod(item) => { - if let Some((_, item)) = item.content { - self.extract_literals_from_items(item); - } - } - Item::Impl(item) => self.extract_literals_from_impl(item.items), - Item::Macro(_) => (), - Item::Macro2(_) => unimplemented!("macros 2.0"), - } - } - - fn extract_literals_from_stmts(&mut self, stmts: Vec) { - for stmt in stmts { - match stmt { - Stmt::Local(local) => { - if let Some((_, expr)) = local.init { - self.extract_literals_from_expr(*expr); - } - } - Stmt::Item(item) => self.extract_literals_from_item(item), - Stmt::Expr(expr) | Stmt::Semi(expr, _) => self.extract_literals_from_expr(expr), - } - } - } - - fn extract_literals_from_impl(&mut self, items: Vec) { - for item in items { - match item { - ImplItem::Const(item) => { - self.in_const = true; - self.extract_literals_from_expr(item.expr); - self.in_const = false; - } - ImplItem::Method(item) => self.extract_literals_from_stmts(item.block.stmts), - ImplItem::Type(_) | ImplItem::Existential(_) => (), - ImplItem::Macro(_) => (), - ImplItem::Verbatim(_) => unimplemented!("ImplItem::Verbatim"), - } - } + self.visit_file(&parsed); } +} - fn extract_literals_from_lit(&mut self, lit: Lit) { +impl<'ast> Visit<'ast> for LiteralParser { + fn visit_lit(&mut self, lit: &'ast Lit) { if self.condition_depth == 0 && !self.in_static && !self.in_const { return; } match lit { Lit::Str(s) => drop(self.literals.insert(s.value().into_bytes())), Lit::ByteStr(s) => drop(self.literals.insert(s.value())), + Lit::CStr(s) => drop(self.literals.insert(s.value().into_bytes())), Lit::Byte(b) => drop(self.literals.insert(vec![b.value()])), Lit::Char(c) => { let c = c.value(); @@ -175,195 +107,73 @@ impl LiteralParser { c.encode_utf8(&mut v); self.literals.insert(v); } - Lit::Int(_) | Lit::Float(_) | Lit::Bool(_) | Lit::Verbatim(_) => (), + _ => (), } } - fn extract_literals_from_expr(&mut self, expr: Expr) { - match expr { - Expr::Box(expr) => self.extract_literals_from_expr(*expr.expr), - Expr::InPlace(expr) => self.extract_literals_from_expr(*expr.value), - Expr::Array(ExprArray { elems, .. }) => { - // If an array is used, we assume that all elements are equal. - // For example in `if ["foo", "bar"].contains(baz) {` it's enough to just extract the - // first element to cover that branch. - if let Some(elem) = elems.into_iter().next() { - self.extract_literals_from_expr(elem); - } - } - Expr::Tuple(ExprTuple { elems, .. }) => { - for expr in elems { - self.extract_literals_from_expr(expr); - } - } - Expr::Call(ExprCall { func, args, .. }) - | Expr::MethodCall(ExprMethodCall { - args, - receiver: func, - .. - }) => { - self.extract_literals_from_expr(*func); - for arg in args { - self.extract_literals_from_expr(arg); - } - } - Expr::Binary(expr) => { - self.extract_literals_from_expr(*expr.left); - self.extract_literals_from_expr(*expr.right); - } - Expr::Unary(expr) => self.extract_literals_from_expr(*expr.expr), - Expr::Lit(expr) => self.extract_literals_from_lit(expr.lit), - Expr::Cast(_) => (), - Expr::Type(expr) => self.extract_literals_from_expr(*expr.expr), - Expr::Let(expr) => { - self.condition_depth += 1; - for pat in expr.pats { - self.extract_literals_from_pat(pat); - } - self.condition_depth -= 1; - self.extract_literals_from_expr(*expr.expr) - } - Expr::If(expr) => { - self.condition_depth += 1; - self.extract_literals_from_expr(*expr.cond); - self.condition_depth -= 1; - self.extract_literals_from_stmts(expr.then_branch.stmts); - if let Some((_, expr)) = expr.else_branch { - self.extract_literals_from_expr(*expr) - } - } - Expr::While(expr) => { - self.condition_depth += 1; - self.extract_literals_from_expr(*expr.cond); - self.condition_depth -= 1; - self.extract_literals_from_stmts(expr.body.stmts); - } - Expr::ForLoop(expr) => { - self.condition_depth += 1; - self.extract_literals_from_expr(*expr.expr); - self.condition_depth -= 1; - self.extract_literals_from_stmts(expr.body.stmts); - } - Expr::Loop(expr) => self.extract_literals_from_stmts(expr.body.stmts), - Expr::Match(arm) => { - self.condition_depth += 1; - self.extract_literals_from_expr(*arm.expr); - self.condition_depth -= 1; - for arm in arm.arms { - self.condition_depth += 1; - for pat in arm.pats { - self.extract_literals_from_pat(pat); - } - if let Some((_, guard)) = arm.guard { - self.extract_literals_from_expr(*guard); - } - self.condition_depth -= 1; - self.extract_literals_from_expr(*arm.body); - } - } - // TODO: are closure argument patterns relevant? - Expr::Closure(expr) => self.extract_literals_from_expr(*expr.body), - Expr::Unsafe(expr) => self.extract_literals_from_stmts(expr.block.stmts), - Expr::Block(expr) => self.extract_literals_from_stmts(expr.block.stmts), - Expr::Assign(expr) => { - self.extract_literals_from_expr(*expr.left); - self.extract_literals_from_expr(*expr.right); - } - Expr::AssignOp(expr) => { - self.extract_literals_from_expr(*expr.left); - self.extract_literals_from_expr(*expr.right); - } - Expr::Field(expr) => self.extract_literals_from_expr(*expr.base), - Expr::Index(expr) => { - self.extract_literals_from_expr(*expr.expr); - self.extract_literals_from_expr(*expr.index); - } - // from is enough as we can trigger that range with the beginning - Expr::Range(expr) => { - if let Some(val) = expr.from.or(expr.to) { - self.extract_literals_from_expr(*val); - } - } - Expr::Path(_) => (), - Expr::Reference(expr) => self.extract_literals_from_expr(*expr.expr), - Expr::Break(expr) => { - if let Some(expr) = expr.expr { - self.extract_literals_from_expr(*expr); - } - } - Expr::Continue(_) => (), - Expr::Return(expr) => { - if let Some(expr) = expr.expr { - self.extract_literals_from_expr(*expr); - } - } - Expr::Macro(_) => (), - Expr::Struct(expr) => { - for field in expr.fields { - self.extract_literals_from_expr(field.expr); - } - if let Some(expr) = expr.rest { - self.extract_literals_from_expr(*expr); - } - } - Expr::Repeat(expr) => { - self.extract_literals_from_expr(*expr.expr); - self.extract_literals_from_expr(*expr.len); - } - Expr::Paren(expr) => self.extract_literals_from_expr(*expr.expr), - Expr::Group(expr) => self.extract_literals_from_expr(*expr.expr), - Expr::Try(expr) => self.extract_literals_from_expr(*expr.expr), - Expr::Async(expr) => self.extract_literals_from_stmts(expr.block.stmts), - Expr::TryBlock(expr) => self.extract_literals_from_stmts(expr.block.stmts), - Expr::Yield(expr) => { - if let Some(expr) = expr.expr { - self.extract_literals_from_expr(*expr); - } - } - Expr::Verbatim(_) => unimplemented!("Expr::Verbatim"), + fn visit_item_static(&mut self, item: &'ast syn::ItemStatic) { + self.in_static = true; + syn::visit::visit_item_static(self, item); + self.in_static = false; + } + + fn visit_item_const(&mut self, item: &'ast syn::ItemConst) { + self.in_const = true; + syn::visit::visit_item_const(self, item); + self.in_const = false; + } + + fn visit_expr_if(&mut self, expr: &'ast syn::ExprIf) { + self.condition_depth += 1; + self.visit_expr(&*expr.cond); + self.condition_depth -= 1; + self.visit_block(&expr.then_branch); + if let Some((_, branch)) = &expr.else_branch { + self.visit_expr(&*branch); } } - fn extract_literals_from_pat(&mut self, pat: Pat) { - match pat { - Pat::Wild(_) | Pat::Path(_) => (), - Pat::Ident(pat) => { - if let Some((_, pat)) = pat.subpat { - self.extract_literals_from_pat(*pat); - } - } - Pat::Struct(pat) => { - for pat in pat.fields { - self.extract_literals_from_pat(*pat.pat); - } - } - Pat::TupleStruct(pat) => { - for pat in pat.pat.front.into_iter().chain(pat.pat.back) { - self.extract_literals_from_pat(pat); - } - } - Pat::Tuple(pat) => { - for pat in pat.front.into_iter().chain(pat.back) { - self.extract_literals_from_pat(pat); - } - } - Pat::Box(pat) => self.extract_literals_from_pat(*pat.pat), - Pat::Ref(pat) => self.extract_literals_from_pat(*pat.pat), - Pat::Lit(pat) => self.extract_literals_from_expr(*pat.expr), - // handling lo is enough as we can trigger that pattern with the lo element already - Pat::Range(pat) => self.extract_literals_from_expr(*pat.lo), - Pat::Slice(pat) => { - let pats_iter = pat - .front - .into_iter() - .chain(pat.middle.map(|pat| *pat)) - .chain(pat.back); - for pat in pats_iter { - self.extract_literals_from_pat(pat); - } - } - Pat::Macro(_) => (), - Pat::Verbatim(_) => unimplemented!("Pat::Verbatim"), + fn visit_expr_while(&mut self, expr: &'ast syn::ExprWhile) { + self.condition_depth += 1; + self.visit_expr(&*expr.cond); + self.condition_depth -= 1; + self.visit_block(&expr.body); + } + + fn visit_expr_for_loop(&mut self, expr: &'ast syn::ExprForLoop) { + self.condition_depth += 1; + self.visit_expr(&*expr.expr); + self.condition_depth -= 1; + self.visit_block(&expr.body); + } + + fn visit_expr_match(&mut self, expr: &'ast syn::ExprMatch) { + self.condition_depth += 1; + self.visit_expr(&*expr.expr); + self.condition_depth -= 1; + for it in &expr.arms { + self.visit_arm(it); } } + + fn visit_arm(&mut self, arm: &'ast syn::Arm) { + self.visit_pat(&arm.pat); + self.condition_depth += 1; + if let Some((_, guard)) = &arm.guard { + self.visit_expr(guard); + } + self.condition_depth -= 1; + self.visit_expr(&*arm.body); + } + + fn visit_pat(&mut self, pat: &'ast syn::Pat) { + // Covers let-else patterns etc. + self.condition_depth += 1; + syn::visit::visit_pat(self, pat); + self.condition_depth -= 1; + } + + fn visit_attribute(&mut self, _attr: &'ast syn::Attribute) { + // Ignore attributes, e.g. doc comments + } } From 629d77e1117edcdbf20c66b0a282d6466e59d9c5 Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Fri, 16 Aug 2024 02:22:29 +0300 Subject: [PATCH 008/180] fuzzer: permit \n --- fuzzer/src/literals.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuzzer/src/literals.rs b/fuzzer/src/literals.rs index 5192bb96..66464c2d 100644 --- a/fuzzer/src/literals.rs +++ b/fuzzer/src/literals.rs @@ -57,7 +57,7 @@ pub fn get() -> Vec> { literals .into_iter() - .filter(|lit| !lit.contains(&b'\n')) + .filter(|lit| !lit.contains(&b'\n') || lit.len() == 1) .filter(|lit| !lit.is_empty()) .collect() } From 75cf80e7e53f53dca844390e4c16a5b33e5a7d90 Mon Sep 17 00:00:00 2001 From: Martin1887 Date: Fri, 16 Aug 2024 18:15:55 +0200 Subject: [PATCH 009/180] chore: update dependencies --- Cargo.lock | 191 ++++++++++++++++++++++++++++------------------------- 1 file changed, 101 insertions(+), 90 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index db591279..5f9cf602 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,9 +19,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstyle" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "autocfg" @@ -40,9 +40,9 @@ dependencies = [ [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bumpalo" @@ -91,18 +91,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.4" +version = "4.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" dependencies = [ "anstyle", "clap_lex", @@ -110,9 +110,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "criterion" @@ -171,9 +171,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -183,9 +183,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "either" -version = "1.11.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "getopts" @@ -208,19 +208,19 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.9" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" [[package]] name = "is-terminal" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" dependencies = [ "hermit-abi", "libc", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -240,36 +240,36 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.154" +version = "0.2.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" +checksum = "a5f43f184355eefb8d17fc948dbecf6c13be3c141f20d834ae842193a448c72a" [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "num-traits" @@ -288,15 +288,15 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oorandom" -version = "11.1.3" +version = "11.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" +checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" [[package]] name = "plotters" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" +checksum = "a15b6eccb8484002195a3e44fe65a4ce8e93a625797a063735536fd59cb01cf3" dependencies = [ "num-traits", "plotters-backend", @@ -307,24 +307,24 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" +checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7" [[package]] name = "plotters-svg" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" +checksum = "81b30686a7d9c3e010b84284bdd26a29f2138574f52f5eb6f794fc0ad924e705" dependencies = [ "plotters-backend", ] [[package]] name = "proc-macro2" -version = "1.0.82" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -388,9 +388,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.4" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", @@ -400,9 +400,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", @@ -411,9 +411,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "ryu" @@ -432,18 +432,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.202" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" +checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.202" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" +checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" dependencies = [ "proc-macro2", "quote", @@ -452,20 +452,21 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] name = "syn" -version = "2.0.63" +version = "2.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf5be731623ca1a1fb7d8be6f261a3be6d3e2337b8a1f97be944d020c8fcb704" +checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" dependencies = [ "proc-macro2", "quote", @@ -499,15 +500,15 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-width" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "walkdir" @@ -521,19 +522,20 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", @@ -546,9 +548,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -556,9 +558,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", @@ -569,15 +571,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", @@ -585,11 +587,11 @@ dependencies = [ [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -601,11 +603,20 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -619,48 +630,48 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" From 5390c88584d7bfff548121816c737aa570f3518e Mon Sep 17 00:00:00 2001 From: Martin1887 Date: Fri, 16 Aug 2024 18:20:42 +0200 Subject: [PATCH 010/180] chore: bump version to 0.11.1 --- pulldown-cmark/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pulldown-cmark/Cargo.toml b/pulldown-cmark/Cargo.toml index c6cc6af8..3464b3cf 100644 --- a/pulldown-cmark/Cargo.toml +++ b/pulldown-cmark/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pulldown-cmark" -version = "0.11.0" +version = "0.11.1" authors = [ "Raph Levien ", "Marcus Klaas de Vries ", From ecb2ccd683b6614bbeefd370a211f1da19f9f8cb Mon Sep 17 00:00:00 2001 From: Martin1887 Date: Fri, 16 Aug 2024 18:55:33 +0200 Subject: [PATCH 011/180] fix: missing unused declaration after merge --- Cargo.lock | 2 +- pulldown-cmark/src/firstpass.rs | 71 ++++++++++++++++++++------------- 2 files changed, 45 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5f9cf602..1246d328 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -331,7 +331,7 @@ dependencies = [ [[package]] name = "pulldown-cmark" -version = "0.11.0" +version = "0.11.1" dependencies = [ "bincode", "bitflags", diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 9f0140a3..9a60948e 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -174,24 +174,33 @@ impl<'a, 'b> FirstPass<'a, 'b> { } } } - } else if let Some(( - indent, - child, - item, - )) = self + } else if let Some((indent, child, item)) = self .options .contains(Options::ENABLE_DEFINITION_LIST) - .then(|| + .then(|| { self.tree .cur() .map(|cur| (self.tree[cur].child, &mut self.tree[cur].item)) - ) + }) .flatten() - .filter(|(_, item)| matches!(item, Item { - body: ItemBody::Paragraph | ItemBody::MaybeDefinitionListTitle | ItemBody::DefinitionListDefinition(_), - .. - })) - .and_then(|item| Some((line_start.scan_definition_list_definition_marker()?, item.0, item.1))) + .filter(|(_, item)| { + matches!( + item, + Item { + body: ItemBody::Paragraph + | ItemBody::MaybeDefinitionListTitle + | ItemBody::DefinitionListDefinition(_), + .. + } + ) + }) + .and_then(|item| { + Some(( + line_start.scan_definition_list_definition_marker()?, + item.0, + item.1, + )) + }) { match item.body { ItemBody::Paragraph => { @@ -220,9 +229,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { body: ItemBody::DefinitionListDefinition(indent), }); if let Some(ItemBody::DefinitionList(ref mut is_tight)) = - self.tree - .peek_up() - .map(|cur| &mut self.tree[cur].item.body) + self.tree.peek_up().map(|cur| &mut self.tree[cur].item.body) { if self.last_line_blank { *is_tight = false; @@ -285,8 +292,9 @@ impl<'a, 'b> FirstPass<'a, 'b> { if let Some(node_ix) = self.tree.peek_up() { match &mut self.tree[node_ix].item.body { ItemBody::BlockQuote(..) => (), - ItemBody::ListItem(indent) - | ItemBody::DefinitionListDefinition(indent) if self.begin_list_item.is_some() => { + ItemBody::ListItem(indent) | ItemBody::DefinitionListDefinition(indent) + if self.begin_list_item.is_some() => + { self.last_line_blank = true; // This is a blank list item. // While the list itself can be continued no matter how many blank lines @@ -574,7 +582,9 @@ impl<'a, 'b> FirstPass<'a, 'b> { /// Returns offset of line start after paragraph. fn parse_paragraph(&mut self, start_ix: usize) -> usize { - let body = if let Some(ItemBody::DefinitionList(_)) = self.tree.peek_up().map(|idx| self.tree[idx].item.body) { + let body = if let Some(ItemBody::DefinitionList(_)) = + self.tree.peek_up().map(|idx| self.tree[idx].item.body) + { // blank lines between the previous definition and this one don't count self.last_line_blank = false; ItemBody::MaybeDefinitionListTitle @@ -1500,7 +1510,9 @@ impl<'a, 'b> FirstPass<'a, 'b> { fixup_end_of_definition_list(&mut self.tree, cur_ix); self.begin_list_item = None; } - if let ItemBody::List(true, _, _) | ItemBody::DefinitionList(true) = self.tree[cur_ix].item.body { + if let ItemBody::List(true, _, _) | ItemBody::DefinitionList(true) = + self.tree[cur_ix].item.body + { surgerize_tight_list(&mut self.tree, cur_ix); self.begin_list_item = None; } @@ -1511,13 +1523,17 @@ impl<'a, 'b> FirstPass<'a, 'b> { fn finish_list(&mut self, ix: usize) { self.finish_empty_list_item(); if let Some(node_ix) = self.tree.peek_up() { - if let ItemBody::List(_, _, _) | ItemBody::DefinitionList(_) = self.tree[node_ix].item.body { + if let ItemBody::List(_, _, _) | ItemBody::DefinitionList(_) = + self.tree[node_ix].item.body + { self.pop(ix); } } if self.last_line_blank { if let Some(node_ix) = self.tree.peek_grandparent() { - if let ItemBody::List(ref mut is_tight, _, _) | ItemBody::DefinitionList(ref mut is_tight) = self.tree[node_ix].item.body { + if let ItemBody::List(ref mut is_tight, _, _) + | ItemBody::DefinitionList(ref mut is_tight) = self.tree[node_ix].item.body + { *is_tight = false; } } @@ -1530,7 +1546,9 @@ impl<'a, 'b> FirstPass<'a, 'b> { if self.last_line_blank { // A list item can begin with at most one blank line. if let Some(node_ix) = self.tree.peek_up() { - if let ItemBody::ListItem(_) | ItemBody::DefinitionListDefinition(_) = self.tree[node_ix].item.body { + if let ItemBody::ListItem(_) | ItemBody::DefinitionListDefinition(_) = + self.tree[node_ix].item.body + { self.pop(begin_list_item); } } @@ -1706,10 +1724,10 @@ impl<'a, 'b> FirstPass<'a, 'b> { if self.options.has_gfm_footnotes() { i += scan_whitespace_no_nl(&bytes[i..]); } - self.allocs.footdefs.0.insert( - UniCase::new(label.clone()), - FootnoteDef { use_count: 0 }, - ); + self.allocs + .footdefs + .0 + .insert(UniCase::new(label.clone()), FootnoteDef { use_count: 0 }); self.tree.append(Item { start, end: 0, // will get set later @@ -1952,7 +1970,6 @@ impl<'a, 'b> FirstPass<'a, 'b> { /// Checks whether we should break a paragraph on the given input. fn scan_paragraph_interrupt(&self, bytes: &[u8], current_container: bool) -> bool { - let gfm_footnote = self.options.has_gfm_footnotes(); if scan_paragraph_interrupt_no_table( bytes, current_container, From 72c022a27c7483078514a6a229475b9ccd5f0d0a Mon Sep 17 00:00:00 2001 From: Martin1887 Date: Fri, 16 Aug 2024 19:33:01 +0200 Subject: [PATCH 012/180] fix: revert TagEnd::BlockQuote kind to avoid breaking change --- Cargo.lock | 2 +- pulldown-cmark/src/html.rs | 2 +- pulldown-cmark/src/lib.rs | 4 ++-- pulldown-cmark/src/parse.rs | 31 +++++++++++++++++++------------ 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5f9cf602..1246d328 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -331,7 +331,7 @@ dependencies = [ [[package]] name = "pulldown-cmark" -version = "0.11.0" +version = "0.11.1" dependencies = [ "bincode", "bitflags", diff --git a/pulldown-cmark/src/html.rs b/pulldown-cmark/src/html.rs index 587ecba2..54005bdc 100644 --- a/pulldown-cmark/src/html.rs +++ b/pulldown-cmark/src/html.rs @@ -399,7 +399,7 @@ where } self.table_cell_index += 1; } - TagEnd::BlockQuote(_) => { + TagEnd::BlockQuote => { self.write("\n")?; } TagEnd::CodeBlock => { diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index 2fac8320..5300ef4d 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -219,7 +219,7 @@ impl<'a> Tag<'a> { match self { Tag::Paragraph => TagEnd::Paragraph, Tag::Heading { level, .. } => TagEnd::Heading(*level), - Tag::BlockQuote(kind) => TagEnd::BlockQuote(*kind), + Tag::BlockQuote(_) => TagEnd::BlockQuote, Tag::CodeBlock(_) => TagEnd::CodeBlock, Tag::HtmlBlock => TagEnd::HtmlBlock, Tag::List(number) => TagEnd::List(number.is_some()), @@ -246,7 +246,7 @@ pub enum TagEnd { Paragraph, Heading(HeadingLevel), - BlockQuote(Option), + BlockQuote, CodeBlock, HtmlBlock, diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 7705bdc5..d3fc9a6e 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -467,7 +467,9 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { ) }); if !invalid && delim_brace_context == brace_context { - if (!is_display && can_close) || (is_display && delim_is_display) { + if (!is_display && can_close) + || (is_display && delim_is_display) + { // This will skip ahead past everything we // just inserted. Needed for correctness to // ensure that a new scan is done after this item. @@ -676,7 +678,9 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { RefScan::LinkLabel(l, end_ix) => { Some((ReferenceLabel::Link(l), end_ix)) } - RefScan::Collapsed(..) | RefScan::Failed | RefScan::UnexpectedFootnote => { + RefScan::Collapsed(..) + | RefScan::Failed + | RefScan::UnexpectedFootnote => { // No label? maybe it is a shortcut reference let label_start = self.tree[tos.node].item.end - 1; let label_end = self.tree[cur_ix].item.end; @@ -718,8 +722,10 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { self.tree[tos.node].child = None; self.tree[tos.node].item.body = ItemBody::SynthesizeChar('!'); - self.tree[cur_ix].item.start = self.tree[tos.node].item.start + 1; - self.tree[tos.node].item.end = self.tree[tos.node].item.start + 1; + self.tree[cur_ix].item.start = + self.tree[tos.node].item.start + 1; + self.tree[tos.node].item.end = + self.tree[tos.node].item.start + 1; cur_ix } else { tos.node @@ -1709,11 +1715,10 @@ impl MathDelims { ix: TreeIndex, can_close: bool, ) { - self.inner.entry(brace_context).or_default().push_back(( - ix, - can_close, - delim_is_display, - )); + self.inner + .entry(brace_context) + .or_default() + .push_back((ix, can_close, delim_is_display)); } fn is_populated(&self) -> bool { @@ -2029,7 +2034,7 @@ fn body_to_tag_end(body: &ItemBody) -> TagEnd { ItemBody::Image(..) => TagEnd::Image, ItemBody::Heading(level, _) => TagEnd::Heading(level), ItemBody::IndentCodeBlock | ItemBody::FencedCodeBlock(..) => TagEnd::CodeBlock, - ItemBody::BlockQuote(kind) => TagEnd::BlockQuote(kind), + ItemBody::BlockQuote(..) => TagEnd::BlockQuote, ItemBody::HtmlBlock => TagEnd::HtmlBlock, ItemBody::List(_, c, _) => { let is_ordered = c == b'.' || c == b')'; @@ -2331,12 +2336,14 @@ mod test { _ => { immediately_before_footnote = Some((ev, range)); None - }, + } }) .next() .unwrap(); assert_eq!(13..17, range); - if let (Event::Text(exclamation), range_exclamation) = immediately_before_footnote.as_ref().unwrap() { + if let (Event::Text(exclamation), range_exclamation) = + immediately_before_footnote.as_ref().unwrap() + { assert_eq!("!", &exclamation[..]); assert_eq!(&(12..13), range_exclamation); } else { From f13b82f3945367958d109966ad7bca75ab8d8a90 Mon Sep 17 00:00:00 2001 From: Martin1887 Date: Fri, 16 Aug 2024 19:33:36 +0200 Subject: [PATCH 013/180] chore: bump version to 0.11.2 --- pulldown-cmark/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pulldown-cmark/Cargo.toml b/pulldown-cmark/Cargo.toml index 3464b3cf..8664f243 100644 --- a/pulldown-cmark/Cargo.toml +++ b/pulldown-cmark/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pulldown-cmark" -version = "0.11.1" +version = "0.11.2" authors = [ "Raph Levien ", "Marcus Klaas de Vries ", From 943116b827fcb83b795185d88f4e70562b2fbace Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Fri, 16 Aug 2024 23:35:56 +0300 Subject: [PATCH 014/180] Rename superlinear fuzzer to dos-fuzzer Disambiguates from the libfuzzer-based fuzzing under "fuzz". --- .github/workflows/rust.yml | 2 +- {fuzzer => dos-fuzzer}/.gitignore | 0 {fuzzer => dos-fuzzer}/Cargo.lock | 16 ++++++++-------- {fuzzer => dos-fuzzer}/Cargo.toml | 2 +- {fuzzer => dos-fuzzer}/README.md | 3 +++ {fuzzer => dos-fuzzer}/group-panics | 0 {fuzzer => dos-fuzzer}/plot | 0 {fuzzer => dos-fuzzer}/retest-output | 0 dos-fuzzer/run | 4 ++++ {fuzzer => dos-fuzzer}/src/black_box.rs | 0 {fuzzer => dos-fuzzer}/src/clock.rs | 0 {fuzzer => dos-fuzzer}/src/literals.rs | 0 {fuzzer => dos-fuzzer}/src/main.rs | 0 {fuzzer => dos-fuzzer}/src/scoring.rs | 0 fuzzer/run | 4 ---- 15 files changed, 17 insertions(+), 14 deletions(-) rename {fuzzer => dos-fuzzer}/.gitignore (100%) rename {fuzzer => dos-fuzzer}/Cargo.lock (99%) rename {fuzzer => dos-fuzzer}/Cargo.toml (96%) rename {fuzzer => dos-fuzzer}/README.md (94%) rename {fuzzer => dos-fuzzer}/group-panics (100%) rename {fuzzer => dos-fuzzer}/plot (100%) rename {fuzzer => dos-fuzzer}/retest-output (100%) create mode 100755 dos-fuzzer/run rename {fuzzer => dos-fuzzer}/src/black_box.rs (100%) rename {fuzzer => dos-fuzzer}/src/clock.rs (100%) rename {fuzzer => dos-fuzzer}/src/literals.rs (100%) rename {fuzzer => dos-fuzzer}/src/main.rs (100%) rename {fuzzer => dos-fuzzer}/src/scoring.rs (100%) delete mode 100755 fuzzer/run diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 52b11892..27af6b79 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -49,7 +49,7 @@ jobs: working-directory: pulldown-cmark run: rustup default stable - name: Test for superlinear time regressions - working-directory: fuzzer + working-directory: dos-fuzzer run: cargo run --release -- --regressions - name: Check benchmarks are not broken working-directory: bench diff --git a/fuzzer/.gitignore b/dos-fuzzer/.gitignore similarity index 100% rename from fuzzer/.gitignore rename to dos-fuzzer/.gitignore diff --git a/fuzzer/Cargo.lock b/dos-fuzzer/Cargo.lock similarity index 99% rename from fuzzer/Cargo.lock rename to dos-fuzzer/Cargo.lock index 54c2e0fc..64463205 100644 --- a/fuzzer/Cargo.lock +++ b/dos-fuzzer/Cargo.lock @@ -128,13 +128,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "fuzzer" +name = "dos-fuzzer" version = "0.1.0" dependencies = [ "clap", @@ -153,6 +147,12 @@ dependencies = [ "walkdir", ] +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + [[package]] name = "getopts" version = "0.2.21" @@ -338,7 +338,7 @@ dependencies = [ [[package]] name = "pulldown-cmark" -version = "0.11.0" +version = "0.11.2" dependencies = [ "bitflags", "getopts", diff --git a/fuzzer/Cargo.toml b/dos-fuzzer/Cargo.toml similarity index 96% rename from fuzzer/Cargo.toml rename to dos-fuzzer/Cargo.toml index 491472c4..772d1116 100644 --- a/fuzzer/Cargo.toml +++ b/dos-fuzzer/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "fuzzer" +name = "dos-fuzzer" version = "0.1.0" authors = ["oberien "] edition = "2018" diff --git a/fuzzer/README.md b/dos-fuzzer/README.md similarity index 94% rename from fuzzer/README.md rename to dos-fuzzer/README.md index ed60879a..14ac9fce 100644 --- a/fuzzer/README.md +++ b/dos-fuzzer/README.md @@ -1,6 +1,9 @@ # Fuzzer for detecting superlinear growth in pulldown-cmark This fuzzer tries to find superlinear growth in pulldown-cmark wrt. input length. +Patterns that exhibit superlinear (e.g. quadratic) growth can potentially be +used for denial-of-service attacks, or cause slow parsing even in normal use. + The general approach is to parse the source code of pulldown-cmark, extract literals which are used in branching code (if-conditions, match patterns, match guards, …) and add some manually. diff --git a/fuzzer/group-panics b/dos-fuzzer/group-panics similarity index 100% rename from fuzzer/group-panics rename to dos-fuzzer/group-panics diff --git a/fuzzer/plot b/dos-fuzzer/plot similarity index 100% rename from fuzzer/plot rename to dos-fuzzer/plot diff --git a/fuzzer/retest-output b/dos-fuzzer/retest-output similarity index 100% rename from fuzzer/retest-output rename to dos-fuzzer/retest-output diff --git a/dos-fuzzer/run b/dos-fuzzer/run new file mode 100755 index 00000000..9cfd59cc --- /dev/null +++ b/dos-fuzzer/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -euo pipefail +cargo rustc --release -- -C target-cpu=native +sudo nice -n -20 env RUST_BACKTRACE=1 ./target/release/dos-fuzzer 2>&1 | tee -a output diff --git a/fuzzer/src/black_box.rs b/dos-fuzzer/src/black_box.rs similarity index 100% rename from fuzzer/src/black_box.rs rename to dos-fuzzer/src/black_box.rs diff --git a/fuzzer/src/clock.rs b/dos-fuzzer/src/clock.rs similarity index 100% rename from fuzzer/src/clock.rs rename to dos-fuzzer/src/clock.rs diff --git a/fuzzer/src/literals.rs b/dos-fuzzer/src/literals.rs similarity index 100% rename from fuzzer/src/literals.rs rename to dos-fuzzer/src/literals.rs diff --git a/fuzzer/src/main.rs b/dos-fuzzer/src/main.rs similarity index 100% rename from fuzzer/src/main.rs rename to dos-fuzzer/src/main.rs diff --git a/fuzzer/src/scoring.rs b/dos-fuzzer/src/scoring.rs similarity index 100% rename from fuzzer/src/scoring.rs rename to dos-fuzzer/src/scoring.rs diff --git a/fuzzer/run b/fuzzer/run deleted file mode 100755 index cd19ca44..00000000 --- a/fuzzer/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -cargo rustc --release -- -C target-cpu=native -sudo nice -n -20 env RUST_BACKTRACE=1 ./target/release/fuzzer 2>&1 | tee -a output From a7b20e69f62cb84724cc33c8a6c0a3d479aca8e7 Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Fri, 16 Aug 2024 23:37:37 +0300 Subject: [PATCH 015/180] chore: bump version in Cargo.lock Unclear if this is a problem for the released crate or tag. Probably not a big deal. --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 1246d328..8cd1519c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -331,7 +331,7 @@ dependencies = [ [[package]] name = "pulldown-cmark" -version = "0.11.1" +version = "0.11.2" dependencies = [ "bincode", "bitflags", From 8de2cded389797131c203f5f63eaf3cdc51bfc23 Mon Sep 17 00:00:00 2001 From: Martin1887 Date: Sat, 17 Aug 2024 10:25:01 +0200 Subject: [PATCH 016/180] feat: re-add kind for BlockQuote in TagEnd --- pulldown-cmark/src/html.rs | 2 +- pulldown-cmark/src/lib.rs | 4 ++-- pulldown-cmark/src/parse.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pulldown-cmark/src/html.rs b/pulldown-cmark/src/html.rs index 85609095..c0bb508d 100644 --- a/pulldown-cmark/src/html.rs +++ b/pulldown-cmark/src/html.rs @@ -420,7 +420,7 @@ where } self.table_cell_index += 1; } - TagEnd::BlockQuote => { + TagEnd::BlockQuote(_) => { self.write("\n")?; } TagEnd::CodeBlock => { diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index b8acc243..d7e045ed 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -223,7 +223,7 @@ impl<'a> Tag<'a> { match self { Tag::Paragraph => TagEnd::Paragraph, Tag::Heading { level, .. } => TagEnd::Heading(*level), - Tag::BlockQuote(_) => TagEnd::BlockQuote, + Tag::BlockQuote(kind) => TagEnd::BlockQuote(*kind), Tag::CodeBlock(_) => TagEnd::CodeBlock, Tag::HtmlBlock => TagEnd::HtmlBlock, Tag::List(number) => TagEnd::List(number.is_some()), @@ -253,7 +253,7 @@ pub enum TagEnd { Paragraph, Heading(HeadingLevel), - BlockQuote, + BlockQuote(Option), CodeBlock, HtmlBlock, diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index d32d4fe6..0fa58648 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -2049,7 +2049,7 @@ fn body_to_tag_end(body: &ItemBody) -> TagEnd { ItemBody::Image(..) => TagEnd::Image, ItemBody::Heading(level, _) => TagEnd::Heading(level), ItemBody::IndentCodeBlock | ItemBody::FencedCodeBlock(..) => TagEnd::CodeBlock, - ItemBody::BlockQuote(..) => TagEnd::BlockQuote, + ItemBody::BlockQuote(kind) => TagEnd::BlockQuote(kind), ItemBody::HtmlBlock => TagEnd::HtmlBlock, ItemBody::List(_, c, _) => { let is_ordered = c == b'.' || c == b')'; From d2e049b959ed5993b3dbba468f64864bfef9e695 Mon Sep 17 00:00:00 2001 From: Martin1887 Date: Sat, 17 Aug 2024 10:28:51 +0200 Subject: [PATCH 017/180] chore: bump version to 0.12.0 --- pulldown-cmark/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pulldown-cmark/Cargo.toml b/pulldown-cmark/Cargo.toml index 8664f243..30728524 100644 --- a/pulldown-cmark/Cargo.toml +++ b/pulldown-cmark/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pulldown-cmark" -version = "0.11.2" +version = "0.12.0" authors = [ "Raph Levien ", "Marcus Klaas de Vries ", From ecf248d8ed6559ea322ed624fb5240f5fbc187ee Mon Sep 17 00:00:00 2001 From: Martin1887 Date: Sat, 17 Aug 2024 10:37:48 +0200 Subject: [PATCH 018/180] chore: update version in Cargo.lock --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 8cd1519c..1e3e40dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -331,7 +331,7 @@ dependencies = [ [[package]] name = "pulldown-cmark" -version = "0.11.2" +version = "0.12.0" dependencies = [ "bincode", "bitflags", From df4c8adb1251b7c2c445d2de8c541201bdb6ec7e Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Sun, 18 Aug 2024 19:22:59 -0700 Subject: [PATCH 019/180] Fix O(n**2) comment parser --- dos-fuzzer/src/main.rs | 2 ++ pulldown-cmark/src/parse.rs | 1 + pulldown-cmark/src/scanners.rs | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dos-fuzzer/src/main.rs b/dos-fuzzer/src/main.rs index 5d67c466..07e6b29e 100644 --- a/dos-fuzzer/src/main.rs +++ b/dos-fuzzer/src/main.rs @@ -227,6 +227,8 @@ fn regression_test() -> i32 { check_pattern("a***".into()); check_pattern("[[]()".into()); check_pattern("[a](<".into()); + // https://github.com/pulldown-cmark/pulldown-cmark/issues/934 + check_pattern("!-- <".into()); exit_code } diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 0fa58648..b1a460a8 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -1940,6 +1940,7 @@ pub(crate) struct HtmlScanGuard { pub cdata: usize, pub processing: usize, pub declaration: usize, + pub comment: usize, } /// Trait for broken link callbacks. diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index 160d1c8c..11d78e5c 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -1426,7 +1426,7 @@ pub(crate) fn scan_inline_html_comment( match c { // An HTML comment consists of ``, ``, or ``, and `-->`. - b'-' => { + b'-' if ix > scan_guard.comment => { // HTML comment needs two hyphens after the !. if *bytes.get(ix)? != b'-' { return None; @@ -1442,6 +1442,7 @@ pub(crate) fn scan_inline_html_comment( while let Some(x) = memchr(b'-', &bytes[ix..]) { ix += x + 1; + scan_guard.comment = ix; if scan_ch(&bytes[ix..], b'-') == 1 && scan_ch(&bytes[ix + 1..], b'>') == 1 { return Some(ix + 2); } From 13cf238766b7ca138947e4cb7571e0685dc6cc1d Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Tue, 20 Aug 2024 12:20:55 -0700 Subject: [PATCH 020/180] impl From for String This matches the corresponding Cow impl that was stabilized in Rust 1.14: https://doc.rust-lang.org/std/string/struct.String.html#impl-From%3CCow%3C'a,+str%3E%3E-for-String --- pulldown-cmark/src/strings.rs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/pulldown-cmark/src/strings.rs b/pulldown-cmark/src/strings.rs index dfab44b0..62964358 100644 --- a/pulldown-cmark/src/strings.rs +++ b/pulldown-cmark/src/strings.rs @@ -224,6 +224,16 @@ impl<'a> From> for CowStr<'a> { } } +impl<'a> From> for String { + fn from(s: CowStr<'a>) -> Self { + match s { + CowStr::Boxed(s) => s.into(), + CowStr::Inlined(s) => s.as_ref().into(), + CowStr::Borrowed(s) => s.into(), + } + } +} + impl<'a> Deref for CowStr<'a> { type Target = str; @@ -366,6 +376,28 @@ mod test_special_string { assert!(variant_eq(&actual, &expected)); } + #[test] + fn cow_str_to_string() { + let s = "some text"; + let cow_str = CowStr::Borrowed(s); + let actual = String::from(cow_str); + let expected = String::from("some text"); + assert_eq!(actual, expected); + + let s = "s"; + let inline_str: InlineStr = InlineStr::try_from(s).unwrap(); + let cow_str = CowStr::Inlined(inline_str); + let actual = String::from(cow_str); + let expected = String::from("s"); + assert_eq!(actual, expected); + + let s = "s"; + let cow_str = CowStr::Boxed(s.to_string().into_boxed_str()); + let actual = String::from(cow_str); + let expected = String::from("s"); + assert_eq!(actual, expected); + } + #[test] fn cow_char_to_cow_str() { let c = 'c'; From ef02734f9742548b5b9ab833692b952c5233734a Mon Sep 17 00:00:00 2001 From: Darkhan Kubigenov Date: Fri, 30 Aug 2024 23:39:09 +0100 Subject: [PATCH 021/180] Make dos-fuzzer part of the workspace Using the same workspace enables reusing same deps and sharing cache between members. It also has better editor support. --- Cargo.lock | 305 +++++++++++++++++++- Cargo.toml | 3 +- dos-fuzzer/Cargo.lock | 631 ------------------------------------------ dos-fuzzer/Cargo.toml | 8 +- dos-fuzzer/run | 2 +- 5 files changed, 308 insertions(+), 641 deletions(-) delete mode 100644 dos-fuzzer/Cargo.lock diff --git a/Cargo.lock b/Cargo.lock index 1e3e40dc..42517f25 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,12 +17,55 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" +[[package]] +name = "anstream" +version = "0.6.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + [[package]] name = "anstyle" version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +[[package]] +name = "anstyle-parse" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "autocfg" version = "1.3.0" @@ -50,6 +93,12 @@ version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + [[package]] name = "cast" version = "0.3.0" @@ -96,6 +145,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" dependencies = [ "clap_builder", + "clap_derive", ] [[package]] @@ -104,8 +154,22 @@ version = "4.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" dependencies = [ + "anstream", "anstyle", "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -114,6 +178,12 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +[[package]] +name = "colorchoice" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" + [[package]] name = "criterion" version = "0.5.1" @@ -181,6 +251,26 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "dos-fuzzer" +version = "0.1.0" +dependencies = [ + "clap", + "crossbeam-utils", + "itertools", + "libc", + "ndarray", + "ndarray-stats", + "num_cpus", + "pulldown-cmark", + "rand", + "rand_xoshiro", + "serde", + "serde_json", + "syn", + "walkdir", +] + [[package]] name = "either" version = "1.13.0" @@ -196,6 +286,17 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + [[package]] name = "half" version = "2.4.1" @@ -206,23 +307,57 @@ dependencies = [ "crunchy", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + [[package]] name = "hermit-abi" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", +] + [[package]] name = "is-terminal" version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" dependencies = [ - "hermit-abi", + "hermit-abi 0.4.0", "libc", "windows-sys 0.52.0", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + [[package]] name = "itertools" version = "0.10.5" @@ -265,12 +400,77 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +[[package]] +name = "matrixmultiply" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9380b911e3e96d10c1f415da0876389aaf1b56759054eeb0de7df940c456ba1a" +dependencies = [ + "autocfg", + "rawpointer", +] + [[package]] name = "memchr" version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "ndarray" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" +dependencies = [ + "matrixmultiply", + "num-complex", + "num-integer", + "num-traits", + "rawpointer", +] + +[[package]] +name = "ndarray-stats" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af5a8477ac96877b5bd1fd67e0c28736c12943aba24eda92b127e036b0c8f400" +dependencies = [ + "indexmap", + "itertools", + "ndarray", + "noisy_float", + "num-integer", + "num-traits", + "rand", +] + +[[package]] +name = "noisy_float" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978fe6e6ebc0bf53de533cd456ca2d9de13de13856eda1518a285d7705a213af" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -280,6 +480,16 @@ dependencies = [ "autocfg", ] +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi 0.3.9", + "libc", +] + [[package]] name = "once_cell" version = "1.19.0" @@ -320,6 +530,15 @@ dependencies = [ "plotters-backend", ] +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + [[package]] name = "proc-macro2" version = "1.0.86" @@ -366,6 +585,51 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_xoshiro" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + [[package]] name = "rayon" version = "1.10.0" @@ -462,6 +726,12 @@ dependencies = [ "serde", ] +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "syn" version = "2.0.74" @@ -504,6 +774,12 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + [[package]] name = "version_check" version = "0.9.5" @@ -520,6 +796,12 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + [[package]] name = "wasm-bindgen" version = "0.2.93" @@ -675,3 +957,24 @@ name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml index 310b59a4..dc57b29a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [workspace] -members = ["bench", "pulldown-cmark", "pulldown-cmark-escape"] +default-members = ["bench", "pulldown-cmark", "pulldown-cmark-escape"] +members = ["bench", "dos-fuzzer", "pulldown-cmark", "pulldown-cmark-escape"] resolver = "2" [profile.release] diff --git a/dos-fuzzer/Cargo.lock b/dos-fuzzer/Cargo.lock deleted file mode 100644 index 64463205..00000000 --- a/dos-fuzzer/Cargo.lock +++ /dev/null @@ -1,631 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "anstream" -version = "0.6.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" - -[[package]] -name = "anstyle-parse" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" -dependencies = [ - "anstyle", - "windows-sys 0.52.0", -] - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "clap" -version = "4.5.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d8838454fda655dafd3accb2b6e2bea645b9e4078abe84a22ceb947235c5cc" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.5.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim", -] - -[[package]] -name = "clap_derive" -version = "4.5.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "clap_lex" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" - -[[package]] -name = "colorchoice" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "dos-fuzzer" -version = "0.1.0" -dependencies = [ - "clap", - "crossbeam-utils", - "itertools", - "libc", - "ndarray", - "ndarray-stats", - "num_cpus", - "pulldown-cmark", - "rand", - "rand_xoshiro", - "serde", - "serde_json", - "syn", - "walkdir", -] - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "getopts" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5" -dependencies = [ - "unicode-width", -] - -[[package]] -name = "getrandom" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown", -] - -[[package]] -name = "is_terminal_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "libc" -version = "0.2.156" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5f43f184355eefb8d17fc948dbecf6c13be3c141f20d834ae842193a448c72a" - -[[package]] -name = "matrixmultiply" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9380b911e3e96d10c1f415da0876389aaf1b56759054eeb0de7df940c456ba1a" -dependencies = [ - "autocfg", - "rawpointer", -] - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "ndarray" -version = "0.15.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" -dependencies = [ - "matrixmultiply", - "num-complex", - "num-integer", - "num-traits", - "rawpointer", -] - -[[package]] -name = "ndarray-stats" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af5a8477ac96877b5bd1fd67e0c28736c12943aba24eda92b127e036b0c8f400" -dependencies = [ - "indexmap", - "itertools", - "ndarray", - "noisy_float", - "num-integer", - "num-traits", - "rand", -] - -[[package]] -name = "noisy_float" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978fe6e6ebc0bf53de533cd456ca2d9de13de13856eda1518a285d7705a213af" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "pulldown-cmark" -version = "0.11.2" -dependencies = [ - "bitflags", - "getopts", - "memchr", - "pulldown-cmark-escape", - "unicase", -] - -[[package]] -name = "pulldown-cmark-escape" -version = "0.11.0" - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_xoshiro" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" -dependencies = [ - "rand_core", -] - -[[package]] -name = "rawpointer" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "serde" -version = "1.0.208" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.208" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.125" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "2.0.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicase" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-width" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" - -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "winapi-util" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "byteorder", - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/dos-fuzzer/Cargo.toml b/dos-fuzzer/Cargo.toml index 772d1116..498e4833 100644 --- a/dos-fuzzer/Cargo.toml +++ b/dos-fuzzer/Cargo.toml @@ -2,6 +2,7 @@ name = "dos-fuzzer" version = "0.1.0" authors = ["oberien "] +publish = false edition = "2018" [dependencies] @@ -19,10 +20,3 @@ libc = "0.2" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" clap = { version = "4.3", features = ["derive"] } - -[profile.release] -lto = "fat" - -# Prevent this from interfering with workspaces -[workspace] -members = ["."] diff --git a/dos-fuzzer/run b/dos-fuzzer/run index 9cfd59cc..8ed3faaf 100755 --- a/dos-fuzzer/run +++ b/dos-fuzzer/run @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -euo pipefail cargo rustc --release -- -C target-cpu=native -sudo nice -n -20 env RUST_BACKTRACE=1 ./target/release/dos-fuzzer 2>&1 | tee -a output +sudo nice -n -20 env RUST_BACKTRACE=1 ../target/release/dos-fuzzer 2>&1 | tee -a output From bc0cabf4036518ffae0f8599c747d0004b3c49c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Pozo?= Date: Wed, 4 Sep 2024 17:16:37 +0200 Subject: [PATCH 022/180] chore: ignore devenv files --- .gitignore | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.gitignore b/.gitignore index d913617b..8a1584fb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,15 @@ target +# Devenv +.devenv* +devenv.local.nix + +# direnv +.direnv + +# pre-commit +.pre-commit-config.yaml +.envrc +devenv.nix +devenv.yaml +devenv.lock From c7363b721e05657226a0b0b4768d761b3625769b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Pozo?= Date: Wed, 4 Sep 2024 17:28:07 +0200 Subject: [PATCH 023/180] chore: update deps --- Cargo.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 42517f25..bd6edcb4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -390,9 +390,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.156" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5f43f184355eefb8d17fc948dbecf6c13be3c141f20d834ae842193a448c72a" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "log" @@ -578,9 +578,9 @@ version = "0.11.0" [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -696,18 +696,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" +checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" +checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", @@ -716,9 +716,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.125" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" +checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" dependencies = [ "itoa", "memchr", @@ -734,9 +734,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.74" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", From 65c515906b689e444c719b59e981833082c3c8a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Pozo?= Date: Wed, 4 Sep 2024 17:29:59 +0200 Subject: [PATCH 024/180] chore: bump version to 0.12.1 --- Cargo.lock | 2 +- pulldown-cmark/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bd6edcb4..42e4f6df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -550,7 +550,7 @@ dependencies = [ [[package]] name = "pulldown-cmark" -version = "0.12.0" +version = "0.12.1" dependencies = [ "bincode", "bitflags", diff --git a/pulldown-cmark/Cargo.toml b/pulldown-cmark/Cargo.toml index 30728524..a069dc1f 100644 --- a/pulldown-cmark/Cargo.toml +++ b/pulldown-cmark/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pulldown-cmark" -version = "0.12.0" +version = "0.12.1" authors = [ "Raph Levien ", "Marcus Klaas de Vries ", From c991951bf229f70ab39607d34569208c25bd0c5f Mon Sep 17 00:00:00 2001 From: Darkhan Kubigenov Date: Wed, 4 Sep 2024 23:32:01 +0100 Subject: [PATCH 025/180] Fix compilation error in fuzzers --- fuzz/src/lib.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fuzz/src/lib.rs b/fuzz/src/lib.rs index 9981ff45..bf080da8 100644 --- a/fuzz/src/lib.rs +++ b/fuzz/src/lib.rs @@ -241,9 +241,11 @@ pub fn xml_to_events(xml: &str) -> anyhow::Result> { b"link" => events.push(Event::End(TagEnd::Link)), b"image" => events.push(Event::End(TagEnd::Image)), b"block_quote" => { - block_container_stack.pop().ok_or(anyhow!("List stack empty"))?; - events.push(Event::End(TagEnd::BlockQuote)) - }, + block_container_stack + .pop() + .ok_or(anyhow!("List stack empty"))?; + events.push(Event::End(TagEnd::BlockQuote(None))) + } name => anyhow::bail!("end tag: {}", String::from_utf8_lossy(name)), }, XmlEvent::Text(_) => continue, From f3b582e570817a38982b74af28d399883d69d7eb Mon Sep 17 00:00:00 2001 From: Darkhan Kubigenov Date: Wed, 4 Sep 2024 23:32:31 +0100 Subject: [PATCH 026/180] Reformat code in fuzzers --- fuzz/Cargo.lock | 2 +- fuzz/src/lib.rs | 59 +++++++++++++++++++++++++++++++++++-------------- 2 files changed, 43 insertions(+), 18 deletions(-) diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock index 7f56b3f7..f8565e3f 100644 --- a/fuzz/Cargo.lock +++ b/fuzz/Cargo.lock @@ -349,7 +349,7 @@ dependencies = [ [[package]] name = "pulldown-cmark" -version = "0.11.0" +version = "0.12.1" dependencies = [ "bitflags", "getopts", diff --git a/fuzz/src/lib.rs b/fuzz/src/lib.rs index bf080da8..488a6bb1 100644 --- a/fuzz/src/lib.rs +++ b/fuzz/src/lib.rs @@ -4,13 +4,15 @@ use std::convert::TryInto; use std::ptr; use anyhow::anyhow; -use mozjs::jsapi::{EnterRealm, HandleValueArray, LeaveRealm, JS_NewGlobalObject, OnNewGlobalHookOption}; +use mozjs::conversions::ToJSValConvertible; +use mozjs::jsapi::{ + EnterRealm, HandleValueArray, JS_NewGlobalObject, LeaveRealm, OnNewGlobalHookOption, +}; use mozjs::jsval::UndefinedValue; use mozjs::rooted; +use mozjs::rust::wrappers::JS_CallFunctionName; use mozjs::rust::SIMPLE_GLOBAL_CLASS; use mozjs::rust::{JSEngine, RealmOptions, Runtime}; -use mozjs::rust::wrappers::JS_CallFunctionName; -use mozjs::conversions::ToJSValConvertible; use pulldown_cmark::{CodeBlockKind, Event, LinkType, Parser, Tag, TagEnd}; use quick_xml::escape::unescape; use quick_xml::events::Event as XmlEvent; @@ -56,7 +58,13 @@ pub fn commonmark_js(text: &str) -> anyhow::Result { // These should indicate source location for diagnostics. let filename: &'static str = "commonmark.min.js"; let lineno: u32 = 1; - let res = rt.evaluate_script(global.handle(), COMMONMARK_MIN_JS, filename, lineno, rval.handle_mut()); + let res = rt.evaluate_script( + global.handle(), + COMMONMARK_MIN_JS, + filename, + lineno, + rval.handle_mut(), + ); assert!(res.is_ok()); let filename: &'static str = "{inline}"; @@ -69,7 +77,13 @@ pub fn commonmark_js(text: &str) -> anyhow::Result { } "#; rooted!(in(rt.cx()) let mut render_to_xml = UndefinedValue()); - let res = rt.evaluate_script(global.handle(), script, filename, lineno, render_to_xml.handle_mut()); + let res = rt.evaluate_script( + global.handle(), + script, + filename, + lineno, + render_to_xml.handle_mut(), + ); assert!(res.is_ok()); // rval now contains a reference to the render_to_xml function @@ -89,7 +103,9 @@ pub fn commonmark_js(text: &str) -> anyhow::Result { utf8 }; - unsafe { LeaveRealm(rt.cx(), realm); } + unsafe { + LeaveRealm(rt.cx(), realm); + } Ok(xml) }) @@ -108,7 +124,12 @@ pub fn xml_to_events(xml: &str) -> anyhow::Result> { XmlEvent::Decl(..) | XmlEvent::DocType(..) => continue, XmlEvent::Start(tag) => match tag.name().as_ref() { b"document" => continue, - b"paragraph" if block_container_stack.last().map(|(_start, tight)| *tight).unwrap_or(false) => { + b"paragraph" + if block_container_stack + .last() + .map(|(_start, tight)| *tight) + .unwrap_or(false) => + { continue; } b"paragraph" => events.push(Event::Start(Tag::Paragraph)), @@ -159,9 +180,7 @@ pub fn xml_to_events(xml: &str) -> anyhow::Result> { None => events.push(Event::Start(Tag::List(None))), }; let tight = match tag.try_get_attribute("tight") { - Ok(Some(value)) if value.unescape_value()? == "true" => { - true - } + Ok(Some(value)) if value.unescape_value()? == "true" => true, _ => false, }; block_container_stack.push((start.is_some(), tight)); @@ -206,7 +225,7 @@ pub fn xml_to_events(xml: &str) -> anyhow::Result> { b"block_quote" => { block_container_stack.push((true, false)); events.push(Event::Start(Tag::BlockQuote(None))) - }, + } b"html_block" => { events.push(Event::Start(Tag::HtmlBlock)); events.push(Event::Html( @@ -215,7 +234,7 @@ pub fn xml_to_events(xml: &str) -> anyhow::Result> { .into(), )); events.push(Event::End(TagEnd::HtmlBlock)); - }, + } b"html_inline" => events.push(Event::InlineHtml( unescape(&reader.read_text(tag.to_end().name())?)? .into_owned() @@ -225,7 +244,12 @@ pub fn xml_to_events(xml: &str) -> anyhow::Result> { }, XmlEvent::End(tag) => match tag.name().as_ref() { b"document" => continue, - b"paragraph" if block_container_stack.last().map(|(_numbered, tight)| *tight).unwrap_or(false) => { + b"paragraph" + if block_container_stack + .last() + .map(|(_numbered, tight)| *tight) + .unwrap_or(false) => + { continue; } b"paragraph" => events.push(Event::End(TagEnd::Paragraph)), @@ -233,7 +257,10 @@ pub fn xml_to_events(xml: &str) -> anyhow::Result> { heading_stack.pop().ok_or(anyhow!("Heading stack empty"))?, ))), b"list" => events.push(Event::End(TagEnd::List( - block_container_stack.pop().ok_or(anyhow!("List stack empty"))?.0, + block_container_stack + .pop() + .ok_or(anyhow!("List stack empty"))? + .0, ))), b"item" => events.push(Event::End(TagEnd::Item)), b"emph" => events.push(Event::End(TagEnd::Emphasis)), @@ -325,9 +352,7 @@ pub fn normalize(events: Vec>) -> Vec> { id: "".into(), // commonmark.js does not record this })), Event::Start(Tag::Link { - dest_url, - title, - .. + dest_url, title, .. }) => Some(Event::Start(Tag::Link { link_type: LinkType::Inline, dest_url: urldecode(&dest_url).into(), From e93826288c9f8e29aeb8d069e5ce6088cd3c3247 Mon Sep 17 00:00:00 2001 From: Darkhan Kubigenov Date: Thu, 5 Sep 2024 08:43:29 +0100 Subject: [PATCH 027/180] Switch to upstream mozjs --- fuzz/Cargo.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index fb2c146c..019dafc1 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -14,7 +14,9 @@ libfuzzer-sys = { version = "0.4", features = ["arbitrary-derive"] } once_cell = "1.18.0" pretty_assertions = "1.3.0" quick-xml = "0.29" -mozjs = { git = "https://github.com/notriddle/mozjs", features = ["streams"] } +mozjs = { git = "https://github.com/servo/mozjs", rev = "d90edd169aae1e16c1ef8b7bd4b2e0d93dda8ba2", features = [ + "streams", +] } urlencoding = "2.1.2" [dependencies.pulldown-cmark] From e279dc25b354868c9041cf2b88a9620eb5e06ecd Mon Sep 17 00:00:00 2001 From: Darkhan Kubigenov Date: Thu, 5 Sep 2024 08:44:07 +0100 Subject: [PATCH 028/180] Make fuzz dir part of the workspace This has the benefit of sharing the build cache and better editor support. Previously it was not possible to do it in `cargo-fuzz` but became possible after https://github.com/rust-fuzz/cargo-fuzz/pull/357. --- Cargo.lock | 1286 ++++++++++++++++++++++++++++++++++++++++++++++- Cargo.toml | 8 +- fuzz/Cargo.lock | 699 -------------------------- fuzz/Cargo.toml | 4 - 4 files changed, 1283 insertions(+), 714 deletions(-) delete mode 100644 fuzz/Cargo.lock diff --git a/Cargo.lock b/Cargo.lock index 42e4f6df..78ebed60 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,12 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "aho-corasick" version = "1.1.3" @@ -66,6 +72,21 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "anyhow" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" + +[[package]] +name = "arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +dependencies = [ + "derive_arbitrary", +] + [[package]] name = "autocfg" version = "1.3.0" @@ -81,6 +102,27 @@ dependencies = [ "serde", ] +[[package]] +name = "bindgen" +version = "0.69.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "itertools", + "lazy_static", + "lazycell", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn", + "which", +] + [[package]] name = "bitflags" version = "2.6.0" @@ -99,12 +141,42 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "calendrical_calculations" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cec493b209a1b81fa32312d7ceca1b547d341c7b5f16a3edbf32b1d8b455bbdf" +dependencies = [ + "core_maths", + "displaydoc", +] + [[package]] name = "cast" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" +[[package]] +name = "cc" +version = "1.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9d013ecb737093c0e86b151a7b837993cf9ec6c502946cfb44bedc392421e0b" +dependencies = [ + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -138,6 +210,17 @@ dependencies = [ "half", ] +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "clap" version = "4.5.16" @@ -184,6 +267,34 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +[[package]] +name = "colored" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" +dependencies = [ + "lazy_static", + "windows-sys 0.48.0", +] + +[[package]] +name = "core_maths" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b02505ccb8c50b0aa21ace0fc08c3e53adebd4e58caa18a36152803c7709a3" +dependencies = [ + "libm", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + [[package]] name = "criterion" version = "0.5.1" @@ -251,6 +362,79 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derive_arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + +[[package]] +name = "diplomat" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3137c640d2bac491dbfca7f9945c948f888dd8c95bdf7ee6b164fbdfa5d3efc2" +dependencies = [ + "diplomat_core", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "diplomat-runtime" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29f9efe348e178ba77b6035bc6629138486f8b461654e7ac7ad8afaa61bd4d98" +dependencies = [ + "log", +] + +[[package]] +name = "diplomat_core" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd7aca1d8f9e7b73ad61785beedc9556ad79f84b15c15abaa7041377e42284c1" +dependencies = [ + "lazy_static", + "proc-macro2", + "quote", + "serde", + "smallvec", + "strck_ident", + "syn", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "dos-fuzzer" version = "0.1.0" @@ -277,6 +461,77 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +[[package]] +name = "encoding_c" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9af727805f3b0d79956bde5b35732669fb5c5d45a94893798e7b7e70cfbf9cc1" +dependencies = [ + "encoding_rs", +] + +[[package]] +name = "encoding_c_mem" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a80a16821fe8c7cab96e0c67b57cd7090e021e9615e6ce6ab0cf866c44ed1f0" +dependencies = [ + "encoding_rs", +] + +[[package]] +name = "encoding_rs" +version = "0.8.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.59.0", +] + +[[package]] +name = "fixed_decimal" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0febbeb1118a9ecdee6e4520ead6b54882e843dd0592ad233247dbee84c53db8" +dependencies = [ + "displaydoc", + "ryu", + "smallvec", + "writeable", +] + +[[package]] +name = "flate2" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + [[package]] name = "getopts" version = "0.2.21" @@ -297,6 +552,12 @@ dependencies = [ "wasi", ] +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "half" version = "2.4.1" @@ -331,6 +592,432 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "icu_calendar" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7265b2137f9a36f7634a308d91f984574bbdba8cfd95ceffe1c345552275a8ff" +dependencies = [ + "calendrical_calculations", + "displaydoc", + "icu_calendar_data", + "icu_locid", + "icu_locid_transform", + "icu_provider", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_calendar_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e009b7f0151ee6fb28c40b1283594397e0b7183820793e9ace3dcd13db126d0" + +[[package]] +name = "icu_capi" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f73a82a8307633c08ca119631cd90b006e448009da2d4466f7d76ca8fedf3b1" +dependencies = [ + "diplomat", + "diplomat-runtime", + "fixed_decimal", + "icu_calendar", + "icu_casemap", + "icu_collator", + "icu_collections", + "icu_datetime", + "icu_decimal", + "icu_experimental", + "icu_list", + "icu_locid", + "icu_locid_transform", + "icu_normalizer", + "icu_plurals", + "icu_properties", + "icu_provider", + "icu_provider_adapters", + "icu_segmenter", + "icu_timezone", + "log", + "simple_logger", + "tinystr", + "unicode-bidi", + "writeable", +] + +[[package]] +name = "icu_casemap" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ff0c8ae9f8d31b12e27fc385ff9ab1f3cd9b17417c665c49e4ec958c37da75f" +dependencies = [ + "displaydoc", + "icu_casemap_data", + "icu_collections", + "icu_locid", + "icu_properties", + "icu_provider", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_casemap_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d57966d5ab748f74513be4046867f9a20e801e2775d41f91d04a0f560b61f08" + +[[package]] +name = "icu_collator" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d370371887d31d56f361c3eaa15743e54f13bc677059c9191c77e099ed6966b2" +dependencies = [ + "displaydoc", + "icu_collator_data", + "icu_collections", + "icu_locid_transform", + "icu_normalizer", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "zerovec", +] + +[[package]] +name = "icu_collator_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ee3f88741364b7d6269cce6827a3e6a8a2cf408a78f766c9224ab479d5e4ae5" + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_datetime" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d115efb85e08df3fd77e77f52e7e087545a783fffba8be80bfa2102f306b1780" +dependencies = [ + "displaydoc", + "either", + "fixed_decimal", + "icu_calendar", + "icu_datetime_data", + "icu_decimal", + "icu_locid", + "icu_locid_transform", + "icu_plurals", + "icu_provider", + "icu_timezone", + "smallvec", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_datetime_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ba7e7f7a01269b9afb0a39eff4f8676f693b55f509b3120e43a0350a9f88bea" + +[[package]] +name = "icu_decimal" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb8fd98f86ec0448d85e1edf8884e4e318bb2e121bd733ec929a05c0a5e8b0eb" +dependencies = [ + "displaydoc", + "fixed_decimal", + "icu_decimal_data", + "icu_locid_transform", + "icu_provider", + "writeable", +] + +[[package]] +name = "icu_decimal_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d424c994071c6f5644f999925fc868c85fec82295326e75ad5017bc94b41523" + +[[package]] +name = "icu_experimental" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "844ad7b682a165c758065d694bc4d74ac67f176da1c499a04d85d492c0f193b7" +dependencies = [ + "displaydoc", + "fixed_decimal", + "icu_collections", + "icu_decimal", + "icu_experimental_data", + "icu_locid", + "icu_locid_transform", + "icu_normalizer", + "icu_pattern", + "icu_plurals", + "icu_properties", + "icu_provider", + "litemap", + "num-bigint", + "num-rational", + "num-traits", + "smallvec", + "tinystr", + "writeable", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_experimental_data" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c178b9a34083fca5bd70d61f647575335e9c197d0f30c38e8ccd187babc69d0" + +[[package]] +name = "icu_list" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbfeda1d7775b6548edd4e8b7562304a559a91ed56ab56e18961a053f367c365" +dependencies = [ + "displaydoc", + "icu_list_data", + "icu_locid_transform", + "icu_provider", + "regex-automata 0.2.0", + "writeable", +] + +[[package]] +name = "icu_list_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1825170d2c6679cb20dbd96a589d034e49f698aed9a2ef4fafc9a0101ed298f" + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_pattern" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7f36aafd098d6717de34e668a8120822275c1fba22b936e757b7de8a2fd7e4" +dependencies = [ + "displaydoc", + "either", + "writeable", + "yoke", + "zerofrom", +] + +[[package]] +name = "icu_plurals" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a70e7c025dbd5c501b0a5c188cd11666a424f0dadcd4f0a95b7dafde3b114" +dependencies = [ + "displaydoc", + "fixed_decimal", + "icu_locid_transform", + "icu_plurals_data", + "icu_provider", + "zerovec", +] + +[[package]] +name = "icu_plurals_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e3e8f775b215d45838814a090a2227247a7431d74e9156407d9c37f6ef0f208" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "unicode-bidi", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "log", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_adapters" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6324dfd08348a8e0374a447ebd334044d766b1839bb8d5ccf2482a99a77c0bc" +dependencies = [ + "icu_locid", + "icu_locid_transform", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "icu_segmenter" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a717725612346ffc2d7b42c94b820db6908048f39434504cb130e8b46256b0de" +dependencies = [ + "core_maths", + "displaydoc", + "icu_collections", + "icu_locid", + "icu_provider", + "icu_segmenter_data", + "utf8_iter", + "zerovec", +] + +[[package]] +name = "icu_segmenter_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f739ee737260d955e330bc83fdeaaf1631f7fb7ed218761d3c04bb13bb7d79df" + +[[package]] +name = "icu_timezone" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa91ba6a585939a020c787235daa8aee856d9bceebd6355e283c0c310bc6de96" +dependencies = [ + "displaydoc", + "icu_calendar", + "icu_provider", + "icu_timezone_data", + "tinystr", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_timezone_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c588878c508a3e2ace333b3c50296053e6483c6a7541251b546cc59dcd6ced8e" + [[package]] name = "indexmap" version = "1.9.3" @@ -373,6 +1060,15 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + [[package]] name = "js-sys" version = "0.3.70" @@ -388,12 +1084,80 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + [[package]] name = "libc" version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +[[package]] +name = "libfuzzer-sys" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a96cfd5557eb82f2b83fed4955246c988d331975a002961b07c81584d107e7f7" +dependencies = [ + "arbitrary", + "cc", + "once_cell", +] + +[[package]] +name = "libloading" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +dependencies = [ + "cfg-if", + "windows-targets 0.52.6", +] + +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags", + "libc", + "redox_syscall", +] + +[[package]] +name = "libz-sys" +version = "1.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + [[package]] name = "log" version = "0.4.22" @@ -416,6 +1180,51 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] + +[[package]] +name = "mozjs" +version = "0.14.1" +source = "git+https://github.com/servo/mozjs?rev=d90edd169aae1e16c1ef8b7bd4b2e0d93dda8ba2#d90edd169aae1e16c1ef8b7bd4b2e0d93dda8ba2" +dependencies = [ + "bindgen", + "cc", + "lazy_static", + "libc", + "log", + "mozjs_sys", +] + +[[package]] +name = "mozjs_sys" +version = "0.128.0-9" +source = "git+https://github.com/servo/mozjs?rev=d90edd169aae1e16c1ef8b7bd4b2e0d93dda8ba2#d90edd169aae1e16c1ef8b7bd4b2e0d93dda8ba2" +dependencies = [ + "bindgen", + "cc", + "encoding_c", + "encoding_c_mem", + "flate2", + "icu_capi", + "libc", + "libz-sys", + "tar", + "walkdir", +] + [[package]] name = "ndarray" version = "0.15.6" @@ -453,6 +1262,26 @@ dependencies = [ "num-traits", ] +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + [[package]] name = "num-complex" version = "0.4.6" @@ -462,6 +1291,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-integer" version = "0.1.46" @@ -471,6 +1306,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -490,6 +1336,15 @@ dependencies = [ "libc", ] +[[package]] +name = "num_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", +] + [[package]] name = "once_cell" version = "1.19.0" @@ -502,6 +1357,12 @@ version = "11.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + [[package]] name = "plotters" version = "0.3.6" @@ -530,6 +1391,12 @@ dependencies = [ "plotters-backend", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.20" @@ -539,6 +1406,16 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "pretty_assertions" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" +dependencies = [ + "diff", + "yansi", +] + [[package]] name = "proc-macro2" version = "1.0.86" @@ -576,6 +1453,29 @@ dependencies = [ name = "pulldown-cmark-escape" version = "0.11.0" +[[package]] +name = "pulldown-cmark-fuzz" +version = "0.0.0" +dependencies = [ + "anyhow", + "libfuzzer-sys", + "mozjs", + "once_cell", + "pretty_assertions", + "pulldown-cmark", + "quick-xml", + "urlencoding", +] + +[[package]] +name = "quick-xml" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81b9228215d82c7b61490fec1de287136b5de6f5700f6e58ea9ad61a7964ca51" +dependencies = [ + "memchr", +] + [[package]] name = "quote" version = "1.0.37" @@ -650,6 +1550,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "redox_syscall" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +dependencies = [ + "bitflags", +] + [[package]] name = "regex" version = "1.10.6" @@ -658,10 +1567,19 @@ checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", - "regex-automata", + "regex-automata 0.4.7", "regex-syntax", ] +[[package]] +name = "regex-automata" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9368763f5a9b804326f3af749e16f9abf378d227bcdee7634b13d8f17793782" +dependencies = [ + "memchr", +] + [[package]] name = "regex-automata" version = "0.4.7" @@ -679,6 +1597,25 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustix" +version = "0.38.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + [[package]] name = "ryu" version = "1.0.18" @@ -726,6 +1663,52 @@ dependencies = [ "serde", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "simple_logger" +version = "4.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e7e46c8c90251d47d08b28b8a419ffb4aede0f87c2eea95e17d1d5bacbf3ef1" +dependencies = [ + "colored", + "log", + "time", + "windows-sys 0.48.0", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "strck" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be91090ded9d8f979d9fe921777342d37e769e0b6b7296843a7a38247240e917" + +[[package]] +name = "strck_ident" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1c3802b169b3858a44667f221c9a0b3136e6019936ea926fc97fbad8af77202" +dependencies = [ + "strck", + "unicode-ident", +] + [[package]] name = "strsim" version = "0.11.1" @@ -743,6 +1726,71 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tar" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb797dad5fb5b76fcf519e702f4a589483b5ef06567f160c392832c1f5e44909" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "itoa", + "libc", + "num-conv", + "num_threads", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinytemplate" version = "1.2.1" @@ -762,6 +1810,12 @@ dependencies = [ "version_check", ] +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + [[package]] name = "unicode-ident" version = "1.0.12" @@ -774,12 +1828,36 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "version_check" version = "0.9.5" @@ -867,6 +1945,18 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + [[package]] name = "winapi-util" version = "0.1.9" @@ -876,13 +1966,22 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", ] [[package]] @@ -891,7 +1990,22 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -900,28 +2014,46 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -934,30 +2066,110 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +dependencies = [ + "either", +] + +[[package]] +name = "xattr" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" +dependencies = [ + "libc", + "linux-raw-sys", + "rustix", +] + +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" + +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -978,3 +2190,57 @@ dependencies = [ "quote", "syn", ] + +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerotrie" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb594dd55d87335c5f60177cee24f19457a5ec10a065e0a3014722ad252d0a1f" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml index dc57b29a..eb48e544 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,12 @@ [workspace] default-members = ["bench", "pulldown-cmark", "pulldown-cmark-escape"] -members = ["bench", "dos-fuzzer", "pulldown-cmark", "pulldown-cmark-escape"] +members = [ + "bench", + "dos-fuzzer", + "fuzz", + "pulldown-cmark", + "pulldown-cmark-escape", +] resolver = "2" [profile.release] diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock deleted file mode 100644 index f8565e3f..00000000 --- a/fuzz/Cargo.lock +++ /dev/null @@ -1,699 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" -dependencies = [ - "memchr", -] - -[[package]] -name = "anyhow" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" - -[[package]] -name = "arbitrary" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" -dependencies = [ - "derive_arbitrary", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bindgen" -version = "0.69.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c69fae65a523209d34240b60abe0c42d33d1045d445c0839d8a4894a736e2d" -dependencies = [ - "bitflags", - "cexpr", - "clang-sys", - "lazy_static", - "lazycell", - "peeking_take_while", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn", - "which", -] - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "cc" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "jobserver", - "libc", -] - -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "clang-sys" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" -dependencies = [ - "glob", - "libc", - "libloading", -] - -[[package]] -name = "derive_arbitrary" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "diff" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "encoding_c" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9af727805f3b0d79956bde5b35732669fb5c5d45a94893798e7b7e70cfbf9cc1" -dependencies = [ - "encoding_rs", -] - -[[package]] -name = "encoding_c_mem" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a80a16821fe8c7cab96e0c67b57cd7090e021e9615e6ce6ab0cf866c44ed1f0" -dependencies = [ - "encoding_rs", -] - -[[package]] -name = "encoding_rs" -version = "0.8.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "errno" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "getopts" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5" -dependencies = [ - "unicode-width", -] - -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "jobserver" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" -dependencies = [ - "libc", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - -[[package]] -name = "libc" -version = "0.2.153" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" - -[[package]] -name = "libfuzzer-sys" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a96cfd5557eb82f2b83fed4955246c988d331975a002961b07c81584d107e7f7" -dependencies = [ - "arbitrary", - "cc", - "once_cell", -] - -[[package]] -name = "libloading" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - -[[package]] -name = "libz-sys" -version = "1.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037731f5d3aaa87a5675e895b63ddff1a87624bc29f77004ea829809654e48f6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "linux-raw-sys" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "memchr" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "mozjs" -version = "0.14.1" -source = "git+https://github.com/notriddle/mozjs#19e9d3b52013e301e433c5580ef49d874f1bbf92" -dependencies = [ - "bindgen", - "cc", - "lazy_static", - "libc", - "log", - "mozjs_sys", - "num-traits", -] - -[[package]] -name = "mozjs_sys" -version = "0.68.2" -source = "git+https://github.com/notriddle/mozjs#19e9d3b52013e301e433c5580ef49d874f1bbf92" -dependencies = [ - "bindgen", - "cc", - "encoding_c", - "encoding_c_mem", - "libc", - "libz-sys", - "walkdir", -] - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - -[[package]] -name = "pkg-config" -version = "0.3.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" - -[[package]] -name = "pretty_assertions" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" -dependencies = [ - "diff", - "yansi", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "pulldown-cmark" -version = "0.12.1" -dependencies = [ - "bitflags", - "getopts", - "memchr", - "pulldown-cmark-escape", - "unicase", -] - -[[package]] -name = "pulldown-cmark-escape" -version = "0.11.0" - -[[package]] -name = "pulldown-cmark-fuzz" -version = "0.0.0" -dependencies = [ - "anyhow", - "libfuzzer-sys", - "mozjs", - "once_cell", - "pretty_assertions", - "pulldown-cmark", - "quick-xml", - "urlencoding", -] - -[[package]] -name = "quick-xml" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b9228215d82c7b61490fec1de287136b5de6f5700f6e58ea9ad61a7964ca51" -dependencies = [ - "memchr", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "regex" -version = "1.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustix" -version = "0.38.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicase" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-width" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" - -[[package]] -name = "urlencoding" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "walkdir" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.0", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" -dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" - -[[package]] -name = "yansi" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 019dafc1..9b39e32d 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -22,10 +22,6 @@ urlencoding = "2.1.2" [dependencies.pulldown-cmark] path = "../pulldown-cmark" -# Prevent this from interfering with workspaces -[workspace] -members = ["."] - [[bin]] name = "parse" path = "fuzz_targets/parse.rs" From cab9e05c019bc32d686be4d5e8e7115b6c2447f0 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Fri, 6 Sep 2024 11:52:34 -0700 Subject: [PATCH 029/180] Add benchmark for giant links --- bench/benches/html_rendering.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bench/benches/html_rendering.rs b/bench/benches/html_rendering.rs index 2f30c3f5..5f047050 100644 --- a/bench/benches/html_rendering.rs +++ b/bench/benches/html_rendering.rs @@ -91,6 +91,16 @@ This is a [link](example.com). **Cool!** b.iter(|| Parser::new_ext(input, Options::empty()).count()); }); + + c.bench_function("inline_link_to_sample", |b| { + let input = r###" + [Playground](https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn+main()+%7B%0A++++let+mut+x+=+Some(42);%0A++++%0A++++let+prev+=+x.take_if(%7Cv%7C+if+*v+==+42+%7B%0A++++++++*v+%2B=+1;%0A++++++++false%0A++++%7D+else+%7B%0A++++++++false%0A++++%7D);%0A++++assert_eq!(x,+Some(43));%0A++++assert_eq!(prev,+None);%0A++++%0A++++let+prev+=+x.take_if(%7Cv%7C+*v+==+43);%0A++++assert_eq!(x,+None);%0A++++assert_eq!(prev,+Some(43));%0A%7D&edition=2021) + [Playground](https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn+main()+%7B%0A++++let+mut+vec+=+Vec::new();%0A++++vec.push(1);%0A++++vec.push(2);%0A++++%0A++++assert_eq!(vec.len(),+2);%0A++++assert_eq!(vec%5B0%5D,+1);%0A++++%0A++++assert_eq!(vec.pop(),+Some(2));%0A++++assert_eq!(vec.len(),+1);%0A++++%0A++++vec%5B0%5D+=+7;%0A++++assert_eq!(vec%5B0%5D,+7);%0A++++%0A++++vec.extend(%5B1,+2,+3%5D);%0A++++%0A++++for+x+in+%26vec+%7B%0A++++++++println!(%22%7Bx%7D%22);%0A++++%7D%0A++++assert_eq!(vec,+%5B7,+1,+2,+3%5D);%0A%7D&edition=2021) + [Playground](https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn+main()+%7B%0A++++let+mut+vec+=+Vec::with_capacity(10);%0A++++%0A++++//+The+vector+contains+no+items,+even+though+it+has+capacity+for+more%0A++++assert_eq!(vec.len(),+0);%0A++++assert!(vec.capacity()+%3E=+10);%0A++++%0A++++//+These+are+all+done+without+reallocating...%0A++++for+i+in+0..10+%7B%0A++++++++vec.push(i);%0A++++%7D%0A++++assert_eq!(vec.len(),+10);%0A++++assert!(vec.capacity()+%3E=+10);%0A++++%0A++++//+...but+this+may+make+the+vector+reallocate%0A++++vec.push(11);%0A++++assert_eq!(vec.len(),+11);%0A++++assert!(vec.capacity()+%3E=+11);%0A++++%0A++++//+A+vector+of+a+zero-sized+type+will+always+over-allocate,+since+no%0A++++//+allocation+is+necessary%0A++++let+vec_units+=+Vec::%3C()%3E::with_capacity(10);%0A++++assert_eq!(vec_units.capacity(),+usize::MAX);%0A%7D&edition=2021) + "###; + + b.iter(|| Parser::new_ext(input, Options::empty()).count()); + }); } criterion_group!(benches, criterion_benchmark); From 28608914f6909f2b012b7bf538946e53383906d6 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Fri, 6 Sep 2024 12:50:29 -0700 Subject: [PATCH 030/180] Fix incorrect CWD for markdown-it benchmarks --- bench/benches/markdown-it.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bench/benches/markdown-it.rs b/bench/benches/markdown-it.rs index 69cbc2a7..4599af8e 100644 --- a/bench/benches/markdown-it.rs +++ b/bench/benches/markdown-it.rs @@ -3,7 +3,7 @@ use pulldown_cmark::{html, Parser}; use std::fs::{read_dir, read_to_string}; pub fn markdown_it_samples(c: &mut Criterion) { - let folder = read_dir("./third_party/markdown-it").unwrap(); + let folder = read_dir("../pulldown-cmark/third_party/markdown-it").unwrap(); for entry in folder { let entry = entry.unwrap(); From 914120c3f827a60a8ce86538980f8275ac151c76 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Fri, 6 Sep 2024 23:51:26 -0700 Subject: [PATCH 031/180] Reuse a couple hash maps across blocks I implemented this change after seeing the RandomState in a flame graph. According to criterion, this seems to make tiny test cases about 2% worse, but makes `lorem1.md` 85% better. --- pulldown-cmark/src/parse.rs | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index b1a460a8..699b17cb 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -192,6 +192,8 @@ pub struct Parser<'input, F = DefaultBrokenLinkCallback> { // used by inline passes. store them here for reuse inline_stack: InlineStack, link_stack: LinkStack, + code_delims: CodeDelims, + math_delims: MathDelims, } impl<'input, F> std::fmt::Debug for Parser<'input, F> { @@ -260,6 +262,8 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { html_scan_guard, // always allow 100KiB link_ref_expansion_limit: text.len().max(100_000), + code_delims: CodeDelims::new(), + math_delims: MathDelims::new(), } } @@ -357,8 +361,6 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { /// the same precedence. It also handles links, even though they have lower /// precedence, because the URL of links must not be processed. fn handle_inline_pass1(&mut self) { - let mut code_delims = CodeDelims::new(); - let mut math_delims = MathDelims::new(); let mut cur = self.tree.cur(); let mut prev = None; @@ -445,10 +447,10 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { ItemBody::MaybeMath(_can_open, _can_close, _brace_context) ) }); - let result = if math_delims.is_populated() { + let result = if self.math_delims.is_populated() { // we have previously scanned all math environment delimiters, // so we can reuse that work - math_delims.find(&self.tree, cur_ix, is_display, brace_context) + self.math_delims.find(&self.tree, cur_ix, is_display, brace_context) } else { // we haven't previously scanned all math delimiters, // so walk the AST @@ -481,7 +483,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { // This will skip ahead past everything we // just inserted. Needed for correctness to // ensure that a new scan is done after this item. - math_delims.clear(); + self.math_delims.clear(); break; } else { // Math cannot contain $, so the current item @@ -489,7 +491,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { invalid = true; } } - math_delims.insert( + self.math_delims.insert( delim_is_display, delim_brace_context, scan_ix, @@ -528,10 +530,10 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { } } - if code_delims.is_populated() { + if self.code_delims.is_populated() { // we have previously scanned all codeblock delimiters, // so we can reuse that work - if let Some(scan_ix) = code_delims.find(cur_ix, search_count) { + if let Some(scan_ix) = self.code_delims.find(cur_ix, search_count) { self.make_code_span(cur_ix, scan_ix, preceded_by_backslash); } else { self.tree[cur_ix].item.body = ItemBody::Text { @@ -552,10 +554,10 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { { if search_count == delim_count { self.make_code_span(cur_ix, scan_ix, preceded_by_backslash); - code_delims.clear(); + self.code_delims.clear(); break; } else { - code_delims.insert(delim_count, scan_ix); + self.code_delims.insert(delim_count, scan_ix); } } if self.tree[scan_ix].item.body.is_block() { @@ -811,6 +813,8 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { cur = self.tree[cur_ix].next; } self.link_stack.clear(); + self.code_delims.clear(); + self.math_delims.clear(); } fn handle_emphasis_and_hard_break(&mut self) { From b564cc8bec3e1c405618858107870e182b116fa0 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Sat, 7 Sep 2024 15:08:17 -0700 Subject: [PATCH 032/180] Reuse outer indent between item list, def list, and blockquote I implemented this change after seeing `scan_space_upto` in a flame graph. According to criterion, this seems to have a small positive effect on most test cases. --- pulldown-cmark/src/firstpass.rs | 35 ++++++++++++++++----------------- pulldown-cmark/src/parse.rs | 4 +++- pulldown-cmark/src/scanners.rs | 13 ++++-------- 3 files changed, 24 insertions(+), 28 deletions(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 9a60948e..cd4fbf86 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -122,33 +122,31 @@ impl<'a, 'b> FirstPass<'a, 'b> { // Process new containers loop { + let save = line_start.clone(); + let outer_indent = line_start.scan_space_upto(4); + if outer_indent >= 4 { + line_start = save; + break; + } if self.options.has_gfm_footnotes() || self.options.contains(Options::ENABLE_OLD_FOOTNOTES) { // Footnote definitions of the form // [^bar]: // * anything really - let save = line_start.clone(); - let indent = line_start.scan_space_upto(4); - if indent < 4 { - let container_start = start_ix + line_start.bytes_scanned(); - if let Some(bytecount) = self.parse_footnote(container_start) { - start_ix = container_start + bytecount; - line_start = LineStart::new(&bytes[start_ix..]); - continue; - } else { - line_start = save; - } - } else { - line_start = save; + let container_start = start_ix + line_start.bytes_scanned(); + if let Some(bytecount) = self.parse_footnote(container_start) { + start_ix = container_start + bytecount; + line_start = LineStart::new(&bytes[start_ix..]); + continue; } } let container_start = start_ix + line_start.bytes_scanned(); - if let Some((ch, index, indent)) = line_start.scan_list_marker() { + if let Some((ch, index, indent)) = line_start.scan_list_marker_with_indent(outer_indent) { let after_marker_index = start_ix + line_start.bytes_scanned(); - self.continue_list(container_start, ch, index); + self.continue_list(container_start - outer_indent, ch, index); self.tree.append(Item { - start: container_start, + start: container_start - outer_indent, end: after_marker_index, // will get updated later if item not empty body: ItemBody::ListItem(indent), }); @@ -196,7 +194,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { }) .and_then(|item| { Some(( - line_start.scan_definition_list_definition_marker()?, + line_start.scan_definition_list_definition_marker_with_indent(outer_indent)?, item.0, item.1, )) @@ -224,7 +222,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { } let after_marker_index = start_ix + line_start.bytes_scanned(); self.tree.append(Item { - start: container_start, + start: container_start - outer_indent, end: after_marker_index, // will get updated later if item not empty body: ItemBody::DefinitionListDefinition(indent), }); @@ -282,6 +280,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { } } } else { + line_start = save; break; } } diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index b1a460a8..23d150cc 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -1296,8 +1296,10 @@ pub(crate) fn scan_containers( for &node_ix in tree.walk_spine() { match tree[node_ix].item.body { ItemBody::BlockQuote(..) => { - // `scan_blockquote_marker` saves & restores internally + let save = line_start.clone(); + let _ = line_start.scan_space(3); if !line_start.scan_blockquote_marker() { + *line_start = save; break; } } diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index 11d78e5c..9bfcf800 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -260,13 +260,10 @@ impl<'a> LineStart<'a> { } pub(crate) fn scan_blockquote_marker(&mut self) -> bool { - let save = self.clone(); - let _ = self.scan_space(3); if self.scan_ch(b'>') { let _ = self.scan_space(1); true } else { - *self = save; false } } @@ -282,10 +279,9 @@ impl<'a> LineStart<'a> { /// /// Return value is the amount of indentation, or `None` if it's not a /// definition list marker. - pub(crate) fn scan_definition_list_definition_marker(&mut self) -> Option { + pub(crate) fn scan_definition_list_definition_marker_with_indent(&mut self, indent: usize) -> Option { let save = self.clone(); - let indent = self.scan_space_upto(4); - if indent < 4 && self.scan_ch(b':') { + if self.scan_ch(b':') { let remaining = 4 - (indent + 1); Some(indent + 1 + self.scan_space_upto(remaining)) } else { @@ -299,10 +295,9 @@ impl<'a> LineStart<'a> { /// Return value is the character, the start index, and the indent in spaces. /// For ordered list markers, the character will be one of b'.' or b')'. For /// bullet list markers, it will be one of b'-', b'+', or b'*'. - pub(crate) fn scan_list_marker(&mut self) -> Option<(u8, u64, usize)> { + pub(crate) fn scan_list_marker_with_indent(&mut self, indent: usize) -> Option<(u8, u64, usize)> { let save = self.clone(); - let indent = self.scan_space_upto(4); - if indent < 4 && self.ix < self.bytes.len() { + if self.ix < self.bytes.len() { let c = self.bytes[self.ix]; if c == b'-' || c == b'+' || c == b'*' { if self.ix >= self.min_hrule_offset { From 84b5eacb014f088e23392c97245c301558dc1ddd Mon Sep 17 00:00:00 2001 From: Darkhan Kubigenov Date: Sun, 8 Sep 2024 13:29:44 +0100 Subject: [PATCH 033/180] Add instructions on fixing fuzz build --- fuzz/README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 fuzz/README.md diff --git a/fuzz/README.md b/fuzz/README.md new file mode 100644 index 00000000..21a17c0d --- /dev/null +++ b/fuzz/README.md @@ -0,0 +1,25 @@ +# Fuzz targets + +This crate specifies fuzzing targets which are +instrumented with [cargo-fuzz](https://github.com/rust-fuzz/cargo-fuzz). + +## Fixing fuzz build issue + +At the moment, building fuzz targets with default settings +(`cargo fuzz build`) throws many errors like this: + +``` +: rust-lld: error: undefined symbol: __sancov_gen_.1094 + >>> referenced by parse.3be71763e9de75d0-cgu.0 + >>> /home/user/projects/pulldown-cmark/target/x86_64-unknown-linux-gnu/release/deps/parse-4bac226fcf249aac.parse.3be71763e9de75d0-cgu.0.rcgu.o:(asan.module_dtor.1168) +``` + +The issue seems to be triggered during linking of the binaries +with default `profile.release.lto=true` set at the workspace `Cargo.toml` +file. + +To fix the build, you can override `lto` config using env variable: + +```bash +$ CARGO_PROFILE_RELEASE_LTO=thin cargo fuzz run parse -- -only_ascii=1 -max_total_time=60 +``` From ff440871732caa8fe65a11fc77ad6d5296cde6ea Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Mon, 9 Sep 2024 10:48:22 -0700 Subject: [PATCH 034/180] Account for definition list fixups while popping containers --- pulldown-cmark/specs/regression.txt | 51 ++++++++++++++++++++ pulldown-cmark/src/firstpass.rs | 2 +- pulldown-cmark/tests/suite/regression.rs | 61 ++++++++++++++++++++++++ 3 files changed, 113 insertions(+), 1 deletion(-) diff --git a/pulldown-cmark/specs/regression.txt b/pulldown-cmark/specs/regression.txt index 7b6cb7fc..cbfde9c0 100644 --- a/pulldown-cmark/specs/regression.txt +++ b/pulldown-cmark/specs/regression.txt @@ -2644,3 +2644,54 @@ ISSUE #655 .

    ```````````````````````````````` + +ISSUE #949 + +```````````````````````````````` example +* def this + : def text def text +. +
      +
    • +
      +
      def this
      +
      def text def text
      +
      +
    • +
    +```````````````````````````````` + +```````````````````````````````` example +* def this + + : def text def text +. +
      +
    • +
      +
      def this
      +

      def text def text

      +
      +
    • +
    +```````````````````````````````` + +```````````````````````````````` example +**A:** + +> B C +> I J :x: K +> :x: L M +> N O _P_ Q R. (S +> T U, V W +> :x:,:x:,:x:, and :x: but no :x: or +> :x:.) +. +

    A:

    +
    B C +I J :x: K
    x: L M +N O P Q R. (S +T U, V W
    +
    x:,:x:,:x:, and :x: but no :x: or
    +
    x:.)
    +```````````````````````````````` diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index cd4fbf86..909c8124 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -75,7 +75,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { while ix < self.text.len() { ix = self.parse_block(ix); } - for _ in 0..self.tree.spine_len() { + while self.tree.spine_len() > 0 { self.pop(ix); } (self.tree, self.allocs) diff --git a/pulldown-cmark/tests/suite/regression.rs b/pulldown-cmark/tests/suite/regression.rs index 14f2833a..d58030d2 100644 --- a/pulldown-cmark/tests/suite/regression.rs +++ b/pulldown-cmark/tests/suite/regression.rs @@ -3153,3 +3153,64 @@ fn regression_test_200() { test_markdown_html(original, expected, false, false, false); } + +#[test] +fn regression_test_201() { + let original = r##"* def this + : def text def text +"##; + let expected = r##"
      +
    • +
      +
      def this
      +
      def text def text
      +
      +
    • +
    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn regression_test_202() { + let original = r##"* def this + + : def text def text +"##; + let expected = r##"
      +
    • +
      +
      def this
      +

      def text def text

      +
      +
    • +
    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn regression_test_203() { + let original = r##"**A:** + +> B C +> I J :x: K +> :x: L M +> N O _P_ Q R. (S +> T U, V W +> :x:,:x:,:x:, and :x: but no :x: or +> :x:.) +"##; + let expected = r##"

    A:

    +
    B C +I J :x: K
    x: L M +N O P Q R. (S +T U, V W
    +
    x:,:x:,:x:, and :x: but no :x: or
    +
    x:.)
    +"##; + + test_markdown_html(original, expected, false, false, false); +} From 6b2b7e79c509d333fb2c531711f1d69119fc9449 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Mon, 9 Sep 2024 18:36:15 -0700 Subject: [PATCH 035/180] Use byte range instead of char count for delim run bounds These are the same, because delims are always ASCII, so it reduces the amount of work spent on UTF-8 decoding. It still needs to check for char boundaries, but does not need to check each one in the middle. --- pulldown-cmark/src/firstpass.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index cd4fbf86..fef0d696 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -2282,7 +2282,7 @@ fn delim_run_can_open( ix: usize, mode: TableParseMode, ) -> bool { - let next_char = if let Some(c) = suffix.chars().nth(run_len) { + let next_char = if let Some(c) = suffix[run_len..].chars().next() { c } else { return false; @@ -2294,28 +2294,28 @@ fn delim_run_can_open( return true; } if mode == TableParseMode::Active { - if s[..ix].ends_with('|') && !s[..ix].ends_with(r"\|") { + if s.as_bytes()[..ix].ends_with(b"|") && !s.as_bytes()[..ix].ends_with(br"\|") { return true; } if next_char == '|' { return false; } } - let delim = suffix.chars().next().unwrap(); + let delim = suffix.bytes().next().unwrap(); // `*` and `~~` can be intraword, `_` and `~` cannot - if delim == '*' && !is_punctuation(next_char) { + if delim == b'*' && !is_punctuation(next_char) { return true; } - if delim == '~' && run_len > 1 { + if delim == b'~' && run_len > 1 { return true; } let prev_char = s[..ix].chars().last().unwrap(); - if delim == '~' && prev_char == '~' && !is_punctuation(next_char) { + if delim == b'~' && prev_char == '~' && !is_punctuation(next_char) { return true; } prev_char.is_whitespace() - || is_punctuation(prev_char) && (delim != '\'' || ![']', ')'].contains(&prev_char)) + || is_punctuation(prev_char) && (delim != b'\'' || ![']', ')'].contains(&prev_char)) } /// Determines whether the delimiter run starting at given index is @@ -2335,25 +2335,25 @@ fn delim_run_can_close( if prev_char.is_whitespace() { return false; } - let next_char = if let Some(c) = suffix.chars().nth(run_len) { + let next_char = if let Some(c) = suffix[run_len..].chars().next() { c } else { return true; }; if mode == TableParseMode::Active { - if s[..ix].ends_with('|') && !s[..ix].ends_with(r"\|") { + if s.as_bytes()[..ix].ends_with(b"|") && !s.as_bytes()[..ix].ends_with(br"\|") { return false; } if next_char == '|' { return true; } } - let delim = suffix.chars().next().unwrap(); + let delim = suffix.bytes().next().unwrap(); // `*` and `~~` can be intraword, `_` and `~` cannot - if (delim == '*' || (delim == '~' && run_len > 1)) && !is_punctuation(prev_char) { + if (delim == b'*' || (delim == b'~' && run_len > 1)) && !is_punctuation(prev_char) { return true; } - if delim == '~' && prev_char == '~' { + if delim == b'~' && prev_char == '~' { return true; } From 8adbe427cd85d20e6500e8bb17e8a537181595b5 Mon Sep 17 00:00:00 2001 From: Darkhan Kubigenov Date: Tue, 10 Sep 2024 00:13:29 +0100 Subject: [PATCH 036/180] Check that `fuzz` and `dos-fuzzer` packages build This enables the build only for `nightly` since fuzzers require `nightly` toolchain. --- .github/workflows/rust.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 27af6b79..b2d5cfc0 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -23,7 +23,11 @@ jobs: - name: Install Rust run: rustup default ${{ matrix.rust-version }} - name: Cargo build + if: ${{ matrix.rust-version != 'nightly' }} run: cargo build --verbose + - name: Cargo build whole workspace + if: ${{ matrix.rust-version == 'nightly' }} + run: cargo build --workspace --verbose - name: Cargo test run: cargo test --verbose - name: Cargo test with simd feature enabled From fc4555d717d86e23d07e4b3a9307c625899749ad Mon Sep 17 00:00:00 2001 From: Darkhan Kubigenov Date: Tue, 10 Sep 2024 00:28:31 +0100 Subject: [PATCH 037/180] Remove redundant CI job `pulldown-cmark-escape` CI job does not do much at the moment. It executes `cargo test` from `pulldown-cmark-escape` directory. Since the package is already a default member of the workspace, all its tests are already executed by `cargo test` call from `pulldown-cmark` job. It does provide `--all` parameter to `cargo test` which is deprecated and an alias to `--workspace`. This parameter executes all tests in default members (already included by `cargo test` in the other job) + non-default packages. The only non-default packages are `fuzz` (has no tests) and `dos-fuzzer` (has several small tests in `scoring.rs`). I moved `--workspace` parameter to the main job. --- .github/workflows/rust.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b2d5cfc0..3b9698cf 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -23,28 +23,24 @@ jobs: - name: Install Rust run: rustup default ${{ matrix.rust-version }} - name: Cargo build - if: ${{ matrix.rust-version != 'nightly' }} + if: ${{ matrix.rust-version == '1.71.1' }} run: cargo build --verbose - - name: Cargo build whole workspace - if: ${{ matrix.rust-version == 'nightly' }} + - name: Cargo build the workspace + if: ${{ matrix.rust-version != '1.71.1' }} run: cargo build --workspace --verbose - name: Cargo test + # dos-fuzzer does not build with old rust version + if: ${{ matrix.rust-version == '1.71.1' }} run: cargo test --verbose + - name: Cargo test the workspace + if: ${{ matrix.rust-version != '1.71.1' }} + run: cargo test --verbose --workspace - name: Cargo test with simd feature enabled run: cargo test --features=simd,gen-tests - name: Cargo test with serde feature enabled run: cargo test --features=serde - name: Cargo test without default features run: cargo test --no-default-features - pulldown-cmark-escape: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Rust - run: rustup default stable - - name: Cargo test - working-directory: pulldown-cmark-escape - run: cargo test --verbose --all regression: runs-on: ubuntu-latest steps: From 8439becd1593df243d5b9e871de342b6f3cf74c6 Mon Sep 17 00:00:00 2001 From: Darkhan Kubigenov Date: Wed, 11 Sep 2024 13:38:57 +0000 Subject: [PATCH 038/180] Make `bench` non-default member of the workspace --- .github/workflows/rust.yml | 3 --- Cargo.toml | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 3b9698cf..8534da5b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -15,9 +15,6 @@ jobs: matrix: rust-version: ['1.71.1', 'stable', 'nightly'] runs-on: ubuntu-latest - defaults: - run: - working-directory: pulldown-cmark steps: - uses: actions/checkout@v4 - name: Install Rust diff --git a/Cargo.toml b/Cargo.toml index eb48e544..8701691e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -default-members = ["bench", "pulldown-cmark", "pulldown-cmark-escape"] +default-members = ["pulldown-cmark", "pulldown-cmark-escape"] members = [ "bench", "dos-fuzzer", From a3f476fbfb1acad4022129aba057280141ef3c8b Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Thu, 12 Sep 2024 12:18:14 -0700 Subject: [PATCH 039/180] Fix a problem that causes multiple dt's to be parsed --- pulldown-cmark/specs/regression.txt | 18 ++++++++++++++++++ pulldown-cmark/src/firstpass.rs | 11 ++++++++--- pulldown-cmark/tests/suite/regression.rs | 22 ++++++++++++++++++++++ 3 files changed, 48 insertions(+), 3 deletions(-) diff --git a/pulldown-cmark/specs/regression.txt b/pulldown-cmark/specs/regression.txt index cbfde9c0..362d1812 100644 --- a/pulldown-cmark/specs/regression.txt +++ b/pulldown-cmark/specs/regression.txt @@ -2695,3 +2695,21 @@ T U, V W
    x:,:x:,:x:, and :x: but no :x: or
    x:.)
    ```````````````````````````````` + +```````````````````````````````` example +[abc] check `foobar_raz` + Some preamble `foobar_raz`, not `barfoo_raz` + :D + + This should fix: + + > Something is wrong! +. +
    +
    [abc] check foobar_raz +Some preamble foobar_raz, not barfoo_raz
    +
    D
    +
    +

    This should fix:

    +

    > Something is wrong!

    +```````````````````````````````` diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index d85a2ac2..25244f9d 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -584,9 +584,14 @@ impl<'a, 'b> FirstPass<'a, 'b> { let body = if let Some(ItemBody::DefinitionList(_)) = self.tree.peek_up().map(|idx| self.tree[idx].item.body) { - // blank lines between the previous definition and this one don't count - self.last_line_blank = false; - ItemBody::MaybeDefinitionListTitle + if self.tree.cur().map_or(true, |idx| matches!(&self.tree[idx].item.body, ItemBody::DefinitionListDefinition(..))) { + // blank lines between the previous definition and this one don't count + self.last_line_blank = false; + ItemBody::MaybeDefinitionListTitle + } else { + self.finish_list(start_ix); + ItemBody::Paragraph + } } else { self.finish_list(start_ix); ItemBody::Paragraph diff --git a/pulldown-cmark/tests/suite/regression.rs b/pulldown-cmark/tests/suite/regression.rs index d58030d2..36119928 100644 --- a/pulldown-cmark/tests/suite/regression.rs +++ b/pulldown-cmark/tests/suite/regression.rs @@ -3214,3 +3214,25 @@ T U, V W test_markdown_html(original, expected, false, false, false); } + +#[test] +fn regression_test_204() { + let original = r##"[abc] check `foobar_raz` + Some preamble `foobar_raz`, not `barfoo_raz` + :D + + This should fix: + + > Something is wrong! +"##; + let expected = r##"
    +
    [abc] check foobar_raz +Some preamble foobar_raz, not barfoo_raz
    +
    D
    +
    +

    This should fix:

    +

    > Something is wrong!

    +"##; + + test_markdown_html(original, expected, false, false, false); +} From b9d9838039b310647863740c0fdcf9668cc301b3 Mon Sep 17 00:00:00 2001 From: rhysd Date: Sun, 22 Sep 2024 21:59:07 +0900 Subject: [PATCH 040/180] fix: emit `InlineHtml` for inline HTML instead of `Html` inside blockquote --- pulldown-cmark/src/parse.rs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 19ffddab..9a6728f2 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -95,7 +95,7 @@ pub(crate) enum ItemBody { HtmlBlock, InlineHtml, Html, - OwnedHtml(CowIndex), + OwnedInlineHtml(CowIndex), BlockQuote(Option), List(bool, u8, u64), // is_tight, list character, list start index ListItem(usize), // indent level @@ -411,7 +411,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { self.tree[cur_ix].item.body = if !span.is_empty() { let converted_string = String::from_utf8(span).expect("invalid utf8"); - ItemBody::OwnedHtml( + ItemBody::OwnedInlineHtml( self.allocs.allocate_cow(converted_string.into()), ) } else { @@ -2085,7 +2085,7 @@ fn item_to_event<'a>(item: Item, text: &'a str, allocs: &mut Allocations<'a>) -> ItemBody::HtmlBlock => Tag::HtmlBlock, ItemBody::Html => return Event::Html(text[item.start..item.end].into()), ItemBody::InlineHtml => return Event::InlineHtml(text[item.start..item.end].into()), - ItemBody::OwnedHtml(cow_ix) => return Event::Html(allocs.take_cow(cow_ix)), + ItemBody::OwnedInlineHtml(cow_ix) => return Event::InlineHtml(allocs.take_cow(cow_ix)), ItemBody::SoftBreak => return Event::SoftBreak, ItemBody::HardBreak(_) => return Event::HardBreak, ItemBody::FootnoteReference(cow_ix) => { @@ -2629,4 +2629,19 @@ text Some(&mut function), ) {} } + + #[test] + fn inline_html_inside_blockquote() { + // Regression for #960 + let input = "> bar>"; + let events: Vec<_> = Parser::new(input).collect(); + let expected = [ + Event::Start(Tag::BlockQuote(None)), + Event::Start(Tag::Paragraph), + Event::InlineHtml(CowStr::Boxed("".to_string().into())), + Event::End(TagEnd::Paragraph), + Event::End(TagEnd::BlockQuote(None)), + ]; + assert_eq!(&events, &expected); + } } From 7429aac29710a42e172901799daf074eacf365d3 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Mon, 23 Sep 2024 10:34:34 -0700 Subject: [PATCH 041/180] Complete the list of block item bodies This fixes a few remaining bugs in tight lists, where you can wind up with block items nested within inlines. The ordering of ItemBody items is designed to have a tight ASM [in godbolt](https://rust.godbolt.org/z/xza85GfG6). --- pulldown-cmark/specs/regression.txt | 13 +++ pulldown-cmark/src/parse.rs | 101 ++++++++++++++--------- pulldown-cmark/tests/suite/regression.rs | 17 ++++ 3 files changed, 91 insertions(+), 40 deletions(-) diff --git a/pulldown-cmark/specs/regression.txt b/pulldown-cmark/specs/regression.txt index 362d1812..44442e66 100644 --- a/pulldown-cmark/specs/regression.txt +++ b/pulldown-cmark/specs/regression.txt @@ -2713,3 +2713,16 @@ Some preamble foobar_raz, not barfoo_raz

    This should fix:

    > Something is wrong!

    ```````````````````````````````` + +```````````````````````````````` example +- Item definition [it + ```rust + ``` + stuff](https://example.com) +. +
      +
    • Item definition [it +
      +stuff](https://example.com)
    • +
    +```````````````````````````````` diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 9a6728f2..161dc62d 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -54,14 +54,6 @@ pub(crate) struct Item { #[derive(Debug, PartialEq, Clone, Copy, Default)] pub(crate) enum ItemBody { - Paragraph, - Text { - backslash_escaped: bool, - }, - SoftBreak, - // true = is backlash - HardBreak(bool), - // These are possible inline items, need to be resolved in second pass. // repeats, can_open, can_close @@ -88,19 +80,33 @@ pub(crate) enum ItemBody { FootnoteReference(CowIndex), TaskListMarker(bool), // true for checked + // These are also inline items. + InlineHtml, + OwnedInlineHtml(CowIndex), + SynthesizeText(CowIndex), + SynthesizeChar(char), + Html, + Text { + backslash_escaped: bool, + }, + SoftBreak, + // true = is backlash + HardBreak(bool), + + // Dummy node at the top of the tree - should not be used otherwise! + #[default] + Root, + + // These are block items. + Paragraph, Rule, Heading(HeadingLevel, Option), // heading level FencedCodeBlock(CowIndex), IndentCodeBlock, HtmlBlock, - InlineHtml, - Html, - OwnedInlineHtml(CowIndex), BlockQuote(Option), List(bool, u8, u64), // is_tight, list character, list start index ListItem(usize), // indent level - SynthesizeText(CowIndex), - SynthesizeChar(char), FootnoteDefinition(CowIndex), MetadataBlock(MetadataBlockKind), @@ -117,42 +123,57 @@ pub(crate) enum ItemBody { TableHead, TableRow, TableCell, - - // Dummy node at the top of the tree - should not be used otherwise! - #[default] - Root, } impl ItemBody { - fn is_inline(&self) -> bool { + fn is_maybe_inline(&self) -> bool { + use ItemBody::*; matches!( *self, - ItemBody::MaybeEmphasis(..) - | ItemBody::MaybeMath(..) - | ItemBody::MaybeSmartQuote(..) - | ItemBody::MaybeHtml - | ItemBody::MaybeCode(..) - | ItemBody::MaybeLinkOpen - | ItemBody::MaybeLinkClose(..) - | ItemBody::MaybeImage + MaybeEmphasis(..) + | MaybeMath(..) + | MaybeSmartQuote(..) + | MaybeCode(..) + | MaybeHtml + | MaybeLinkOpen + | MaybeLinkClose(..) + | MaybeImage ) } - fn is_block(&self) -> bool { + fn is_inline(&self) -> bool { + use ItemBody::*; matches!( *self, - ItemBody::Paragraph - | ItemBody::BlockQuote(..) - | ItemBody::List(..) - | ItemBody::ListItem(..) - | ItemBody::HtmlBlock - | ItemBody::Table(..) - | ItemBody::TableHead - | ItemBody::TableRow - | ItemBody::TableCell - | ItemBody::Heading(..) - | ItemBody::Rule + MaybeEmphasis(..) + | MaybeMath(..) + | MaybeSmartQuote(..) + | MaybeCode(..) + | MaybeHtml + | MaybeLinkOpen + | MaybeLinkClose(..) + | MaybeImage + | Emphasis + | Strong + | Strikethrough + | Math(..) + | Code(..) + | Link(..) + | Image(..) + | FootnoteReference(..) + | TaskListMarker(..) + | InlineHtml + | OwnedInlineHtml(..) + | SynthesizeText(..) + | SynthesizeChar(..) + | Html + | Text { .. } + | SoftBreak + | HardBreak(..) ) } + fn is_block(&self) -> bool { + !self.is_inline() + } } #[derive(Debug)] @@ -2027,7 +2048,7 @@ impl<'a, F: BrokenLinkCallback<'a>> Iterator for OffsetIter<'a, F> { Some((Event::End(tag_end), span)) } Some(cur_ix) => { - if self.inner.tree[cur_ix].item.body.is_inline() { + if self.inner.tree[cur_ix].item.body.is_maybe_inline() { self.inner.handle_inline(); } @@ -2177,7 +2198,7 @@ impl<'a, F: BrokenLinkCallback<'a>> Iterator for Parser<'a, F> { Some(Event::End(tag_end)) } Some(cur_ix) => { - if self.tree[cur_ix].item.body.is_inline() { + if self.tree[cur_ix].item.body.is_maybe_inline() { self.handle_inline(); } diff --git a/pulldown-cmark/tests/suite/regression.rs b/pulldown-cmark/tests/suite/regression.rs index 36119928..9a8b1aa9 100644 --- a/pulldown-cmark/tests/suite/regression.rs +++ b/pulldown-cmark/tests/suite/regression.rs @@ -3236,3 +3236,20 @@ Some preamble foobar_raz, not barfoo_raz test_markdown_html(original, expected, false, false, false); } + +#[test] +fn regression_test_205() { + let original = r##"- Item definition [it + ```rust + ``` + stuff](https://example.com) +"##; + let expected = r##"
      +
    • Item definition [it +
      +stuff](https://example.com)
    • +
    +"##; + + test_markdown_html(original, expected, false, false, false); +} From bc32e1d77dd9403cbcfd6f0c2760d3c6ae2035cc Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Wed, 2 Oct 2024 10:03:53 +0100 Subject: [PATCH 042/180] super and sub script support --- .../examples/parser-map-tag-print.rs | 2 ++ pulldown-cmark/src/firstpass.rs | 8 ++++---- pulldown-cmark/src/html.rs | 8 ++++++++ pulldown-cmark/src/lib.rs | 6 ++++++ pulldown-cmark/src/parse.rs | 16 +++++++++++++-- pulldown-cmark/tests/suite/strikethrough.rs | 20 ++++++++++++++----- 6 files changed, 49 insertions(+), 11 deletions(-) diff --git a/pulldown-cmark/examples/parser-map-tag-print.rs b/pulldown-cmark/examples/parser-map-tag-print.rs index 30b1919e..f827f0c1 100644 --- a/pulldown-cmark/examples/parser-map-tag-print.rs +++ b/pulldown-cmark/examples/parser-map-tag-print.rs @@ -62,6 +62,8 @@ fn main() { ), Tag::Item => println!("Item (this is a list item)"), Tag::Emphasis => println!("Emphasis (this is a span tag)"), + Tag::Superscript => println!("Superscript (this is a span tag)"), + Tag::Subscript => println!("Subscript (this is a span tag)"), Tag::Strong => println!("Strong (this is a span tag)"), Tag::Strikethrough => println!("Strikethrough (this is a span tag)"), Tag::BlockQuote(kind) => println!("BlockQuote ({:?})", kind), diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 89eb3e06..93977452 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -790,7 +790,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { LoopInstruction::ContinueAndSkip(0) } } - c @ b'*' | c @ b'_' | c @ b'~' => { + c @ b'*' | c @ b'_' | c @ b'~' | c @ b'^' => { let string_suffix = &self.text[ix..]; let count = 1 + scan_ch_repeat(&string_suffix.as_bytes()[1..], c); let can_open = delim_run_can_open( @@ -807,7 +807,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { ix - start, mode, ); - let is_valid_seq = c != b'~' || count <= 2; + let is_valid_seq = (c != b'~' || count <= 2) || (c == b'~' && count == 2); if (can_open || can_close) && is_valid_seq { self.tree.append_text(begin_text, ix, backslash_escaped); @@ -2233,7 +2233,7 @@ fn create_lut(options: &Options) -> LookupTable { fn special_bytes(options: &Options) -> [bool; 256] { let mut bytes = [false; 256]; let standard_bytes = [ - b'\n', b'\r', b'*', b'_', b'&', b'\\', b'[', b']', b'<', b'!', b'`', + b'\n', b'\r', b'*', b'_', b'&', b'\\', b'[', b']', b'<', b'!', b'`', b'^', ]; for &byte in &standard_bytes { @@ -2473,7 +2473,7 @@ mod simd { pub(super) fn compute_lookup(options: &Options) -> [u8; 16] { let mut lookup = [0u8; 16]; let standard_bytes = [ - b'\n', b'\r', b'*', b'_', b'&', b'\\', b'[', b']', b'<', b'!', b'`', + b'\n', b'\r', b'*', b'_', b'&', b'\\', b'[', b']', b'<', b'!', b'`', b'^', ]; for &byte in &standard_bytes { diff --git a/pulldown-cmark/src/html.rs b/pulldown-cmark/src/html.rs index 54005bdc..095b74e8 100644 --- a/pulldown-cmark/src/html.rs +++ b/pulldown-cmark/src/html.rs @@ -300,6 +300,8 @@ where self.write("\n
  • ") } } + Tag::Subscript => self.write(""), + Tag::Superscript => self.write(""), Tag::Emphasis => self.write(""), Tag::Strong => self.write(""), Tag::Strikethrough => self.write(""), @@ -417,6 +419,12 @@ where TagEnd::Emphasis => { self.write("")?; } + TagEnd::Superscript => { + self.write("")?; + } + TagEnd::Subscript => { + self.write("")?; + } TagEnd::Strong => { self.write("")?; } diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index 82c28fcd..b1588e5e 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -190,6 +190,8 @@ pub enum Tag<'a> { Emphasis, Strong, Strikethrough, + Superscript, + Subscript, /// A link. Link { @@ -229,6 +231,8 @@ impl<'a> Tag<'a> { Tag::TableHead => TagEnd::TableHead, Tag::TableRow => TagEnd::TableRow, Tag::TableCell => TagEnd::TableCell, + Tag::Subscript => TagEnd::Subscript, + Tag::Superscript => TagEnd::Superscript, Tag::Emphasis => TagEnd::Emphasis, Tag::Strong => TagEnd::Strong, Tag::Strikethrough => TagEnd::Strikethrough, @@ -264,6 +268,8 @@ pub enum TagEnd { Emphasis, Strong, Strikethrough, + Superscript, + Subscript, Link, Image, diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 8fef6657..3f50ca9b 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -81,6 +81,8 @@ pub(crate) enum ItemBody { Emphasis, Strong, Strikethrough, + Superscript, + Subscript, Math(CowIndex, bool), // true for display math Code(CowIndex), Link(LinkIndex), @@ -835,10 +837,16 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { 1 }; let ty = if c == b'~' { - ItemBody::Strikethrough + if inc == 2 { + ItemBody::Strikethrough + } else { + ItemBody::Subscript + } + } else if c == b'^' { + ItemBody::Superscript } else if inc == 2 { ItemBody::Strong - } else { + } else{ ItemBody::Emphasis }; @@ -2023,6 +2031,8 @@ fn body_to_tag_end(body: &ItemBody) -> TagEnd { match *body { ItemBody::Paragraph => TagEnd::Paragraph, ItemBody::Emphasis => TagEnd::Emphasis, + ItemBody::Superscript => TagEnd::Superscript, + ItemBody::Subscript => TagEnd::Subscript, ItemBody::Strong => TagEnd::Strong, ItemBody::Strikethrough => TagEnd::Strikethrough, ItemBody::Link(..) => TagEnd::Link, @@ -2065,6 +2075,8 @@ fn item_to_event<'a>(item: Item, text: &'a str, allocs: &mut Allocations<'a>) -> ItemBody::Rule => return Event::Rule, ItemBody::Paragraph => Tag::Paragraph, ItemBody::Emphasis => Tag::Emphasis, + ItemBody::Superscript => Tag::Superscript, + ItemBody::Subscript => Tag::Subscript, ItemBody::Strong => Tag::Strong, ItemBody::Strikethrough => Tag::Strikethrough, ItemBody::Link(link_ix) => { diff --git a/pulldown-cmark/tests/suite/strikethrough.rs b/pulldown-cmark/tests/suite/strikethrough.rs index a8799a3b..021a4bc3 100644 --- a/pulldown-cmark/tests/suite/strikethrough.rs +++ b/pulldown-cmark/tests/suite/strikethrough.rs @@ -13,6 +13,16 @@ fn strikethrough_test_1() { test_markdown_html(original, expected, false, false, false); } +#[test] +fn strikethrough_test_0() { + let original = r##"^This is super^ ~This is sub~ +"##; + let expected = r##"

    This is super This is sub

    +"##; + + test_markdown_html(original, expected, false, false, false); +} + #[test] fn strikethrough_test_2() { let original = r##"~~This is \~\~stricken~~ @@ -57,7 +67,7 @@ fn strikethrough_test_5() { fn strikethrough_test_6() { let original = r##"~This is stricken out~ "##; - let expected = r##"

    This is stricken out

    + let expected = r##"

    This is stricken out

    "##; test_markdown_html(original, expected, false, false, false); @@ -67,7 +77,7 @@ fn strikethrough_test_6() { fn strikethrough_test_7() { let original = r##"~This is \~stricken~ "##; - let expected = r##"

    This is ~stricken

    + let expected = r##"

    This is ~stricken

    "##; test_markdown_html(original, expected, false, false, false); @@ -87,7 +97,7 @@ fn strikethrough_test_8() { fn strikethrough_test_9() { let original = r##"~This~is~nothing~ "##; - let expected = r##"

    This~is~nothing

    + let expected = r##"

    This~is~nothing

    "##; test_markdown_html(original, expected, false, false, false); @@ -147,7 +157,7 @@ fn strikethrough_test_14() { fn strikethrough_test_15() { let original = r##"~This ~~is stricken.~ "##; - let expected = r##"

    This ~~is stricken.

    + let expected = r##"

    This ~~is stricken.

    "##; test_markdown_html(original, expected, false, false, false); @@ -157,7 +167,7 @@ fn strikethrough_test_15() { fn strikethrough_test_16() { let original = r##"~This ~~is stricken~ but this is not~~ "##; - let expected = r##"

    This ~~is stricken but this is not~~

    + let expected = r##"

    This ~~is stricken but this is not~~

    "##; test_markdown_html(original, expected, false, false, false); From 6a974cfda709a0e1f580ddc5f12694a79fd07dd7 Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Fri, 4 Oct 2024 10:29:38 +0100 Subject: [PATCH 043/180] superscript subscript feature flag --- fuzz/fuzz_targets/parse.rs | 4 ++ pulldown-cmark/src/firstpass.rs | 15 +++-- pulldown-cmark/src/lib.rs | 1 + pulldown-cmark/src/main.rs | 3 + pulldown-cmark/src/parse.rs | 1 + pulldown-cmark/tests/lib.rs | 1 + pulldown-cmark/tests/suite/mod.rs | 1 + pulldown-cmark/tests/suite/strikethrough.rs | 60 ------------------- pulldown-cmark/tests/suite/super_sub.rs | 64 +++++++++++++++++++++ 9 files changed, 86 insertions(+), 64 deletions(-) create mode 100644 pulldown-cmark/tests/suite/super_sub.rs diff --git a/fuzz/fuzz_targets/parse.rs b/fuzz/fuzz_targets/parse.rs index 6f3a7c59..07d7b03b 100644 --- a/fuzz/fuzz_targets/parse.rs +++ b/fuzz/fuzz_targets/parse.rs @@ -33,6 +33,10 @@ fuzz_target!(|data: FuzzingInput<'_>| { opts.insert(Options::ENABLE_STRIKETHROUGH); } + if data.super_sup { + opts.insert(Options::ENABLE_SUPER_SUB); + } + if data.tasklists { opts.insert(Options::ENABLE_TASKLISTS); } diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index e927139c..a191af1b 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -2378,7 +2378,7 @@ fn create_lut(options: &Options) -> LookupTable { fn special_bytes(options: &Options) -> [bool; 256] { let mut bytes = [false; 256]; let standard_bytes = [ - b'\n', b'\r', b'*', b'_', b'&', b'\\', b'[', b']', b'<', b'!', b'`', b'^', + b'\n', b'\r', b'*', b'_', b'&', b'\\', b'[', b']', b'<', b'!', b'`', ]; for &byte in &standard_bytes { @@ -2387,9 +2387,12 @@ fn special_bytes(options: &Options) -> [bool; 256] { if options.contains(Options::ENABLE_TABLES) { bytes[b'|' as usize] = true; } - if options.contains(Options::ENABLE_STRIKETHROUGH) { + if options.contains(Options::ENABLE_STRIKETHROUGH) || options.contains(Options::ENABLE_SUPER_SUB) { bytes[b'~' as usize] = true; } + if options.contains(Options::ENABLE_SUPER_SUB) { + bytes[b'^' as usize] = true; + } if options.contains(Options::ENABLE_MATH) { bytes[b'$' as usize] = true; bytes[b'{' as usize] = true; @@ -2618,7 +2621,7 @@ mod simd { pub(super) fn compute_lookup(options: &Options) -> [u8; 16] { let mut lookup = [0u8; 16]; let standard_bytes = [ - b'\n', b'\r', b'*', b'_', b'&', b'\\', b'[', b']', b'<', b'!', b'`', b'^', + b'\n', b'\r', b'*', b'_', b'&', b'\\', b'[', b']', b'<', b'!', b'`', ]; for &byte in &standard_bytes { @@ -2627,9 +2630,12 @@ mod simd { if options.contains(Options::ENABLE_TABLES) { add_lookup_byte(&mut lookup, b'|'); } - if options.contains(Options::ENABLE_STRIKETHROUGH) { + if options.contains(Options::ENABLE_STRIKETHROUGH) || options.contains(Options::ENABLE_SUPER_SUB) { add_lookup_byte(&mut lookup, b'~'); } + if options.contains(Options::ENABLE_SUPER_SUB) { + add_lookup_byte(&mut lookup, b'^'); + } if options.contains(Options::ENABLE_MATH) { add_lookup_byte(&mut lookup, b'$'); add_lookup_byte(&mut lookup, b'{'); @@ -2785,6 +2791,7 @@ mod simd { opts.insert(Options::ENABLE_TABLES); opts.insert(Options::ENABLE_FOOTNOTES); opts.insert(Options::ENABLE_STRIKETHROUGH); + opts.insert(Options::ENABLE_SUPER_SUB); opts.insert(Options::ENABLE_TASKLISTS); let lut = create_lut(&opts); diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index 4a883103..09ece837 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -517,6 +517,7 @@ bitflags::bitflags! { /// : definition 2 /// ``` const ENABLE_DEFINITION_LIST = 1 << 12; + const ENABLE_SUPER_SUB = 1 << 13; } } diff --git a/pulldown-cmark/src/main.rs b/pulldown-cmark/src/main.rs index 25a6f7df..a10cb7c8 100644 --- a/pulldown-cmark/src/main.rs +++ b/pulldown-cmark/src/main.rs @@ -122,6 +122,9 @@ pub fn main() -> std::io::Result<()> { if matches.opt_present("enable-strikethrough") { opts.insert(Options::ENABLE_STRIKETHROUGH); } + if matches.opt_present("enable-super-sub") { + opts.insert(Options::ENABLE_SUPER_SUB); + } if matches.opt_present("enable-tasklists") { opts.insert(Options::ENABLE_TASKLISTS); } diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 6dde2633..514baeb3 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -2215,6 +2215,7 @@ mod test { opts.insert(Options::ENABLE_TABLES); opts.insert(Options::ENABLE_FOOTNOTES); opts.insert(Options::ENABLE_STRIKETHROUGH); + opts.insert(Options::ENABLE_SUPER_SUB); opts.insert(Options::ENABLE_TASKLISTS); Parser::new_ext(text, opts) diff --git a/pulldown-cmark/tests/lib.rs b/pulldown-cmark/tests/lib.rs index e34cb2a9..8655b139 100644 --- a/pulldown-cmark/tests/lib.rs +++ b/pulldown-cmark/tests/lib.rs @@ -18,6 +18,7 @@ pub fn test_markdown_html( opts.insert(Options::ENABLE_MATH); opts.insert(Options::ENABLE_TABLES); opts.insert(Options::ENABLE_STRIKETHROUGH); + opts.insert(Options::ENABLE_SUPER_SUB); opts.insert(Options::ENABLE_TASKLISTS); opts.insert(Options::ENABLE_GFM); if old_footnotes { diff --git a/pulldown-cmark/tests/suite/mod.rs b/pulldown-cmark/tests/suite/mod.rs index 7a3fd142..090dc71e 100644 --- a/pulldown-cmark/tests/suite/mod.rs +++ b/pulldown-cmark/tests/suite/mod.rs @@ -18,3 +18,4 @@ mod smart_punct; mod spec; mod strikethrough; mod table; +mod super_sub; \ No newline at end of file diff --git a/pulldown-cmark/tests/suite/strikethrough.rs b/pulldown-cmark/tests/suite/strikethrough.rs index 021a4bc3..95cb1e27 100644 --- a/pulldown-cmark/tests/suite/strikethrough.rs +++ b/pulldown-cmark/tests/suite/strikethrough.rs @@ -13,16 +13,6 @@ fn strikethrough_test_1() { test_markdown_html(original, expected, false, false, false); } -#[test] -fn strikethrough_test_0() { - let original = r##"^This is super^ ~This is sub~ -"##; - let expected = r##"

    This is super This is sub

    -"##; - - test_markdown_html(original, expected, false, false, false); -} - #[test] fn strikethrough_test_2() { let original = r##"~~This is \~\~stricken~~ @@ -63,26 +53,6 @@ fn strikethrough_test_5() { test_markdown_html(original, expected, false, false, false); } -#[test] -fn strikethrough_test_6() { - let original = r##"~This is stricken out~ -"##; - let expected = r##"

    This is stricken out

    -"##; - - test_markdown_html(original, expected, false, false, false); -} - -#[test] -fn strikethrough_test_7() { - let original = r##"~This is \~stricken~ -"##; - let expected = r##"

    This is ~stricken

    -"##; - - test_markdown_html(original, expected, false, false, false); -} - #[test] fn strikethrough_test_8() { let original = r##"This~is~nothing @@ -93,16 +63,6 @@ fn strikethrough_test_8() { test_markdown_html(original, expected, false, false, false); } -#[test] -fn strikethrough_test_9() { - let original = r##"~This~is~nothing~ -"##; - let expected = r##"

    This~is~nothing

    -"##; - - test_markdown_html(original, expected, false, false, false); -} - #[test] fn strikethrough_test_10() { let original = r##"Here I fail to strike out an exclamation point~!~. @@ -152,23 +112,3 @@ fn strikethrough_test_14() { test_markdown_html(original, expected, false, false, false); } - -#[test] -fn strikethrough_test_15() { - let original = r##"~This ~~is stricken.~ -"##; - let expected = r##"

    This ~~is stricken.

    -"##; - - test_markdown_html(original, expected, false, false, false); -} - -#[test] -fn strikethrough_test_16() { - let original = r##"~This ~~is stricken~ but this is not~~ -"##; - let expected = r##"

    This ~~is stricken but this is not~~

    -"##; - - test_markdown_html(original, expected, false, false, false); -} diff --git a/pulldown-cmark/tests/suite/super_sub.rs b/pulldown-cmark/tests/suite/super_sub.rs new file mode 100644 index 00000000..ad8027d1 --- /dev/null +++ b/pulldown-cmark/tests/suite/super_sub.rs @@ -0,0 +1,64 @@ +// This file is auto-generated by the build script +// Please, do not modify it manually + +use super::test_markdown_html; + +#[test] +fn super_sub_test_0() { + let original = r##"^This is super^ ~This is sub~ +"##; + let expected = r##"

    This is super This is sub

    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn super_sub_test_6() { + let original = r##"~This is stricken out~ +"##; + let expected = r##"

    This is stricken out

    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn super_sub_test_7() { + let original = r##"~This is \~stricken~ +"##; + let expected = r##"

    This is ~stricken

    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn super_sub_test_9() { + let original = r##"~This~is~nothing~ +"##; + let expected = r##"

    This~is~nothing

    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn super_sub_test_15() { + let original = r##"~This ~~is stricken.~ +"##; + let expected = r##"

    This ~~is stricken.

    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn super_sub_test_16() { + let original = r##"~This ~~is stricken~ but this is not~~ +"##; + let expected = r##"

    This ~~is stricken but this is not~~

    +"##; + + test_markdown_html(original, expected, false, false, false); +} From aee8891583a7087e90b6140266b130048b22fc97 Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Fri, 4 Oct 2024 12:51:48 +0100 Subject: [PATCH 044/180] ensure extensions do not activate unless flag set --- pulldown-cmark/src/parse.rs | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 514baeb3..35bd6009 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -841,8 +841,8 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { let match_count = min(count, el.count); // start, end are tree node indices let mut end = cur_ix - 1; - let mut start = el.start + el.count; - + let mut start = el.start + el.count; + // work from the inside out while start > el.start + el.count - match_count { let inc = if start > el.start + el.count - match_count + 1 { @@ -852,15 +852,27 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { }; let ty = if c == b'~' { if inc == 2 { - ItemBody::Strikethrough + if self.options.contains(Options::ENABLE_STRIKETHROUGH) { + ItemBody::Strikethrough + } else { + ItemBody::Text { backslash_escaped: false } + } } else { - ItemBody::Subscript + if self.options.contains(Options::ENABLE_SUPER_SUB) { + ItemBody::Subscript + } else { + ItemBody::Text { backslash_escaped: false } + } } } else if c == b'^' { - ItemBody::Superscript + if self.options.contains(Options::ENABLE_SUPER_SUB) { + ItemBody::Superscript + } else { + ItemBody::Text { backslash_escaped: false } + } } else if inc == 2 { ItemBody::Strong - } else{ + } else { ItemBody::Emphasis }; From 520b310277f1b919cc0088c2dc27f4f5c0db8700 Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Fri, 4 Oct 2024 18:09:55 +0100 Subject: [PATCH 045/180] typo --- fuzz/fuzz_targets/parse.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuzz/fuzz_targets/parse.rs b/fuzz/fuzz_targets/parse.rs index 07d7b03b..46d83081 100644 --- a/fuzz/fuzz_targets/parse.rs +++ b/fuzz/fuzz_targets/parse.rs @@ -33,7 +33,7 @@ fuzz_target!(|data: FuzzingInput<'_>| { opts.insert(Options::ENABLE_STRIKETHROUGH); } - if data.super_sup { + if data.super_sub { opts.insert(Options::ENABLE_SUPER_SUB); } From 64f51d652a93d758cebaf0d677b199ea787321fc Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Fri, 4 Oct 2024 19:12:06 +0100 Subject: [PATCH 046/180] spec file updates --- pulldown-cmark/specs/strikethrough.txt | 50 +++----------------------- pulldown-cmark/specs/super_sub.txt | 43 ++++++++++++++++++++++ 2 files changed, 47 insertions(+), 46 deletions(-) create mode 100644 pulldown-cmark/specs/super_sub.txt diff --git a/pulldown-cmark/specs/strikethrough.txt b/pulldown-cmark/specs/strikethrough.txt index 73c8df6f..c2ee772e 100644 --- a/pulldown-cmark/specs/strikethrough.txt +++ b/pulldown-cmark/specs/strikethrough.txt @@ -1,6 +1,4 @@ -This is an extension of gfm_strikethrough.txt. Some of these tests are also pulled from commonmark-hs. - -# Two tildes +# Two tilde strikethrough Basic strikethrough is between two tildes: @@ -32,8 +30,7 @@ This~~is~~stricken

    Thisisstricken

    ```````````````````````````````` -Punctuation is ignored for purposes of determining -flankingness on two tildes: +Punctuation is ignored for purposes of determining flankingness on two tildes: ```````````````````````````````` example Here I strike out an exclamation point~~!~~. @@ -41,24 +38,6 @@ Here I strike out an exclamation point~~!~~.

    Here I strike out an exclamation point!.

    ```````````````````````````````` -# One tilde - -One tilde—and this is where we differ from commonmark-hs—is allowed in certain situations: - -```````````````````````````````` example -~This is stricken out~ -. -

    This is stricken out

    -```````````````````````````````` - -Backslash escapes: - -```````````````````````````````` example -~This is \~stricken~ -. -

    This is ~stricken

    -```````````````````````````````` - Intraword strikeout requires two tildes: ```````````````````````````````` example @@ -67,14 +46,7 @@ This~is~nothing

    This~is~nothing

    ```````````````````````````````` -```````````````````````````````` example -~This~is~nothing~ -. -

    This~is~nothing

    -```````````````````````````````` - -Punctuation is used for purposes of determining -flankingness: +Punctuation is used for purposes of determining flankingness: ```````````````````````````````` example Here I fail to strike out an exclamation point~!~. @@ -102,24 +74,10 @@ Here I fail to match up ~tildes~~.

    Here I fail to match up ~tildes~~.

    ```````````````````````````````` -Double tildes are allowed to contain single tildes, and the other way around: +Double tildes are allowed to contain single tildes: ```````````````````````````````` example ~~This ~is stricken.~~ .

    This ~is stricken.

    ```````````````````````````````` - -```````````````````````````````` example -~This ~~is stricken.~ -. -

    This ~~is stricken.

    -```````````````````````````````` - -The first one wins. - -```````````````````````````````` example -~This ~~is stricken~ but this is not~~ -. -

    This ~~is stricken but this is not~~

    -```````````````````````````````` diff --git a/pulldown-cmark/specs/super_sub.txt b/pulldown-cmark/specs/super_sub.txt new file mode 100644 index 00000000..d2eadf69 --- /dev/null +++ b/pulldown-cmark/specs/super_sub.txt @@ -0,0 +1,43 @@ +# Superscript and subscript + +Basic strikethrough is between two tildes: + +```````````````````````````````` example +^This is super^ ~This is sub~ +. +

    This is super This is sub

    +```````````````````````````````` + +```````````````````````````````` example +~This is stricken out~ +. +

    This is stricken out

    +```````````````````````````````` + +Backslash escapes: + +```````````````````````````````` example +~This is \~stricken~ +. +

    This is ~stricken

    +```````````````````````````````` + +```````````````````````````````` example +~This~is~nothing~ +. +

    This~is~nothing

    +```````````````````````````````` + +```````````````````````````````` example +~This ~~is stricken.~ +. +

    This ~~is stricken.

    +```````````````````````````````` + +The first one wins. + +```````````````````````````````` example +~This ~~is stricken~ but this is not~~ +. +

    This ~~is stricken but this is not~~

    +```````````````````````````````` From cdf7beb337bf91e855f692359f6e7db6965be43f Mon Sep 17 00:00:00 2001 From: Gaurav Atreya Date: Sun, 6 Oct 2024 14:37:09 -0400 Subject: [PATCH 047/180] pulldown-cmark: impl into_static for all lifetime based pub type --- pulldown-cmark/src/firstpass.rs | 13 +++-- pulldown-cmark/src/lib.rs | 86 +++++++++++++++++++++++++++++++++ pulldown-cmark/src/linklabel.rs | 12 +++-- pulldown-cmark/src/parse.rs | 13 ++++- pulldown-cmark/src/scanners.rs | 18 +++++-- pulldown-cmark/src/strings.rs | 4 ++ 6 files changed, 136 insertions(+), 10 deletions(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 25244f9d..0038d148 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -142,7 +142,8 @@ impl<'a, 'b> FirstPass<'a, 'b> { } } let container_start = start_ix + line_start.bytes_scanned(); - if let Some((ch, index, indent)) = line_start.scan_list_marker_with_indent(outer_indent) { + if let Some((ch, index, indent)) = line_start.scan_list_marker_with_indent(outer_indent) + { let after_marker_index = start_ix + line_start.bytes_scanned(); self.continue_list(container_start - outer_indent, ch, index); self.tree.append(Item { @@ -194,7 +195,8 @@ impl<'a, 'b> FirstPass<'a, 'b> { }) .and_then(|item| { Some(( - line_start.scan_definition_list_definition_marker_with_indent(outer_indent)?, + line_start + .scan_definition_list_definition_marker_with_indent(outer_indent)?, item.0, item.1, )) @@ -584,7 +586,12 @@ impl<'a, 'b> FirstPass<'a, 'b> { let body = if let Some(ItemBody::DefinitionList(_)) = self.tree.peek_up().map(|idx| self.tree[idx].item.body) { - if self.tree.cur().map_or(true, |idx| matches!(&self.tree[idx].item.body, ItemBody::DefinitionListDefinition(..))) { + if self.tree.cur().map_or(true, |idx| { + matches!( + &self.tree[idx].item.body, + ItemBody::DefinitionListDefinition(..) + ) + }) { // blank lines between the previous definition and this one don't count self.last_line_blank = false; ItemBody::MaybeDefinitionListTitle diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index d7e045ed..6702f825 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -120,6 +120,13 @@ impl<'a> CodeBlockKind<'a> { pub fn is_fenced(&self) -> bool { matches!(*self, CodeBlockKind::Fenced(_)) } + + pub fn into_static(self) -> CodeBlockKind<'static> { + match self { + CodeBlockKind::Indented => CodeBlockKind::Indented, + CodeBlockKind::Fenced(s) => CodeBlockKind::Fenced(s.into_static()), + } + } } /// BlockQuote kind (Note, Tip, Important, Warning, Caution). @@ -244,6 +251,65 @@ impl<'a> Tag<'a> { Tag::DefinitionListDefinition => TagEnd::DefinitionListDefinition, } } + + pub fn into_static(self) -> Tag<'static> { + match self { + Tag::Paragraph => Tag::Paragraph, + Tag::Heading { + level, + id, + classes, + attrs, + } => Tag::Heading { + level, + id: id.map(|s| s.into_static()), + classes: classes.into_iter().map(|s| s.into_static()).collect(), + attrs: attrs + .into_iter() + .map(|(k, v)| (k.into_static(), v.map(|s| s.into_static()))) + .collect(), + }, + Tag::BlockQuote(k) => Tag::BlockQuote(k), + Tag::CodeBlock(kb) => Tag::CodeBlock(kb.into_static()), + Tag::HtmlBlock => Tag::HtmlBlock, + Tag::List(v) => Tag::List(v), + Tag::Item => Tag::Item, + Tag::FootnoteDefinition(a) => Tag::FootnoteDefinition(a.into_static()), + Tag::Table(v) => Tag::Table(v), + Tag::TableHead => Tag::TableHead, + Tag::TableRow => Tag::TableRow, + Tag::TableCell => Tag::TableCell, + Tag::Emphasis => Tag::Emphasis, + Tag::Strong => Tag::Strong, + Tag::Strikethrough => Tag::Strikethrough, + Tag::Link { + link_type, + dest_url, + title, + id, + } => Tag::Link { + link_type, + dest_url: dest_url.into_static(), + title: title.into_static(), + id: id.into_static(), + }, + Tag::Image { + link_type, + dest_url, + title, + id, + } => Tag::Image { + link_type, + dest_url: dest_url.into_static(), + title: title.into_static(), + id: id.into_static(), + }, + Tag::MetadataBlock(v) => Tag::MetadataBlock(v), + Tag::DefinitionList => Tag::DefinitionList, + Tag::DefinitionListTitle => Tag::DefinitionListTitle, + Tag::DefinitionListDefinition => Tag::DefinitionListDefinition, + } + } } /// The end of a `Tag`. @@ -420,6 +486,26 @@ pub enum Event<'a> { TaskListMarker(bool), } +impl<'a> Event<'a> { + pub fn into_static(self) -> Event<'static> { + match self { + Event::Start(t) => Event::Start(t.into_static()), + Event::End(e) => Event::End(e), + Event::Text(s) => Event::Text(s.into_static()), + Event::Code(s) => Event::Code(s.into_static()), + Event::InlineMath(s) => Event::InlineMath(s.into_static()), + Event::DisplayMath(s) => Event::DisplayMath(s.into_static()), + Event::Html(s) => Event::Html(s.into_static()), + Event::InlineHtml(s) => Event::InlineHtml(s.into_static()), + Event::FootnoteReference(s) => Event::FootnoteReference(s.into_static()), + Event::SoftBreak => Event::SoftBreak, + Event::HardBreak => Event::HardBreak, + Event::Rule => Event::Rule, + Event::TaskListMarker(b) => Event::TaskListMarker(b), + } + } +} + /// Table column text alignment. #[derive(Copy, Clone, Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] diff --git a/pulldown-cmark/src/linklabel.rs b/pulldown-cmark/src/linklabel.rs index e6c6fb63..e64859ad 100644 --- a/pulldown-cmark/src/linklabel.rs +++ b/pulldown-cmark/src/linklabel.rs @@ -22,7 +22,7 @@ use unicase::UniCase; -use crate::scanners::{is_ascii_whitespace, scan_eol, is_ascii_punctuation}; +use crate::scanners::{is_ascii_punctuation, is_ascii_whitespace, scan_eol}; use crate::strings::CowStr; #[derive(Debug)] @@ -134,10 +134,16 @@ pub(crate) fn scan_link_label_rest<'t>( text[..ix].trim_matches(asciiws).into() } else { label.push_str(&text[mark..ix]); - while matches!(label.as_bytes().last(), Some(&b' ' | &b'\r' | &b'\n' | &b'\t')) { + while matches!( + label.as_bytes().last(), + Some(&b' ' | &b'\r' | &b'\n' | &b'\t') + ) { label.pop(); } - while matches!(label.as_bytes().first(), Some(&b' ' | &b'\r' | &b'\n' | &b'\t')) { + while matches!( + label.as_bytes().first(), + Some(&b' ' | &b'\r' | &b'\n' | &b'\t') + ) { label.remove(0); } label.into() diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 161dc62d..38de1b6c 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -471,7 +471,8 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { let result = if self.math_delims.is_populated() { // we have previously scanned all math environment delimiters, // so we can reuse that work - self.math_delims.find(&self.tree, cur_ix, is_display, brace_context) + self.math_delims + .find(&self.tree, cur_ix, is_display, brace_context) } else { // we haven't previously scanned all math delimiters, // so walk the AST @@ -1687,6 +1688,16 @@ pub struct LinkDef<'a> { pub span: Range, } +impl<'a> LinkDef<'a> { + pub fn into_static(self) -> LinkDef<'static> { + LinkDef { + dest: self.dest.into_static(), + title: self.title.map(|s| s.into_static()), + span: self.span, + } + } +} + /// Contains the destination URL, title and source span of a reference definition. #[derive(Clone, Debug)] pub struct FootnoteDef { diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index 9bfcf800..ec2e5ec0 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -279,7 +279,10 @@ impl<'a> LineStart<'a> { /// /// Return value is the amount of indentation, or `None` if it's not a /// definition list marker. - pub(crate) fn scan_definition_list_definition_marker_with_indent(&mut self, indent: usize) -> Option { + pub(crate) fn scan_definition_list_definition_marker_with_indent( + &mut self, + indent: usize, + ) -> Option { let save = self.clone(); if self.scan_ch(b':') { let remaining = 4 - (indent + 1); @@ -295,7 +298,10 @@ impl<'a> LineStart<'a> { /// Return value is the character, the start index, and the indent in spaces. /// For ordered list markers, the character will be one of b'.' or b')'. For /// bullet list markers, it will be one of b'-', b'+', or b'*'. - pub(crate) fn scan_list_marker_with_indent(&mut self, indent: usize) -> Option<(u8, u64, usize)> { + pub(crate) fn scan_list_marker_with_indent( + &mut self, + indent: usize, + ) -> Option<(u8, u64, usize)> { let save = self.clone(); if self.ix < self.bytes.len() { let c = self.bytes[self.ix]; @@ -1008,7 +1014,13 @@ fn scan_attribute( let ix_after_attribute = ix; ix = scan_whitespace_with_newline_handler_without_buffer(data, ix, newline_handler)?; if scan_ch(&data[ix..], b'=') == 1 { - ix = scan_whitespace_with_newline_handler(data, ix_after_attribute, newline_handler, buffer, buffer_ix)?; + ix = scan_whitespace_with_newline_handler( + data, + ix_after_attribute, + newline_handler, + buffer, + buffer_ix, + )?; ix += 1; ix = scan_whitespace_with_newline_handler(data, ix, newline_handler, buffer, buffer_ix)?; ix = scan_attribute_value(data, ix, newline_handler, buffer, buffer_ix)?; diff --git a/pulldown-cmark/src/strings.rs b/pulldown-cmark/src/strings.rs index 62964358..045a2c20 100644 --- a/pulldown-cmark/src/strings.rs +++ b/pulldown-cmark/src/strings.rs @@ -260,6 +260,10 @@ impl<'a> CowStr<'a> { CowStr::Inlined(s) => s.deref().to_owned(), } } + + pub fn into_static(self) -> CowStr<'static> { + self.into_string().into() + } } impl<'a> fmt::Display for CowStr<'a> { From 2cd94e6b01ef2d763226e0cb75c3a413d6053155 Mon Sep 17 00:00:00 2001 From: Gaurav Date: Mon, 7 Oct 2024 17:41:41 -0400 Subject: [PATCH 048/180] Only change the Borrowed Variant on CowStr::to_static() --- pulldown-cmark/src/strings.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pulldown-cmark/src/strings.rs b/pulldown-cmark/src/strings.rs index 045a2c20..a4b13f9d 100644 --- a/pulldown-cmark/src/strings.rs +++ b/pulldown-cmark/src/strings.rs @@ -262,7 +262,14 @@ impl<'a> CowStr<'a> { } pub fn into_static(self) -> CowStr<'static> { - self.into_string().into() + match self { + CowStr::Boxed(b) => CowStr::Boxed(b), + CowStr::Borrowed(b) => match InlineStr::try_from(b) { + Ok(inline) => CowStr::Inlined(inline), + Err(_) => CowStr::Boxed(b.into()), + }, + CowStr::Inlined(s) => CowStr::Inlined(s), + } } } From aaeb25a85ddb7d6a2f1eeaf5d4cb0eea8ecf3770 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Tue, 8 Oct 2024 14:02:08 -0700 Subject: [PATCH 049/180] Respect line starts when trimming header endings This prevents it from trying to trim whitespace that's part of a block quote or list marker. --- pulldown-cmark/specs/regression.txt | 56 +++++++++++++++++++++ pulldown-cmark/src/firstpass.rs | 19 +++++++- pulldown-cmark/tests/suite/regression.rs | 62 ++++++++++++++++++++++++ 3 files changed, 136 insertions(+), 1 deletion(-) diff --git a/pulldown-cmark/specs/regression.txt b/pulldown-cmark/specs/regression.txt index 44442e66..f7ccb682 100644 --- a/pulldown-cmark/specs/regression.txt +++ b/pulldown-cmark/specs/regression.txt @@ -2726,3 +2726,59 @@ Some preamble foobar_raz, not barfoo_raz stuff](https://example.com)
  • ```````````````````````````````` + +ISSUE #963 + +```````````````````````````````` example +foo +{.class} +=== + +> foo +> {.class} +> === +> +> > foo +> > {.class} +> > === + +* > foo + > {.class} + > === + +> foo +>→{.class} +>→=== +. +

    foo +

    +
    +

    foo +

    +
    +

    foo +

    +
    +
    +
      +
    • +
      +

      foo +

      +
      +
    • +
    +
    +

    foo +

    +
    +```````````````````````````````` + +```````````````````````````````` example +the trailing space after the > should be stripped + > {.bar} +=== +. +

    the trailing space after the > should be stripped +>

    +```````````````````````````````` diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 25244f9d..48bef856 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -724,8 +724,25 @@ impl<'a, 'b> FirstPass<'a, 'b> { let new_end = if has_trailing_content { content_end } else { + let mut last_line_start = header_start; + loop { + let next_line_start = last_line_start + scan_nextline(&bytes[last_line_start..content_end]); + if next_line_start >= content_end { + break; + } + let mut line_start = LineStart::new(&bytes[next_line_start..content_end]); + if scan_containers( + &self.tree, + &mut line_start, + self.options.has_gfm_footnotes(), + ) != self.tree.spine_len() + { + break; + } + last_line_start = next_line_start + line_start.bytes_scanned(); + } let trailing_ws = - scan_rev_while(&bytes[header_start..content_end], is_ascii_whitespace_no_nl); + scan_rev_while(&bytes[last_line_start..content_end], is_ascii_whitespace_no_nl); content_end - trailing_ws }; diff --git a/pulldown-cmark/tests/suite/regression.rs b/pulldown-cmark/tests/suite/regression.rs index 9a8b1aa9..70229e5c 100644 --- a/pulldown-cmark/tests/suite/regression.rs +++ b/pulldown-cmark/tests/suite/regression.rs @@ -3253,3 +3253,65 @@ stuff](https://example.com) test_markdown_html(original, expected, false, false, false); } + +#[test] +fn regression_test_206() { + let original = r##"foo +{.class} +=== + +> foo +> {.class} +> === +> +> > foo +> > {.class} +> > === + +* > foo + > {.class} + > === + +> foo +> {.class} +> === +"##; + let expected = r##"

    foo +

    +
    +

    foo +

    +
    +

    foo +

    +
    +
    +
      +
    • +
      +

      foo +

      +
      +
    • +
    +
    +

    foo +

    +
    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn regression_test_207() { + let original = r##"the trailing space after the > should be stripped + > {.bar} +=== +"##; + let expected = r##"

    the trailing space after the > should be stripped +>

    +"##; + + test_markdown_html(original, expected, false, false, false); +} From c35ab3cf1149950c7482158549641cee12d7f453 Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Wed, 9 Oct 2024 10:31:37 +0300 Subject: [PATCH 050/180] Enforce cargo fmt in CI --- .github/workflows/rust.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8534da5b..e6426a69 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -19,6 +19,9 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust run: rustup default ${{ matrix.rust-version }} + - name: Cargo fmt + if: ${{ matrix.rust-version == 'stable' }} + run: cargo fmt --check - name: Cargo build if: ${{ matrix.rust-version == '1.71.1' }} run: cargo build --verbose From b1509b76672b96e0e83e3b369daa29b9fc074938 Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Wed, 9 Oct 2024 10:33:28 +0300 Subject: [PATCH 051/180] Run cargo fmt --- bench/benches/lib.rs | 12 ++++++++---- bench/src/lib.rs | 1 + dos-fuzzer/src/scoring.rs | 4 +++- pulldown-cmark/tests/html.rs | 8 +++++++- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/bench/benches/lib.rs b/bench/benches/lib.rs index 854d5e3a..288af791 100644 --- a/bench/benches/lib.rs +++ b/bench/benches/lib.rs @@ -5,8 +5,10 @@ mod to_html { use pulldown_cmark::{html, Options, Parser}; pub fn pathological_missing_table_cells(c: &mut Criterion) { - let mut group = c.benchmark_group(" pub fn pathological_missing_table_cells(c: &mut Criterion) { - "); + let mut group = c.benchmark_group( + " pub fn pathological_missing_table_cells(c: &mut Criterion) { + ", + ); let mut buf = String::new(); for i in 1..20 { buf.clear(); @@ -24,8 +26,10 @@ mod to_html { } pub fn pathological_link_def(c: &mut Criterion) { - let mut group = c.benchmark_group(" pub fn pathological_link_def(c: &mut Criterion) { - "); + let mut group = c.benchmark_group( + " pub fn pathological_link_def(c: &mut Criterion) { + ", + ); let mut buf = String::new(); for i in 1..20 { buf.clear(); diff --git a/bench/src/lib.rs b/bench/src/lib.rs index e69de29b..8b137891 100644 --- a/bench/src/lib.rs +++ b/bench/src/lib.rs @@ -0,0 +1 @@ + diff --git a/dos-fuzzer/src/scoring.rs b/dos-fuzzer/src/scoring.rs index 833785ee..48d1eb3c 100644 --- a/dos-fuzzer/src/scoring.rs +++ b/dos-fuzzer/src/scoring.rs @@ -12,7 +12,9 @@ pub fn pearson_correlation(time_samples: &[(f64, f64)]) -> (f64, bool) { vec.extend(time_samples.iter().cloned().map(|(x, y)| [x, y])); let time_samples = Array2::from(vec); let time_samples = time_samples.t(); - let corr = time_samples.pearson_correlation().expect("no time samples given")[[1, 0]]; + let corr = time_samples + .pearson_correlation() + .expect("no time samples given")[[1, 0]]; (corr, corr < super::ACCEPTANCE_CORRELATION) } diff --git a/pulldown-cmark/tests/html.rs b/pulldown-cmark/tests/html.rs index e6c739bb..e8c3bc61 100644 --- a/pulldown-cmark/tests/html.rs +++ b/pulldown-cmark/tests/html.rs @@ -330,7 +330,13 @@ fn trim_space_before_soft_break() { #[test] fn issue_819() { let original = [ - "# \\", "# \\\n", "# \\\n\n", "# \\\r\n", "# \\\r\n\r\n", "# \\\n\r\n", "# \\\r\n\n" + "# \\", + "# \\\n", + "# \\\n\n", + "# \\\r\n", + "# \\\r\n\r\n", + "# \\\n\r\n", + "# \\\r\n\n", ]; let expected = "

    \\

    "; From e6e9d88d3408d18d106ed51b94f083cae4bba38d Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Wed, 9 Oct 2024 10:39:48 +0300 Subject: [PATCH 052/180] Don't format generated test files --- pulldown-cmark/tests/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/pulldown-cmark/tests/lib.rs b/pulldown-cmark/tests/lib.rs index e34cb2a9..6ca5c592 100644 --- a/pulldown-cmark/tests/lib.rs +++ b/pulldown-cmark/tests/lib.rs @@ -2,6 +2,7 @@ use pulldown_cmark::{Options, Parser}; +#[rustfmt::skip] mod suite; #[inline(never)] From 74a41763c9e2dccee56bd0456d4f25eda68ee1b4 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Wed, 9 Oct 2024 07:16:38 -0700 Subject: [PATCH 053/180] Avoid slow path when attrs are turned off Co-authored-by: Linda_pp --- pulldown-cmark/src/firstpass.rs | 37 +++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 48bef856..593ce744 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -725,24 +725,29 @@ impl<'a, 'b> FirstPass<'a, 'b> { content_end } else { let mut last_line_start = header_start; - loop { - let next_line_start = last_line_start + scan_nextline(&bytes[last_line_start..content_end]); - if next_line_start >= content_end { - break; - } - let mut line_start = LineStart::new(&bytes[next_line_start..content_end]); - if scan_containers( - &self.tree, - &mut line_start, - self.options.has_gfm_footnotes(), - ) != self.tree.spine_len() - { - break; + if attrs.is_some() { + loop { + let next_line_start = + last_line_start + scan_nextline(&bytes[last_line_start..content_end]); + if next_line_start >= content_end { + break; + } + let mut line_start = LineStart::new(&bytes[next_line_start..content_end]); + if scan_containers( + &self.tree, + &mut line_start, + self.options.has_gfm_footnotes(), + ) != self.tree.spine_len() + { + break; + } + last_line_start = next_line_start + line_start.bytes_scanned(); } - last_line_start = next_line_start + line_start.bytes_scanned(); } - let trailing_ws = - scan_rev_while(&bytes[last_line_start..content_end], is_ascii_whitespace_no_nl); + let trailing_ws = scan_rev_while( + &bytes[last_line_start..content_end], + is_ascii_whitespace_no_nl, + ); content_end - trailing_ws }; From c118e3002565fe3e5c0a439f2f0649bd10b7c49c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Pozo?= Date: Thu, 17 Oct 2024 15:37:54 +0200 Subject: [PATCH 054/180] chore: bump version to 0.12.2 and update Cargo.lock --- Cargo.lock | 171 ++++++++++++++++++++------------------ pulldown-cmark/Cargo.toml | 2 +- 2 files changed, 91 insertions(+), 82 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 78ebed60..0c3a44cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -74,9 +74,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "arbitrary" @@ -89,9 +89,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "bincode" @@ -104,14 +104,14 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.69.4" +version = "0.69.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" dependencies = [ "bitflags", "cexpr", "clang-sys", - "itertools", + "itertools 0.12.1", "lazy_static", "lazycell", "proc-macro2", @@ -159,9 +159,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.1.16" +version = "1.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9d013ecb737093c0e86b151a7b837993cf9ec6c502946cfb44bedc392421e0b" +checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" dependencies = [ "jobserver", "libc", @@ -223,9 +223,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.16" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" dependencies = [ "clap_builder", "clap_derive", @@ -233,9 +233,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.15" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" dependencies = [ "anstream", "anstyle", @@ -245,9 +245,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.13" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck", "proc-macro2", @@ -307,7 +307,7 @@ dependencies = [ "clap", "criterion-plot", "is-terminal", - "itertools", + "itertools 0.10.5", "num-traits", "once_cell", "oorandom", @@ -328,7 +328,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" dependencies = [ "cast", - "itertools", + "itertools 0.10.5", ] [[package]] @@ -441,7 +441,7 @@ version = "0.1.0" dependencies = [ "clap", "crossbeam-utils", - "itertools", + "itertools 0.10.5", "libc", "ndarray", "ndarray-stats", @@ -524,9 +524,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.33" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" dependencies = [ "crc32fast", "miniz_oxide", @@ -1054,6 +1054,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" @@ -1071,9 +1080,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -1092,9 +1101,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "f0b21006cd1874ae9e650973c565615676dc4a274c965bb0a73796dac838ce4f" [[package]] name = "libfuzzer-sys" @@ -1245,7 +1254,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af5a8477ac96877b5bd1fd67e0c28736c12943aba24eda92b127e036b0c8f400" dependencies = [ "indexmap", - "itertools", + "itertools 0.10.5", "ndarray", "noisy_float", "num-integer", @@ -1347,9 +1356,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "oorandom" @@ -1359,15 +1368,15 @@ checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "plotters" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15b6eccb8484002195a3e44fe65a4ce8e93a625797a063735536fd59cb01cf3" +checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" dependencies = [ "num-traits", "plotters-backend", @@ -1378,15 +1387,15 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7" +checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" [[package]] name = "plotters-svg" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b30686a7d9c3e010b84284bdd26a29f2138574f52f5eb6f794fc0ad924e705" +checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" dependencies = [ "plotters-backend", ] @@ -1408,9 +1417,9 @@ dependencies = [ [[package]] name = "pretty_assertions" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" +checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" dependencies = [ "diff", "yansi", @@ -1418,16 +1427,16 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" dependencies = [ "unicode-ident", ] [[package]] name = "pulldown-cmark" -version = "0.12.1" +version = "0.12.2" dependencies = [ "bincode", "bitflags", @@ -1552,22 +1561,22 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.3" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags", ] [[package]] name = "regex" -version = "1.10.6" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.7", + "regex-automata 0.4.8", "regex-syntax", ] @@ -1582,9 +1591,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", @@ -1593,9 +1602,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rustc-hash" @@ -1605,9 +1614,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.38.35" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags", "errno", @@ -1633,18 +1642,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.209" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.209" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", @@ -1653,9 +1662,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.127" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa", "memchr", @@ -1717,9 +1726,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.77" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ "proc-macro2", "quote", @@ -1739,9 +1748,9 @@ dependencies = [ [[package]] name = "tar" -version = "0.4.41" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb797dad5fb5b76fcf519e702f4a589483b5ef06567f160c392832c1f5e44909" +checksum = "4ff6c40d3aedb5e06b57c6f669ad17ab063dd1e63d977c6a88e7f4dfa4f04020" dependencies = [ "filetime", "libc", @@ -1812,21 +1821,21 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-width" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "urlencoding" @@ -1882,9 +1891,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -1893,9 +1902,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", @@ -1908,9 +1917,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1918,9 +1927,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", @@ -1931,15 +1940,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", @@ -2142,9 +2151,9 @@ dependencies = [ [[package]] name = "yansi" -version = "0.5.1" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" [[package]] name = "yoke" diff --git a/pulldown-cmark/Cargo.toml b/pulldown-cmark/Cargo.toml index a069dc1f..644c8c08 100644 --- a/pulldown-cmark/Cargo.toml +++ b/pulldown-cmark/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pulldown-cmark" -version = "0.12.1" +version = "0.12.2" authors = [ "Raph Levien ", "Marcus Klaas de Vries ", From 68b7f77e6671c87b2cb85cf60ef3b81a77288d9c Mon Sep 17 00:00:00 2001 From: Yacin Tmimi Date: Thu, 17 Oct 2024 22:31:45 -0400 Subject: [PATCH 055/180] feat: add `-D` CLI option to enable definition lists --- pulldown-cmark/src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pulldown-cmark/src/main.rs b/pulldown-cmark/src/main.rs index 25a6f7df..cdb1bc7f 100644 --- a/pulldown-cmark/src/main.rs +++ b/pulldown-cmark/src/main.rs @@ -94,6 +94,11 @@ pub fn main() -> std::io::Result<()> { "fail if input file has broken links", ); opts.optflag("G", "enable-gfm", "enable misc GFM features"); + opts.optflag( + "D", + "enable-definition-list", + "enable Commonmark-HS-Extensions compatible definition lists", + ); let matches = match opts.parse(&args[1..]) { Ok(m) => m, @@ -138,6 +143,9 @@ pub fn main() -> std::io::Result<()> { if matches.opt_present("enable-gfm") { opts.insert(Options::ENABLE_GFM); } + if matches.opt_present("enable-definition-list") { + opts.insert(Options::ENABLE_DEFINITION_LIST); + } let mut input = String::new(); let mut broken_links = vec![]; From e35158385ad9dd5e51e2e8f576bfc9117cb2acc9 Mon Sep 17 00:00:00 2001 From: Yacin Tmimi Date: Fri, 18 Oct 2024 05:53:56 -0400 Subject: [PATCH 056/180] fix nightly CI Some recent changes in the compiler (rust-lang/rust 131833) made `Command::exec` `#[must_use]`. --- dos-fuzzer/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dos-fuzzer/src/main.rs b/dos-fuzzer/src/main.rs index 07e6b29e..6870598d 100644 --- a/dos-fuzzer/src/main.rs +++ b/dos-fuzzer/src/main.rs @@ -279,7 +279,7 @@ fn fuzz(num_cpus: usize) { serde_json::to_string(&pattern).unwrap(), ); let args: Vec<_> = env::args().collect(); - Command::new(&args[0]).args(&args[1..]).exec(); + let _ = Command::new(&args[0]).args(&args[1..]).exec(); unreachable!(); } } From 1f8083a4b9fd2a505c1c3dc5c3d015b97f17680f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar=20Rubio?= Date: Thu, 24 Oct 2024 18:48:50 +0200 Subject: [PATCH 057/180] Safer definition lists implementation --- pulldown-cmark/specs/definition_lists.txt | 34 ++++++++++++++++++ pulldown-cmark/src/tree.rs | 2 -- .../tests/suite/definition_lists.rs | 35 +++++++++++++++++++ 3 files changed, 69 insertions(+), 2 deletions(-) diff --git a/pulldown-cmark/specs/definition_lists.txt b/pulldown-cmark/specs/definition_lists.txt index c41e5d16..ae250162 100644 --- a/pulldown-cmark/specs/definition_lists.txt +++ b/pulldown-cmark/specs/definition_lists.txt @@ -520,3 +520,37 @@ third
    sixth
    ```````````````````````````````` + +Nested definition lists: +(): + +```````````````````````````````` example +level one +: l1 + level two + : l2 + level three + : l3 + +level one +: l1 +. +
    +
    level one
    +
    +
    +
    l1 +level two
    +
    +
    +
    l2 +level three
    +
    l3
    +
    +
    +
    +
    +
    level one
    +
    l1
    +
    +```````````````````````````````` diff --git a/pulldown-cmark/src/tree.rs b/pulldown-cmark/src/tree.rs index cca6208e..4200d770 100644 --- a/pulldown-cmark/src/tree.rs +++ b/pulldown-cmark/src/tree.rs @@ -186,8 +186,6 @@ impl Tree { } if next.is_some() { self.cur = next; - } else { - self.pop(); } } } diff --git a/pulldown-cmark/tests/suite/definition_lists.rs b/pulldown-cmark/tests/suite/definition_lists.rs index 408a3345..703a4805 100644 --- a/pulldown-cmark/tests/suite/definition_lists.rs +++ b/pulldown-cmark/tests/suite/definition_lists.rs @@ -563,3 +563,38 @@ third test_markdown_html(original, expected, false, false, false); } + +#[test] +fn definition_lists_test_26() { + let original = r##"level one +: l1 + level two + : l2 + level three + : l3 + +level one +: l1 +"##; + let expected = r##"
    +
    level one
    +
    +
    +
    l1 +level two
    +
    +
    +
    l2 +level three
    +
    l3
    +
    +
    +
    +
    +
    level one
    +
    l1
    +
    +"##; + + test_markdown_html(original, expected, false, false, false); +} From 8705837fd910a3568a081e2e8fb49c88f1756f0d Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Mon, 28 Oct 2024 14:26:58 -0700 Subject: [PATCH 058/180] Slice at the start of make_code_span, instead of the middle This reduces the number of bounds checks, bringing instruction count down from about 1600 to 1400. --- pulldown-cmark/src/firstpass.rs | 109 ++++++++----------------------- pulldown-cmark/src/parse.rs | 110 +++++++++++++------------------- 2 files changed, 71 insertions(+), 148 deletions(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index eca544ea..3bf3a207 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -90,11 +90,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { self.brace_context_stack.clear(); self.brace_context_next = 0; - let i = scan_containers( - &self.tree, - &mut line_start, - self.options.has_gfm_footnotes(), - ); + let i = scan_containers(&self.tree, &mut line_start, self.options); for _ in i..self.tree.spine_len() { self.pop(start_ix); } @@ -260,11 +256,9 @@ impl<'a, 'b> FirstPass<'a, 'b> { // and break out if we can't re-scan all of them let ix = start_ix + line_start.bytes_scanned(); let mut lazy_line_start = LineStart::new(&bytes[ix..]); - let current_container = scan_containers( - &self.tree, - &mut lazy_line_start, - self.options.has_gfm_footnotes(), - ) == self.tree.spine_len(); + let current_container = + scan_containers(&self.tree, &mut lazy_line_start, self.options) + == self.tree.spine_len(); if !lazy_line_start.scan_space(4) && self.scan_paragraph_interrupt( &bytes[ix + lazy_line_start.bytes_scanned()..], @@ -407,11 +401,9 @@ impl<'a, 'b> FirstPass<'a, 'b> { if let Some(nl) = scan_blank_line(&bytes[ix..]) { ix += nl; let mut lazy_line_start = LineStart::new(&bytes[ix..]); - let current_container = scan_containers( - &self.tree, - &mut lazy_line_start, - self.options.has_gfm_footnotes(), - ) == self.tree.spine_len(); + let current_container = + scan_containers(&self.tree, &mut lazy_line_start, self.options) + == self.tree.spine_len(); if !lazy_line_start.scan_space(4) && self.scan_paragraph_interrupt( &bytes[ix + lazy_line_start.bytes_scanned()..], @@ -557,11 +549,8 @@ impl<'a, 'b> FirstPass<'a, 'b> { ) -> Option<(usize, TreeIndex)> { let bytes = self.text.as_bytes(); let mut line_start = LineStart::new(&bytes[ix..]); - let current_container = scan_containers( - &self.tree, - &mut line_start, - self.options.has_gfm_footnotes(), - ) == self.tree.spine_len(); + let current_container = + scan_containers(&self.tree, &mut line_start, self.options) == self.tree.spine_len(); if !current_container { return None; } @@ -648,11 +637,8 @@ impl<'a, 'b> FirstPass<'a, 'b> { ix = next_ix; let mut line_start = LineStart::new(&bytes[ix..]); - let current_container = scan_containers( - &self.tree, - &mut line_start, - self.options.has_gfm_footnotes(), - ) == self.tree.spine_len(); + let current_container = + scan_containers(&self.tree, &mut line_start, self.options) == self.tree.spine_len(); let trailing_backslash_pos = match brk { Some(Item { start, @@ -740,11 +726,8 @@ impl<'a, 'b> FirstPass<'a, 'b> { break; } let mut line_start = LineStart::new(&bytes[next_line_start..content_end]); - if scan_containers( - &self.tree, - &mut line_start, - self.options.has_gfm_footnotes(), - ) != self.tree.spine_len() + if scan_containers(&self.tree, &mut line_start, self.options) + != self.tree.spine_len() { break; } @@ -826,11 +809,8 @@ impl<'a, 'b> FirstPass<'a, 'b> { // check if we may be parsing a table let next_line_ix = ix + eol_bytes; let mut line_start = LineStart::new(&bytes[next_line_ix..]); - if scan_containers( - &self.tree, - &mut line_start, - self.options.has_gfm_footnotes(), - ) == self.tree.spine_len() + if scan_containers(&self.tree, &mut line_start, self.options) + == self.tree.spine_len() { let table_head_ix = next_line_ix + line_start.bytes_scanned(); let (table_head_bytes, alignment) = @@ -1256,11 +1236,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { self.append_html_line(remaining_space.max(indent), line_start_ix, ix); let mut line_start = LineStart::new(&bytes[ix..]); - let n_containers = scan_containers( - &self.tree, - &mut line_start, - self.options.has_gfm_footnotes(), - ); + let n_containers = scan_containers(&self.tree, &mut line_start, self.options); if n_containers < self.tree.spine_len() { end_ix = ix; break; @@ -1309,11 +1285,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { self.append_html_line(remaining_space.max(indent), line_start_ix, ix); let mut line_start = LineStart::new(&bytes[ix..]); - let n_containers = scan_containers( - &self.tree, - &mut line_start, - self.options.has_gfm_footnotes(), - ); + let n_containers = scan_containers(&self.tree, &mut line_start, self.options); if n_containers < self.tree.spine_len() || line_start.is_at_eol() { end_ix = ix; break; @@ -1360,11 +1332,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { } let mut line_start = LineStart::new(&bytes[ix..]); - let n_containers = scan_containers( - &self.tree, - &mut line_start, - self.options.has_gfm_footnotes(), - ); + let n_containers = scan_containers(&self.tree, &mut line_start, self.options); if n_containers < self.tree.spine_len() || !(line_start.scan_space(4) || line_start.is_at_eol()) { @@ -1411,11 +1379,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { self.tree.push(); loop { let mut line_start = LineStart::new(&bytes[ix..]); - let n_containers = scan_containers( - &self.tree, - &mut line_start, - self.options.has_gfm_footnotes(), - ); + let n_containers = scan_containers(&self.tree, &mut line_start, self.options); if n_containers < self.tree.spine_len() { // this line will get parsed again as not being part of the code // if it's blank, it should be parsed as a blank line @@ -1459,11 +1423,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { self.tree.push(); loop { let mut line_start = LineStart::new(&bytes[ix..]); - let n_containers = scan_containers( - &self.tree, - &mut line_start, - self.options.has_gfm_footnotes(), - ); + let n_containers = scan_containers(&self.tree, &mut line_start, self.options); if n_containers < self.tree.spine_len() { break; } @@ -1778,11 +1738,8 @@ impl<'a, 'b> FirstPass<'a, 'b> { &self.text[start..], &|bytes| { let mut line_start = LineStart::new(bytes); - let current_container = scan_containers( - &self.tree, - &mut line_start, - self.options.has_gfm_footnotes(), - ) == self.tree.spine_len(); + let current_container = scan_containers(&self.tree, &mut line_start, self.options) + == self.tree.spine_len(); if line_start.scan_space(4) { return Some(line_start.bytes_scanned()); } @@ -1832,11 +1789,8 @@ impl<'a, 'b> FirstPass<'a, 'b> { break; } let mut line_start = LineStart::new(&bytes[i..]); - let current_container = scan_containers( - &self.tree, - &mut line_start, - self.options.has_gfm_footnotes(), - ) == self.tree.spine_len(); + let current_container = + scan_containers(&self.tree, &mut line_start, self.options) == self.tree.spine_len(); if !line_start.scan_space(4) { let suffix = &bytes[i + line_start.bytes_scanned()..]; if self.scan_paragraph_interrupt(suffix, current_container) @@ -1894,11 +1848,9 @@ impl<'a, 'b> FirstPass<'a, 'b> { bytecount += 1; } let mut line_start = LineStart::new(&bytes[bytecount..]); - let current_container = scan_containers( - &self.tree, - &mut line_start, - self.options.has_gfm_footnotes(), - ) == self.tree.spine_len(); + let current_container = + scan_containers(&self.tree, &mut line_start, self.options) + == self.tree.spine_len(); if !line_start.scan_space(4) { let suffix = &bytes[bytecount + line_start.bytes_scanned()..]; if self.scan_paragraph_interrupt(suffix, current_container) @@ -2073,12 +2025,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { // ^ // | need to skip over the `>` when checking for the table let mut line_start = LineStart::new(&bytes[next_line_ix..]); - if scan_containers( - &self.tree, - &mut line_start, - self.options.has_gfm_footnotes(), - ) != self.tree.spine_len() - { + if scan_containers(&self.tree, &mut line_start, self.options) != self.tree.spine_len() { return false; } let table_head_ix = next_line_ix + line_start.bytes_scanned(); diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 38de1b6c..f1bdec76 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -655,13 +655,8 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { } else { // ok, so its not an inline link. maybe it is a reference // to a defined link? - let scan_result = scan_reference( - &self.tree, - block_text, - next, - self.options.contains(Options::ENABLE_FOOTNOTES), - self.options.has_gfm_footnotes(), - ); + let scan_result = + scan_reference(&self.tree, block_text, next, self.options); let (node_after_link, link_type) = match scan_result { // [label][reference] RefScan::LinkLabel(_, end_ix) => { @@ -719,8 +714,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { scan_link_label( &self.tree, &self.text[label_start..label_end], - self.options.contains(Options::ENABLE_FOOTNOTES), - self.options.has_gfm_footnotes(), + self.options, ) .map(|(ix, label)| (label, label_start + ix)) .filter(|(_, end)| *end == label_end) @@ -1000,13 +994,11 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { *ix += scan_while(&underlying.as_bytes()[*ix..], is_ascii_whitespace_no_nl); if let Some(bl) = scan_eol(&underlying.as_bytes()[*ix..]) { *ix += bl; - let mut line_start = LineStart::new(&underlying.as_bytes()[*ix..]); - let _ = scan_containers( + *ix += skip_container_prefixes( &self.tree, - &mut line_start, - self.options.has_gfm_footnotes(), + &underlying.as_bytes()[*ix..], + self.options, ); - *ix += line_start.bytes_scanned(); } *ix += scan_while(&underlying.as_bytes()[*ix..], is_ascii_whitespace_no_nl); }; @@ -1158,13 +1150,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { ix += 1; let buf = buf.get_or_insert_with(|| String::with_capacity(ix - span_start)); buf.push_str(&self.text[start_ix..ix]); - let mut line_start = LineStart::new(&bytes[ix..]); - let _ = scan_containers( - &self.tree, - &mut line_start, - self.options.has_gfm_footnotes(), - ); - ix += line_start.bytes_scanned(); + ix += skip_container_prefixes(&self.tree, &bytes[ix..], self.options); start_ix = ix; } else if c == b'\\' && bytes.get(ix + 1) == Some(&b'|') && self.tree.is_in_table() { let buf = buf.get_or_insert_with(|| String::with_capacity(ix + 1 - span_start)); @@ -1193,31 +1179,29 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { /// /// Both `open` and `close` are matching MaybeCode items. fn make_code_span(&mut self, open: TreeIndex, close: TreeIndex, preceding_backslash: bool) { - let bytes = self.text.as_bytes(); let span_start = self.tree[open].item.end; let span_end = self.tree[close].item.start; let mut buf: Option = None; - let mut start_ix = span_start; - let mut ix = span_start; - while ix < span_end { - let c = bytes[ix]; + let spanned_text = &self.text[span_start..span_end]; + let spanned_bytes = spanned_text.as_bytes(); + let mut start_ix = 0; + let mut ix = 0; + while ix < spanned_bytes.len() { + let c = spanned_bytes[ix]; if c == b'\r' || c == b'\n' { - let buf = buf.get_or_insert_with(|| String::with_capacity(ix + 1 - span_start)); - buf.push_str(&self.text[start_ix..ix]); + let buf = buf.get_or_insert_with(|| String::with_capacity(spanned_bytes.len())); + buf.push_str(&spanned_text[start_ix..ix]); buf.push(' '); ix += 1; - let mut line_start = LineStart::new(&bytes[ix..]); - let _ = scan_containers( - &self.tree, - &mut line_start, - self.options.has_gfm_footnotes(), - ); - ix += line_start.bytes_scanned(); + ix += skip_container_prefixes(&self.tree, &spanned_bytes[ix..], self.options); start_ix = ix; - } else if c == b'\\' && bytes.get(ix + 1) == Some(&b'|') && self.tree.is_in_table() { - let buf = buf.get_or_insert_with(|| String::with_capacity(ix + 1 - span_start)); - buf.push_str(&self.text[start_ix..ix]); + } else if c == b'\\' + && spanned_bytes.get(ix + 1) == Some(&b'|') + && self.tree.is_in_table() + { + let buf = buf.get_or_insert_with(|| String::with_capacity(spanned_bytes.len())); + buf.push_str(&spanned_text[start_ix..ix]); buf.push('|'); ix += 2; start_ix = ix; @@ -1228,10 +1212,10 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { let (opening, closing, all_spaces) = { let s = if let Some(buf) = &mut buf { - buf.push_str(&self.text[start_ix..span_end]); + buf.push_str(&spanned_text[start_ix..]); &buf[..] } else { - &self.text[span_start..span_end] + spanned_text }; ( s.as_bytes().first() == Some(&b' '), @@ -1246,14 +1230,12 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { buf.pop(); buf.into() } else { - let lo = span_start + 1; - let hi = (span_end - 1).max(lo); - self.text[lo..hi].into() + spanned_text[1..(spanned_text.len() - 1).max(1)].into() } } else if let Some(buf) = buf { buf.into() } else { - self.text[span_start..span_end].into() + spanned_text.into() }; if preceding_backslash { @@ -1290,15 +1272,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { let (span, i) = scan_html_block_inner( // Subtract 1 to include the < character &bytes[(ix - 1)..], - Some(&|bytes| { - let mut line_start = LineStart::new(bytes); - let _ = scan_containers( - &self.tree, - &mut line_start, - self.options.has_gfm_footnotes(), - ); - line_start.bytes_scanned() - }), + Some(&|bytes| skip_container_prefixes(&self.tree, bytes, self.options)), )?; Some((span, i + ix - 1)) } @@ -1316,7 +1290,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { pub(crate) fn scan_containers( tree: &Tree, line_start: &mut LineStart<'_>, - gfm_footnotes: bool, + options: Options, ) -> usize { let mut i = 0; for &node_ix in tree.walk_spine() { @@ -1343,7 +1317,7 @@ pub(crate) fn scan_containers( break; } } - ItemBody::FootnoteDefinition(..) if gfm_footnotes => { + ItemBody::FootnoteDefinition(..) if options.has_gfm_footnotes() => { let save = line_start.clone(); if !line_start.scan_space(4) && !line_start.is_at_eol() { *line_start = save; @@ -1356,6 +1330,11 @@ pub(crate) fn scan_containers( } i } +pub(crate) fn skip_container_prefixes(tree: &Tree, bytes: &[u8], options: Options) -> usize { + let mut line_start = LineStart::new(bytes); + let _ = scan_containers(tree, &mut line_start, options); + line_start.bytes_scanned() +} impl Tree { pub(crate) fn append_text(&mut self, start: usize, end: usize, backslash_escaped: bool) { @@ -1578,20 +1557,18 @@ fn scan_nodes_to_ix( fn scan_link_label<'text>( tree: &Tree, text: &'text str, - allow_footnote_refs: bool, - gfm_footnotes: bool, + options: Options, ) -> Option<(usize, ReferenceLabel<'text>)> { let bytes = text.as_bytes(); if bytes.len() < 2 || bytes[0] != b'[' { return None; } - let linebreak_handler = |bytes: &[u8]| { - let mut line_start = LineStart::new(bytes); - let _ = scan_containers(tree, &mut line_start, gfm_footnotes); - Some(line_start.bytes_scanned()) - }; - if allow_footnote_refs && b'^' == bytes[1] && bytes.get(2) != Some(&b']') { - let linebreak_handler: &dyn Fn(&[u8]) -> Option = if gfm_footnotes { + let linebreak_handler = |bytes: &[u8]| Some(skip_container_prefixes(tree, bytes, options)); + if options.contains(Options::ENABLE_FOOTNOTES) + && b'^' == bytes[1] + && bytes.get(2) != Some(&b']') + { + let linebreak_handler: &dyn Fn(&[u8]) -> Option = if options.has_gfm_footnotes() { &|_| None } else { &linebreak_handler @@ -1611,8 +1588,7 @@ fn scan_reference<'b>( tree: &Tree, text: &'b str, cur: Option, - allow_footnote_refs: bool, - gfm_footnotes: bool, + options: Options, ) -> RefScan<'b> { let cur_ix = match cur { None => return RefScan::Failed, @@ -1626,7 +1602,7 @@ fn scan_reference<'b>( let closing_node = tree[cur_ix].next.unwrap(); RefScan::Collapsed(tree[closing_node].next) } else { - let label = scan_link_label(tree, &text[start..], allow_footnote_refs, gfm_footnotes); + let label = scan_link_label(tree, &text[start..], options); match label { Some((ix, ReferenceLabel::Link(label))) => RefScan::LinkLabel(label, start + ix), Some((_ix, ReferenceLabel::Footnote(_label))) => RefScan::UnexpectedFootnote, From 6f53549584f89a448ac3b1fc445ce2aca4fa1b0d Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Mon, 28 Oct 2024 14:55:21 -0700 Subject: [PATCH 059/180] Slice at the start of make_math_span, instead of the middle This reduces the number of bounds checks, reducing the number of lines of assembly from about 1100 to 900. --- pulldown-cmark/src/parse.rs | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index f1bdec76..25617198 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -1139,22 +1139,26 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { let span_start = self.tree[open].item.end; let span_end = self.tree[close].item.start; - let bytes = self.text.as_bytes(); + let spanned_text = &self.text[span_start..span_end]; + let spanned_bytes = spanned_text.as_bytes(); let mut buf: Option = None; - let mut start_ix = span_start; - let mut ix = span_start; - while ix < span_end { - let c = bytes[ix]; + let mut start_ix = 0; + let mut ix = 0; + while ix < spanned_bytes.len() { + let c = spanned_bytes[ix]; if c == b'\r' || c == b'\n' { ix += 1; - let buf = buf.get_or_insert_with(|| String::with_capacity(ix - span_start)); - buf.push_str(&self.text[start_ix..ix]); - ix += skip_container_prefixes(&self.tree, &bytes[ix..], self.options); + let buf = buf.get_or_insert_with(|| String::with_capacity(spanned_bytes.len())); + buf.push_str(&spanned_text[start_ix..ix]); + ix += skip_container_prefixes(&self.tree, &spanned_bytes[ix..], self.options); start_ix = ix; - } else if c == b'\\' && bytes.get(ix + 1) == Some(&b'|') && self.tree.is_in_table() { - let buf = buf.get_or_insert_with(|| String::with_capacity(ix + 1 - span_start)); - buf.push_str(&self.text[start_ix..ix]); + } else if c == b'\\' + && spanned_bytes.get(ix + 1) == Some(&b'|') + && self.tree.is_in_table() + { + let buf = buf.get_or_insert_with(|| String::with_capacity(spanned_bytes.len())); + buf.push_str(&spanned_text[start_ix..ix]); buf.push('|'); ix += 2; start_ix = ix; @@ -1164,10 +1168,10 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { } let cow = if let Some(mut buf) = buf { - buf.push_str(&self.text[start_ix..span_end]); + buf.push_str(&spanned_text[start_ix..]); buf.into() } else { - self.text[span_start..span_end].into() + spanned_text.into() }; self.tree[open].item.body = ItemBody::Math(self.allocs.allocate_cow(cow), is_display); @@ -1226,8 +1230,10 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { let cow: CowStr<'input> = if !all_spaces && opening && closing { if let Some(mut buf) = buf { - buf.remove(0); - buf.pop(); + if !buf.is_empty() { + buf.remove(0); + buf.pop(); + } buf.into() } else { spanned_text[1..(spanned_text.len() - 1).max(1)].into() From 20d63b70591e5ec6405476a4861af16660a1138a Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Mon, 28 Oct 2024 16:59:55 -0700 Subject: [PATCH 060/180] Factor some common code out of parse_block This reduces duplicate code, bringing parse_block down from 9073 to 8617, ignoring parse_footnote_definition, which didn't used to be inlined but now is. --- pulldown-cmark/src/firstpass.rs | 70 +++++++++++++++++---------------- 1 file changed, 37 insertions(+), 33 deletions(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 3bf3a207..43a729ec 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -104,16 +104,6 @@ impl<'a, 'b> FirstPass<'a, 'b> { } } } - - // Footnote definitions of the form - // [^bar]: - // * anything really - let container_start = start_ix + line_start.bytes_scanned(); - if let Some(bytecount) = self.parse_footnote(container_start) { - start_ix = container_start + bytecount; - start_ix += scan_blank_line(&bytes[start_ix..]).unwrap_or(0); - line_start = LineStart::new(&bytes[start_ix..]); - } } // Process new containers @@ -124,15 +114,16 @@ impl<'a, 'b> FirstPass<'a, 'b> { line_start = save; break; } - if self.options.has_gfm_footnotes() - || self.options.contains(Options::ENABLE_OLD_FOOTNOTES) - { - // Footnote definitions of the form - // [^bar]: - // * anything really + if self.options.contains(Options::ENABLE_FOOTNOTES) { + // Footnote definitions let container_start = start_ix + line_start.bytes_scanned(); if let Some(bytecount) = self.parse_footnote(container_start) { start_ix = container_start + bytecount; + if self.options.contains(Options::ENABLE_OLD_FOOTNOTES) { + // gfm footnotes need indented, but old footnotes don't + // handle this, old footnotes treat the next line as part of the current line + start_ix += scan_blank_line(&bytes[start_ix..]).unwrap_or(0); + } line_start = LineStart::new(&bytes[start_ix..]); continue; } @@ -400,23 +391,13 @@ impl<'a, 'b> FirstPass<'a, 'b> { // ``` if let Some(nl) = scan_blank_line(&bytes[ix..]) { ix += nl; - let mut lazy_line_start = LineStart::new(&bytes[ix..]); - let current_container = - scan_containers(&self.tree, &mut lazy_line_start, self.options) - == self.tree.spine_len(); - if !lazy_line_start.scan_space(4) - && self.scan_paragraph_interrupt( - &bytes[ix + lazy_line_start.bytes_scanned()..], - current_container, - ) - { - self.finish_list(start_ix); - return ix; - } else { - line_start = lazy_line_start; - line_start.scan_all_space(); - start_ix = ix; - } + } else { + self.finish_list(start_ix); + return ix; + } + if let Some(lazy_line_start) = self.scan_next_line_or_lazy_continuation(&bytes[ix..]) { + line_start = lazy_line_start; + start_ix = ix; } else { self.finish_list(start_ix); return ix; @@ -428,6 +409,29 @@ impl<'a, 'b> FirstPass<'a, 'b> { self.parse_paragraph(ix) } + /// footnote definitions and GFM quote markers can be "interrupted" + /// like paragraphs, but otherwise can't have other blocks after them. + /// + /// Call this at the end of the line to parse that. If it succeeeds, + /// this returns the LineStart for the new line. + fn scan_next_line_or_lazy_continuation<'input>( + &mut self, + bytes: &'input [u8], + ) -> Option> { + let mut line_start = LineStart::new(bytes); + let current_container = + scan_containers(&self.tree, &mut line_start, self.options) == self.tree.spine_len(); + if !line_start.scan_space(4) + && self + .scan_paragraph_interrupt(&bytes[line_start.bytes_scanned()..], current_container) + { + None + } else { + line_start.scan_all_space(); + Some(line_start) + } + } + /// Returns the offset of the first line after the table. /// Assumptions: current focus is a table element and the table header /// matches the separator line (same number of columns). From 5347ace37fbcdfa3718878d7a18ce0615ebf039e Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Fri, 1 Nov 2024 12:20:34 -0700 Subject: [PATCH 061/180] Stop using string slicing for math where bytes will do Reduces instruction count for parse_line from 3291 to 3264. --- pulldown-cmark/src/firstpass.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 43a729ec..05a69464 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -946,15 +946,13 @@ impl<'a, 'b> FirstPass<'a, 'b> { LoopInstruction::ContinueAndSkip(count - 1) } b'$' => { - let string_suffix = &self.text[ix..]; - let can_open = !string_suffix[1..] - .as_bytes() + let byte_suffix = &bytes[ix..]; + let can_open = !byte_suffix[1..] .first() .copied() .map_or(true, is_ascii_whitespace); let can_close = ix > start - && !self.text[..ix] - .as_bytes() + && !bytes[..ix] .last() .copied() .map_or(true, is_ascii_whitespace); From d705dca25b32eee0390606cabcdba843ac3cb14b Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Fri, 1 Nov 2024 13:19:40 -0700 Subject: [PATCH 062/180] Make indent calc for definition lists match commonmark-hs closer --- pulldown-cmark/specs/definition_lists.txt | 71 +++++++++++++--- pulldown-cmark/src/scanners.rs | 10 ++- .../tests/suite/definition_lists.rs | 85 +++++++++++++++---- 3 files changed, 136 insertions(+), 30 deletions(-) diff --git a/pulldown-cmark/specs/definition_lists.txt b/pulldown-cmark/specs/definition_lists.txt index ae250162..8a8a2bd5 100644 --- a/pulldown-cmark/specs/definition_lists.txt +++ b/pulldown-cmark/specs/definition_lists.txt @@ -342,9 +342,7 @@ Bloze ```````````````````````````````` To use an indented code block inside of a definition, -you need to have a total of eight spaces of indentation. -This can be done by having a colon followed by seven spaces, -or three spaces followed by four. +you need to have five spaces of indentation after the colon. ```````````````````````````````` example bar @@ -364,23 +362,74 @@ bar .
    bar
    -
    baz
    -
    +
    +
      baz
    +
    +
    bar
    -
    baz
    -
    +
    +
     baz
    +
    +
    bar
    -
    baz
    -
    +
    +
    baz
    +
    +
    bar
    -
    baz
    -
    +
    baz

    bar : baz

    ```````````````````````````````` +Because of the way it eats indentation after the colon, the number of +spaces you need for indented code blocks on subsequent lines depends on +the indentation of the earlier block. + +```````````````````````````````` example +*orange* + +: orange fruit + + { orange code block } + + > orange block quote + +*orange* + +: orange fruit + + { orange code block } + + > orange block quote +. +
    +
    orange
    +
    +

    orange fruit

    +
    { orange code block }
    +
    +
    +
    +
    +

    orange block quote

    +
    +
    +
    orange
    +
    +
    orange fruit
    +
    +  { orange code block }
    +
    +
    +

    orange block quote

    +
    +
    +
    +```````````````````````````````` + Definition titles can't be tables. ```````````````````````````````` example diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index ec2e5ec0..b2fc4c39 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -285,8 +285,14 @@ impl<'a> LineStart<'a> { ) -> Option { let save = self.clone(); if self.scan_ch(b':') { - let remaining = 4 - (indent + 1); - Some(indent + 1 + self.scan_space_upto(remaining)) + let save = self.clone(); + if self.scan_space(5) { + *self = save; + Some(indent + 1 + self.scan_space_upto(1)) + } else { + *self = save; + Some(indent + 1 + self.scan_space_upto(5)) + } } else { *self = save; None diff --git a/pulldown-cmark/tests/suite/definition_lists.rs b/pulldown-cmark/tests/suite/definition_lists.rs index 703a4805..897e7d89 100644 --- a/pulldown-cmark/tests/suite/definition_lists.rs +++ b/pulldown-cmark/tests/suite/definition_lists.rs @@ -380,17 +380,22 @@ bar "##; let expected = r##"
    bar
    -
    baz
    -
    +
    +
      baz
    +
    +
    bar
    -
    baz
    -
    +
    +
     baz
    +
    +
    bar
    -
    baz
    -
    +
    +
    baz
    +
    +
    bar
    -
    baz
    -
    +
    baz

    bar : baz

    @@ -401,6 +406,52 @@ bar #[test] fn definition_lists_test_17() { + let original = r##"*orange* + +: orange fruit + + { orange code block } + + > orange block quote + +*orange* + +: orange fruit + + { orange code block } + + > orange block quote +"##; + let expected = r##"
    +
    orange
    +
    +

    orange fruit

    +
    { orange code block }
    +
    +
    +
    +
    +

    orange block quote

    +
    +
    +
    orange
    +
    +
    orange fruit
    +
    +  { orange code block }
    +
    +
    +

    orange block quote

    +
    +
    +
    +"##; + + test_markdown_html(original, expected, false, false, false); +} + +#[test] +fn definition_lists_test_18() { let original = r##"Test|Table ----|----- : first @@ -414,7 +465,7 @@ fn definition_lists_test_17() { } #[test] -fn definition_lists_test_18() { +fn definition_lists_test_19() { let original = r##"first : second @@ -435,7 +486,7 @@ Test|Table } #[test] -fn definition_lists_test_19() { +fn definition_lists_test_20() { let original = r##"My section ========== : first @@ -448,7 +499,7 @@ fn definition_lists_test_19() { } #[test] -fn definition_lists_test_20() { +fn definition_lists_test_21() { let original = r##"first : second @@ -468,7 +519,7 @@ My section } #[test] -fn definition_lists_test_21() { +fn definition_lists_test_22() { let original = r##"## My subsection : first "##; @@ -480,7 +531,7 @@ fn definition_lists_test_21() { } #[test] -fn definition_lists_test_22() { +fn definition_lists_test_23() { let original = r##"first : second @@ -499,7 +550,7 @@ fn definition_lists_test_22() { } #[test] -fn definition_lists_test_23() { +fn definition_lists_test_24() { let original = r##"first\ : second @@ -518,7 +569,7 @@ third } #[test] -fn definition_lists_test_24() { +fn definition_lists_test_25() { let original = r##"
    first
    : second @@ -541,7 +592,7 @@ first } #[test] -fn definition_lists_test_25() { +fn definition_lists_test_26() { let original = r##"first : second @@ -565,7 +616,7 @@ third } #[test] -fn definition_lists_test_26() { +fn definition_lists_test_27() { let original = r##"level one : l1 level two From 279da326d15dcaa403e61245a30ae172edf60429 Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Wed, 6 Nov 2024 17:31:34 +0200 Subject: [PATCH 063/180] Ensure "parse" fuzz target covers all options --- fuzz/fuzz_targets/parse.rs | 49 ++------------------------------------ 1 file changed, 2 insertions(+), 47 deletions(-) diff --git a/fuzz/fuzz_targets/parse.rs b/fuzz/fuzz_targets/parse.rs index 6f3a7c59..71286a32 100644 --- a/fuzz/fuzz_targets/parse.rs +++ b/fuzz/fuzz_targets/parse.rs @@ -2,60 +2,15 @@ use libfuzzer_sys::fuzz_target; use libfuzzer_sys::arbitrary::{self, Arbitrary}; -use pulldown_cmark::Options; #[derive(Debug, Arbitrary)] struct FuzzingInput<'a> { + options: u32, markdown: &'a str, - tables: bool, - footnotes: bool, - strikethrough: bool, - tasklists: bool, - smart_punctuation: bool, - heading_attributes: bool, - metadata_block: bool, - math: bool, - gfm: bool, } fuzz_target!(|data: FuzzingInput<'_>| { - let mut opts = pulldown_cmark::Options::empty(); - - if data.tables { - opts.insert(Options::ENABLE_TABLES); - } - - if data.footnotes { - opts.insert(Options::ENABLE_FOOTNOTES); - } - - if data.strikethrough { - opts.insert(Options::ENABLE_STRIKETHROUGH); - } - - if data.tasklists { - opts.insert(Options::ENABLE_TASKLISTS); - } - - if data.smart_punctuation { - opts.insert(Options::ENABLE_SMART_PUNCTUATION); - } - - if data.heading_attributes { - opts.insert(Options::ENABLE_HEADING_ATTRIBUTES); - } - - if data.metadata_block { - opts.insert(Options::ENABLE_YAML_STYLE_METADATA_BLOCKS); - } - - if data.math { - opts.insert(Options::ENABLE_MATH); - } - - if data.gfm { - opts.insert(Options::ENABLE_GFM); - } + let opts = pulldown_cmark::Options::from_bits_truncate(data.options); for _ in pulldown_cmark::Parser::new_ext(data.markdown, opts) {} }); From b6b0e53650d332fd2b7552047ae7f25f3a0254a6 Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Sat, 23 Nov 2024 14:23:34 +0000 Subject: [PATCH 064/180] split feature --- pulldown-cmark/src/firstpass.rs | 10 +++++++--- pulldown-cmark/src/lib.rs | 3 ++- pulldown-cmark/src/main.rs | 15 ++++++++++++--- pulldown-cmark/src/parse.rs | 28 ++++++++++++++++++++-------- pulldown-cmark/tests/lib.rs | 3 ++- 5 files changed, 43 insertions(+), 16 deletions(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index a191af1b..cf92138a 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -2387,10 +2387,12 @@ fn special_bytes(options: &Options) -> [bool; 256] { if options.contains(Options::ENABLE_TABLES) { bytes[b'|' as usize] = true; } - if options.contains(Options::ENABLE_STRIKETHROUGH) || options.contains(Options::ENABLE_SUPER_SUB) { + if options.contains(Options::ENABLE_STRIKETHROUGH) + || options.contains(Options::ENABLE_SUBSCRIPT) + { bytes[b'~' as usize] = true; } - if options.contains(Options::ENABLE_SUPER_SUB) { + if options.contains(Options::ENABLE_SUPERSCRIPT) { bytes[b'^' as usize] = true; } if options.contains(Options::ENABLE_MATH) { @@ -2630,7 +2632,9 @@ mod simd { if options.contains(Options::ENABLE_TABLES) { add_lookup_byte(&mut lookup, b'|'); } - if options.contains(Options::ENABLE_STRIKETHROUGH) || options.contains(Options::ENABLE_SUPER_SUB) { + if options.contains(Options::ENABLE_STRIKETHROUGH) + || options.contains(Options::ENABLE_SUPER_SUB) + { add_lookup_byte(&mut lookup, b'~'); } if options.contains(Options::ENABLE_SUPER_SUB) { diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index 09ece837..3b8aaa43 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -517,7 +517,8 @@ bitflags::bitflags! { /// : definition 2 /// ``` const ENABLE_DEFINITION_LIST = 1 << 12; - const ENABLE_SUPER_SUB = 1 << 13; + const ENABLE_SUPERSCRIPT = 1 << 13; + const ENABLE_SUBSCRIPT = 1 << 14; } } diff --git a/pulldown-cmark/src/main.rs b/pulldown-cmark/src/main.rs index a10cb7c8..9b2abae6 100644 --- a/pulldown-cmark/src/main.rs +++ b/pulldown-cmark/src/main.rs @@ -74,12 +74,18 @@ pub fn main() -> std::io::Result<()> { opts.optflag("T", "enable-tables", "enable GitHub-style tables"); opts.optflag("m", "enable-math", "enable LaTeX-style math"); opts.optflag("F", "enable-footnotes", "enable GitHub-style footnotes"); - opts.optflag("", "enable-old-footnotes", "enable Hoedown-style footnotes"); + opts.optflag( + "f", + "enable-old-footnotes", + "enable Hoedown-style footnotes", + ); opts.optflag( "S", "enable-strikethrough", "enable GitHub-style strikethrough", ); + opts.optflag("U", "enable-superscript", "enable superscript"); + opts.optflag("D", "enable-subscript", "enable subscript"); opts.optflag("L", "enable-tasklists", "enable GitHub-style task lists"); opts.optflag("P", "enable-smart-punctuation", "enable smart punctuation"); opts.optflag( @@ -122,8 +128,11 @@ pub fn main() -> std::io::Result<()> { if matches.opt_present("enable-strikethrough") { opts.insert(Options::ENABLE_STRIKETHROUGH); } - if matches.opt_present("enable-super-sub") { - opts.insert(Options::ENABLE_SUPER_SUB); + if matches.opt_present("enable-superscript") { + opts.insert(Options::ENABLE_SUPERSCRIPT); + } + if matches.opt_present("enable-subscript") { + opts.insert(Options::ENABLE_SUBSCRIPT); } if matches.opt_present("enable-tasklists") { opts.insert(Options::ENABLE_TASKLISTS); diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 35bd6009..cdd4cf36 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -841,8 +841,8 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { let match_count = min(count, el.count); // start, end are tree node indices let mut end = cur_ix - 1; - let mut start = el.start + el.count; - + let mut start = el.start + el.count; + // work from the inside out while start > el.start + el.count - match_count { let inc = if start > el.start + el.count - match_count + 1 { @@ -855,20 +855,31 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { if self.options.contains(Options::ENABLE_STRIKETHROUGH) { ItemBody::Strikethrough } else { - ItemBody::Text { backslash_escaped: false } + ItemBody::Text { + backslash_escaped: false, + } } } else { - if self.options.contains(Options::ENABLE_SUPER_SUB) { + if self.options.contains(Options::ENABLE_SUBSCRIPT) { ItemBody::Subscript + } else if self + .options + .contains(Options::ENABLE_STRIKETHROUGH) + { + ItemBody::Strikethrough } else { - ItemBody::Text { backslash_escaped: false } + ItemBody::Text { + backslash_escaped: false, + } } } } else if c == b'^' { - if self.options.contains(Options::ENABLE_SUPER_SUB) { + if self.options.contains(Options::ENABLE_SUPERSCRIPT) { ItemBody::Superscript } else { - ItemBody::Text { backslash_escaped: false } + ItemBody::Text { + backslash_escaped: false, + } } } else if inc == 2 { ItemBody::Strong @@ -2227,7 +2238,8 @@ mod test { opts.insert(Options::ENABLE_TABLES); opts.insert(Options::ENABLE_FOOTNOTES); opts.insert(Options::ENABLE_STRIKETHROUGH); - opts.insert(Options::ENABLE_SUPER_SUB); + opts.insert(Options::ENABLE_SUPERSCRIPT); + opts.insert(Options::ENABLE_SUBSCRIPT); opts.insert(Options::ENABLE_TASKLISTS); Parser::new_ext(text, opts) diff --git a/pulldown-cmark/tests/lib.rs b/pulldown-cmark/tests/lib.rs index 8655b139..816a155a 100644 --- a/pulldown-cmark/tests/lib.rs +++ b/pulldown-cmark/tests/lib.rs @@ -18,7 +18,8 @@ pub fn test_markdown_html( opts.insert(Options::ENABLE_MATH); opts.insert(Options::ENABLE_TABLES); opts.insert(Options::ENABLE_STRIKETHROUGH); - opts.insert(Options::ENABLE_SUPER_SUB); + opts.insert(Options::ENABLE_SUPERSCRIPT); + opts.insert(Options::ENABLE_SUBSCRIPT); opts.insert(Options::ENABLE_TASKLISTS); opts.insert(Options::ENABLE_GFM); if old_footnotes { From 820791f8a455814e430727b2062cf98ed18040e7 Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Sat, 23 Nov 2024 17:39:14 +0000 Subject: [PATCH 065/180] enable spec and tests --- pulldown-cmark/build.rs | 21 +- pulldown-cmark/specs/strikethrough.txt | 50 +- pulldown-cmark/specs/super_sub.txt | 12 +- pulldown-cmark/src/lib.rs | 2 + pulldown-cmark/tests/lib.rs | 5 +- .../tests/suite/blockquotes_tags.rs | 36 +- .../tests/suite/definition_lists.rs | 54 +- pulldown-cmark/tests/suite/footnotes.rs | 52 +- .../tests/suite/gfm_strikethrough.rs | 6 +- pulldown-cmark/tests/suite/gfm_table.rs | 18 +- pulldown-cmark/tests/suite/gfm_tasklist.rs | 4 +- pulldown-cmark/tests/suite/heading_attrs.rs | 84 +- pulldown-cmark/tests/suite/math.rs | 94 +- pulldown-cmark/tests/suite/metadata_blocks.rs | 24 +- pulldown-cmark/tests/suite/mod.rs | 2 +- pulldown-cmark/tests/suite/old_footnotes.rs | 22 +- pulldown-cmark/tests/suite/regression.rs | 414 +++--- pulldown-cmark/tests/suite/smart_punct.rs | 32 +- pulldown-cmark/tests/suite/spec.rs | 1304 ++++++++--------- pulldown-cmark/tests/suite/strikethrough.rs | 62 +- pulldown-cmark/tests/suite/super_sub.rs | 24 +- pulldown-cmark/tests/suite/table.rs | 56 +- 22 files changed, 1240 insertions(+), 1138 deletions(-) diff --git a/pulldown-cmark/build.rs b/pulldown-cmark/build.rs index a7e6462c..223c9024 100644 --- a/pulldown-cmark/build.rs +++ b/pulldown-cmark/build.rs @@ -86,7 +86,7 @@ fn {}_test_{i}() {{ let original = r##"{original}"##; let expected = r##"{expected}"##; - test_markdown_html(original, expected, {smart_punct}, {metadata_blocks}, {old_footnotes}); + test_markdown_html(original, expected, {smart_punct}, {metadata_blocks}, {old_footnotes}, {subscript}); }} "###, spec_name, @@ -96,6 +96,7 @@ fn {}_test_{i}() {{ smart_punct = testcase.smart_punct, metadata_blocks = testcase.metadata_blocks, old_footnotes = testcase.old_footnotes, + subscript = testcase.subscript, )) .unwrap(); @@ -151,6 +152,7 @@ pub struct TestCase { pub smart_punct: bool, pub metadata_blocks: bool, pub old_footnotes: bool, + pub subscript: bool, } #[cfg(feature = "gen-tests")] @@ -161,17 +163,19 @@ impl<'a> Iterator for Spec<'a> { let spec = self.spec; let prefix = "```````````````````````````````` example"; - let (i_start, smart_punct, metadata_blocks, old_footnotes) = + let (i_start, smart_punct, metadata_blocks, old_footnotes, subscript) = self.spec.find(prefix).and_then(|pos| { let smartpunct_suffix = "_smartpunct\n"; let metadata_blocks_suffix = "_metadata_blocks\n"; let old_footnotes_suffix = "_old_footnotes\n"; + let super_sub_suffix = "_super_sub\n"; if spec[(pos + prefix.len())..].starts_with(smartpunct_suffix) { Some(( pos + prefix.len() + smartpunct_suffix.len(), true, false, false, + false, )) } else if spec[(pos + prefix.len())..].starts_with(metadata_blocks_suffix) { Some(( @@ -179,6 +183,7 @@ impl<'a> Iterator for Spec<'a> { false, true, false, + false, )) } else if spec[(pos + prefix.len())..].starts_with(old_footnotes_suffix) { Some(( @@ -186,9 +191,18 @@ impl<'a> Iterator for Spec<'a> { false, false, true, + false, + )) + } else if spec[(pos + prefix.len())..].starts_with(super_sub_suffix) { + Some(( + pos + prefix.len() + super_sub_suffix.len(), + false, + false, + false, + true, )) } else if spec[(pos + prefix.len())..].starts_with('\n') { - Some((pos + prefix.len() + 1, false, false, false)) + Some((pos + prefix.len() + 1, false, false, false, false)) } else { None } @@ -210,6 +224,7 @@ impl<'a> Iterator for Spec<'a> { smart_punct, metadata_blocks, old_footnotes, + subscript, }; Some(test_case) diff --git a/pulldown-cmark/specs/strikethrough.txt b/pulldown-cmark/specs/strikethrough.txt index c2ee772e..69831faa 100644 --- a/pulldown-cmark/specs/strikethrough.txt +++ b/pulldown-cmark/specs/strikethrough.txt @@ -1,4 +1,6 @@ -# Two tilde strikethrough +This is an extension of gfm_strikethrough.txt. Some of these tests are also pulled from commonmark-hs. + +# Two tildes Basic strikethrough is between two tildes: @@ -30,7 +32,8 @@ This~~is~~stricken

    Thisisstricken

    ```````````````````````````````` -Punctuation is ignored for purposes of determining flankingness on two tildes: +Punctuation is ignored for purposes of determining +flankingness on two tildes: ```````````````````````````````` example Here I strike out an exclamation point~~!~~. @@ -38,6 +41,24 @@ Here I strike out an exclamation point~~!~~.

    Here I strike out an exclamation point!.

    ```````````````````````````````` +# One tilde + +One tilde—and this is where we differ from commonmark-hs—is allowed in certain situations: + +```````````````````````````````` example +~This is stricken out~ +. +

    This is stricken out

    +```````````````````````````````` + +Backslash escapes: + +```````````````````````````````` example +~This is \~stricken~ +. +

    This is ~stricken

    +```````````````````````````````` + Intraword strikeout requires two tildes: ```````````````````````````````` example @@ -46,7 +67,14 @@ This~is~nothing

    This~is~nothing

    ```````````````````````````````` -Punctuation is used for purposes of determining flankingness: +```````````````````````````````` example +~This~is~nothing~ +. +

    This~is~nothing

    +```````````````````````````````` + +Punctuation is used for purposes of determining +flankingness: ```````````````````````````````` example Here I fail to strike out an exclamation point~!~. @@ -74,10 +102,24 @@ Here I fail to match up ~tildes~~.

    Here I fail to match up ~tildes~~.

    ```````````````````````````````` -Double tildes are allowed to contain single tildes: +Double tildes are allowed to contain single tildes, and the other way around: ```````````````````````````````` example ~~This ~is stricken.~~ .

    This ~is stricken.

    ```````````````````````````````` + +```````````````````````````````` example +~This ~~is stricken.~ +. +

    This ~~is stricken.

    +```````````````````````````````` + +The first one wins. + +```````````````````````````````` example +~This ~~is stricken~ but this is not~~ +. +

    This ~~is stricken but this is not~~

    +```````````````````````````````` \ No newline at end of file diff --git a/pulldown-cmark/specs/super_sub.txt b/pulldown-cmark/specs/super_sub.txt index d2eadf69..f60da2e9 100644 --- a/pulldown-cmark/specs/super_sub.txt +++ b/pulldown-cmark/specs/super_sub.txt @@ -2,13 +2,13 @@ Basic strikethrough is between two tildes: -```````````````````````````````` example +```````````````````````````````` example_super_sub ^This is super^ ~This is sub~ .

    This is super This is sub

    ```````````````````````````````` -```````````````````````````````` example +```````````````````````````````` example_super_sub ~This is stricken out~ .

    This is stricken out

    @@ -16,19 +16,19 @@ Basic strikethrough is between two tildes: Backslash escapes: -```````````````````````````````` example +```````````````````````````````` example_super_sub ~This is \~stricken~ .

    This is ~stricken

    ```````````````````````````````` -```````````````````````````````` example +```````````````````````````````` example_super_sub ~This~is~nothing~ .

    This~is~nothing

    ```````````````````````````````` -```````````````````````````````` example +```````````````````````````````` example_super_sub ~This ~~is stricken.~ .

    This ~~is stricken.

    @@ -36,7 +36,7 @@ Backslash escapes: The first one wins. -```````````````````````````````` example +```````````````````````````````` example_super_sub ~This ~~is stricken~ but this is not~~ .

    This ~~is stricken but this is not~~

    diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index 69226073..87757b4c 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -286,6 +286,8 @@ impl<'a> Tag<'a> { Tag::Emphasis => Tag::Emphasis, Tag::Strong => Tag::Strong, Tag::Strikethrough => Tag::Strikethrough, + Tag::Superscript => Tag::Superscript, + Tag::Subscript => Tag::Subscript, Tag::Link { link_type, dest_url, diff --git a/pulldown-cmark/tests/lib.rs b/pulldown-cmark/tests/lib.rs index 2747489f..26cbcb48 100644 --- a/pulldown-cmark/tests/lib.rs +++ b/pulldown-cmark/tests/lib.rs @@ -12,6 +12,7 @@ pub fn test_markdown_html( smart_punct: bool, metadata_blocks: bool, old_footnotes: bool, + subscript: bool, ) { let mut s = String::new(); @@ -20,7 +21,9 @@ pub fn test_markdown_html( opts.insert(Options::ENABLE_TABLES); opts.insert(Options::ENABLE_STRIKETHROUGH); opts.insert(Options::ENABLE_SUPERSCRIPT); - opts.insert(Options::ENABLE_SUBSCRIPT); + if subscript { + opts.insert(Options::ENABLE_SUBSCRIPT); + } opts.insert(Options::ENABLE_TASKLISTS); opts.insert(Options::ENABLE_GFM); if old_footnotes { diff --git a/pulldown-cmark/tests/suite/blockquotes_tags.rs b/pulldown-cmark/tests/suite/blockquotes_tags.rs index 98270390..b2674706 100644 --- a/pulldown-cmark/tests/suite/blockquotes_tags.rs +++ b/pulldown-cmark/tests/suite/blockquotes_tags.rs @@ -10,7 +10,7 @@ fn blockquotes_tags_test_1() { let expected = r##"

    This is a normal blockquote without tag.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -21,7 +21,7 @@ fn blockquotes_tags_test_2() { let expected = r##"

    Note blockquote

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -32,7 +32,7 @@ fn blockquotes_tags_test_3() { let expected = r##"

    Tip blockquote

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -43,7 +43,7 @@ fn blockquotes_tags_test_4() { let expected = r##"

    Important blockquote

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -54,7 +54,7 @@ fn blockquotes_tags_test_5() { let expected = r##"

    Warning blockquote

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -65,7 +65,7 @@ fn blockquotes_tags_test_6() { let expected = r##"

    Caution blockquote

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -75,7 +75,7 @@ fn blockquotes_tags_test_7() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -88,7 +88,7 @@ fn blockquotes_tags_test_8() { Line 2.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -103,7 +103,7 @@ fn blockquotes_tags_test_9() { Line 2.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -116,7 +116,7 @@ fn blockquotes_tags_test_10() { let expected = r##"

    Line 1.

    Line 2.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -131,7 +131,7 @@ fn blockquotes_tags_test_11() { let expected = r##"

    Line 1.

    Line 2.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -144,7 +144,7 @@ fn blockquotes_tags_test_12() { Line 2.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -159,7 +159,7 @@ fn blockquotes_tags_test_13() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -174,7 +174,7 @@ fn blockquotes_tags_test_14() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -189,7 +189,7 @@ fn blockquotes_tags_test_15() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -216,7 +216,7 @@ sink ships "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -237,7 +237,7 @@ fn blockquotes_tags_test_17() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -251,5 +251,5 @@ This should be a normal block quote.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/definition_lists.rs b/pulldown-cmark/tests/suite/definition_lists.rs index 897e7d89..37ff4f82 100644 --- a/pulldown-cmark/tests/suite/definition_lists.rs +++ b/pulldown-cmark/tests/suite/definition_lists.rs @@ -19,7 +19,7 @@ orange "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -44,7 +44,7 @@ orange "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -61,7 +61,7 @@ fn definition_lists_test_3() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -80,7 +80,7 @@ orange "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -105,7 +105,7 @@ orange "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -144,7 +144,7 @@ crisp, pleasant to taste

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -166,7 +166,7 @@ fn definition_lists_test_7() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -189,7 +189,7 @@ orange "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -223,7 +223,7 @@ orange "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -261,7 +261,7 @@ fruit

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -282,7 +282,7 @@ c "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -304,7 +304,7 @@ bim "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -326,7 +326,7 @@ Bloze

    Bloze

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -341,7 +341,7 @@ Bloze

    Bloze

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -358,7 +358,7 @@ Bloze

    Bloze

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -401,7 +401,7 @@ bar : baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -447,7 +447,7 @@ fn definition_lists_test_17() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -461,7 +461,7 @@ fn definition_lists_test_18() {

    : first

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -482,7 +482,7 @@ Test|Table

    : fourth

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -495,7 +495,7 @@ fn definition_lists_test_20() {

    : first

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -515,7 +515,7 @@ My section

    : fourth

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -527,7 +527,7 @@ fn definition_lists_test_22() {

    : first

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -546,7 +546,7 @@ fn definition_lists_test_23() {

    : fourth

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -565,7 +565,7 @@ third "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -588,7 +588,7 @@ first : fourth "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -612,7 +612,7 @@ third "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -647,5 +647,5 @@ level three "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/footnotes.rs b/pulldown-cmark/tests/suite/footnotes.rs index 5d4e9061..c9a59f4a 100644 --- a/pulldown-cmark/tests/suite/footnotes.rs +++ b/pulldown-cmark/tests/suite/footnotes.rs @@ -15,7 +15,7 @@ fn footnotes_test_1() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -34,7 +34,7 @@ Yes it goes on and on my friends. "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -77,7 +77,7 @@ fn footnotes_test_4() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -114,7 +114,7 @@ fn footnotes_test_5() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -138,7 +138,7 @@ d

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -161,7 +161,7 @@ I had largely given over my inquiries into what Professor Angell called the "Cth "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -180,7 +180,7 @@ If a woodchuck could chuck wood.

    Forms of entertainment that aren't childish

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -213,7 +213,7 @@ fn footnotes_test_9() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -233,7 +233,7 @@ As such, we can guarantee that the non-childish forms of entertainment are proba

    As such, we can guarantee that the non-childish forms of entertainment are probably more entertaining to adults, since, having had a whole childhood doing the childish ones, the non-childish ones are merely the ones that haven't gotten boring yet.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -277,7 +277,7 @@ fn footnotes_test_11() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -293,7 +293,7 @@ fn footnotes_test_12() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -312,7 +312,7 @@ fn footnotes_test_13() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -336,7 +336,7 @@ An unordered list before the footnotes: "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -393,7 +393,7 @@ Songs that simply loop are a popular way to annoy people. [^examples3] "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -431,7 +431,7 @@ test suite into pulldown-cmark should be fine.

    [otherlink1]: https://github.com/github/cmark-gfm/blob/1e230827a584ebc9938c3eadc5059c55ef3c9abf/test/extensions.txt#L702

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -456,7 +456,7 @@ fn main() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -470,7 +470,7 @@ fn footnotes_test_18() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -494,7 +494,7 @@ fn footnotes_test_19() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -556,7 +556,7 @@ Second 2 test

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -568,7 +568,7 @@ fn footnotes_test_21() { let expected = r##"

    Test ^ link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -608,7 +608,7 @@ second fourth]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -623,7 +623,7 @@ fn footnotes_test_23() {

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -644,7 +644,7 @@ footnote [^quux]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -663,7 +663,7 @@ fn footnotes_test_25() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -682,5 +682,5 @@ fn footnotes_test_26() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/gfm_strikethrough.rs b/pulldown-cmark/tests/suite/gfm_strikethrough.rs index 59f96745..34902781 100644 --- a/pulldown-cmark/tests/suite/gfm_strikethrough.rs +++ b/pulldown-cmark/tests/suite/gfm_strikethrough.rs @@ -10,7 +10,7 @@ fn gfm_strikethrough_test_1() { let expected = r##"

    Hi Hello, there world!

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -23,7 +23,7 @@ new paragraph~~.

    new paragraph~~.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -33,5 +33,5 @@ fn gfm_strikethrough_test_3() { let expected = r##"

    This will ~~~not~~~ strike.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/gfm_table.rs b/pulldown-cmark/tests/suite/gfm_table.rs index 4c997977..f2c7fc69 100644 --- a/pulldown-cmark/tests/suite/gfm_table.rs +++ b/pulldown-cmark/tests/suite/gfm_table.rs @@ -25,7 +25,7 @@ fn gfm_table_test_1() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -50,7 +50,7 @@ bar | baz "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -77,7 +77,7 @@ fn gfm_table_test_3() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -106,7 +106,7 @@ fn gfm_table_test_4() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -139,7 +139,7 @@ bar

    bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -153,7 +153,7 @@ fn gfm_table_test_6() { | bar |

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -183,7 +183,7 @@ fn gfm_table_test_7() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -202,7 +202,7 @@ fn gfm_table_test_8() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -229,5 +229,5 @@ fn gfm_table_test_9() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/gfm_tasklist.rs b/pulldown-cmark/tests/suite/gfm_tasklist.rs index 72262bba..ced6086b 100644 --- a/pulldown-cmark/tests/suite/gfm_tasklist.rs +++ b/pulldown-cmark/tests/suite/gfm_tasklist.rs @@ -16,7 +16,7 @@ bar "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -41,5 +41,5 @@ bim "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/heading_attrs.rs b/pulldown-cmark/tests/suite/heading_attrs.rs index f16bb8c6..ed9cf2d7 100644 --- a/pulldown-cmark/tests/suite/heading_attrs.rs +++ b/pulldown-cmark/tests/suite/heading_attrs.rs @@ -20,7 +20,7 @@ multiple! {.myclass1 myattr #myh3 otherattr=value .myclass2}

    multiple!

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -36,7 +36,7 @@ fn heading_attrs_test_2() {

    multiple!

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -53,7 +53,7 @@ fn heading_attrs_test_3() {

    non-attribute-block {#id4}

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -65,7 +65,7 @@ fn heading_attrs_test_4() {

    tabs

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -77,7 +77,7 @@ nextline

    nextline

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -99,7 +99,7 @@ nextline {.class}

    ](https://example.com/) {#myid3}

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -114,7 +114,7 @@ cont "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -133,7 +133,7 @@ fn heading_attrs_test_8() { } "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -145,7 +145,7 @@ fn heading_attrs_test_9() {

    recommended style with spaces

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -159,7 +159,7 @@ fn heading_attrs_test_10() {

    H3

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -171,7 +171,7 @@ fn heading_attrs_test_11() {

    H2

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -183,7 +183,7 @@ fn heading_attrs_test_12() {

    H2 {#id2

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -195,7 +195,7 @@ fn heading_attrs_test_13() {

    H2 #id2}

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -207,7 +207,7 @@ fn heading_attrs_test_14() {

    H2 {#id2}

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -225,7 +225,7 @@ fn heading_attrs_test_15() {
    text
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -235,7 +235,7 @@ fn heading_attrs_test_16() { let expected = r##"

    H1

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -245,7 +245,7 @@ fn heading_attrs_test_17() { let expected = r##"

    H1

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -255,7 +255,7 @@ fn heading_attrs_test_18() { let expected = r##"

    H1

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -267,7 +267,7 @@ fn heading_attrs_test_19() {

    H2

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -279,7 +279,7 @@ fn heading_attrs_test_20() {

    H2

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -289,7 +289,7 @@ fn heading_attrs_test_21() { let expected = r##"

    Header

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -299,7 +299,7 @@ fn heading_attrs_test_22() { let expected = r##"

    Header

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -311,7 +311,7 @@ fn heading_attrs_test_23() {

    H2 {.foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -321,7 +321,7 @@ fn heading_attrs_test_24() { let expected = r##"

    H1 {.foo}bar}

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -331,7 +331,7 @@ fn heading_attrs_test_25() { let expected = r##"

    H1 {foo}

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -341,7 +341,7 @@ fn heading_attrs_test_26() { let expected = r##"

    H1 {.foo}

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -354,7 +354,7 @@ fn heading_attrs_test_27() { .bar} "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -368,7 +368,7 @@ fn heading_attrs_test_28() {

    H2 {}

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -378,7 +378,7 @@ fn heading_attrs_test_29() { let expected = r##"

    H2 {}

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -396,7 +396,7 @@ newline can be used for setext heading { } "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -410,7 +410,7 @@ fn heading_attrs_test_31() {

    stray backslash at the end is preserved \

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -428,7 +428,7 @@ stray backslash at the end is preserved \

    stray backslash at the end is preserved \

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -442,7 +442,7 @@ fn heading_attrs_test_33() {

    H3

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -461,7 +461,7 @@ H2-2 {#foo**bar**baz}

    H2-2

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -475,7 +475,7 @@ fn heading_attrs_test_35() {

    H3

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -487,7 +487,7 @@ fn heading_attrs_test_36() {

    H2

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -499,7 +499,7 @@ fn heading_attrs_test_37() {

    H1

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -518,7 +518,7 @@ fn heading_attrs_test_38() {

    #{}

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -545,7 +545,7 @@ fn heading_attrs_test_39() {

    {}

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -565,7 +565,7 @@ fn heading_attrs_test_40() {

    vertical tab

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -580,7 +580,7 @@ fn heading_attrs_test_41() {

    vertical tab (U+000B)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -592,5 +592,5 @@ fn heading_attrs_test_42() {

    IDEOGRAPHIC SPACE (U+3000)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/math.rs b/pulldown-cmark/tests/suite/math.rs index 856b1f9b..feacd785 100644 --- a/pulldown-cmark/tests/suite/math.rs +++ b/pulldown-cmark/tests/suite/math.rs @@ -15,7 +15,7 @@ $\sum_{k=1}^n a_k b_k$: Mathematical expression at head of line

    \ may follow just after the first $: \{1, 2, 3\}

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -28,7 +28,7 @@ $$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \

    \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -41,7 +41,7 @@ $$$$

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -57,7 +57,7 @@ $$x$$$$$$y$$

    xy$$

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -82,7 +82,7 @@ $α$

    &alpha;

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -95,7 +95,7 @@ Dollar at end of line$

    Dollar at end of line$

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -112,7 +112,7 @@ $$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -126,7 +126,7 @@ hard break either

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -139,7 +139,7 @@ $$y = \$ x$$

    y = \$ x

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -152,7 +152,7 @@ $$ $ $$

    $$ $ $$

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -162,7 +162,7 @@ fn math_test_11() { let expected = r##"

    alpha$betagamma$$delta

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -190,7 +190,7 @@ they should not allow inlines to do that $$2 + *

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -200,7 +200,7 @@ fn math_test_13() { let expected = r##"

    these are math texts: fooy=xbar and y=xbar and fooy=x bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -216,7 +216,7 @@ braces: ($x=y$) [$x=y$] {$x=y$}

    braces: (x=y) [x=y] {x=y}

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -226,7 +226,7 @@ fn math_test_15() { let expected = r##"

    x=y

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -245,7 +245,7 @@ $$a$$$$b$$

    ab

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -264,7 +264,7 @@ $$ Display `first $$ then` code

    Code $$ first then $$ display

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -288,7 +288,7 @@ $$ x + y "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -311,7 +311,7 @@ not

    $$

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -334,7 +334,7 @@ math$ "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -354,7 +354,7 @@ And this is inline math: \text{Hello $x$ there!}

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -379,7 +379,7 @@ Math environment contains y: $x {$ $ } $y$

    Math environment contains y: $x {$ $ } y

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -412,7 +412,7 @@ and expected to be as short as possible:

    \text{first $$ second}$$

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -434,7 +434,7 @@ $}$] $$

    $}$] $$

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -444,7 +444,7 @@ fn math_test_25() { let expected = r##"

    x `y`

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -486,7 +486,7 @@ b "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -500,7 +500,7 @@ fn math_test_27() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -523,7 +523,7 @@ A = 5 "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -536,7 +536,7 @@ $$aa<b

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -551,7 +551,7 @@ fn math_test_30() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -563,7 +563,7 @@ fn math_test_31() {

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -579,7 +579,7 @@ fn math_test_32() {

    1x

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -595,7 +595,7 @@ _$a$ equals $b$_

    a equals b

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -618,7 +618,7 @@ a "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -628,7 +628,7 @@ fn math_test_35() { let expected = r##"

    \{a\,b\}

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -644,7 +644,7 @@ ${a}_b c_{d}$

    {a}_b c_{d}

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -656,7 +656,7 @@ $$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$ x = {-b \pm \sqrt{b^2-4ac} \over 2a}

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -666,7 +666,7 @@ fn math_test_38() { let expected = r##"

    x = \$

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -676,7 +676,7 @@ fn math_test_39() { let expected = r##"

    Equation \Omega(69) in italic text

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -700,7 +700,7 @@ fn math_test_40() {

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -716,7 +716,7 @@ fn math_test_41() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -732,7 +732,7 @@ fn math_test_42() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -770,7 +770,7 @@ fn math_test_43() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -790,7 +790,7 @@ improperly }{ nested But this still isn't, because the braces are still counted: $}{$

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -819,7 +819,7 @@ another improperly nested example }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -853,7 +853,7 @@ fn math_test_46() { {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{ 255 brace pairs and one unclosed brace

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -915,5 +915,5 @@ fn math_test_47() { }}}}}}}}}}}}}}}{$ 255 close braces and one open brace

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/metadata_blocks.rs b/pulldown-cmark/tests/suite/metadata_blocks.rs index 9ed3b59b..0020ebba 100644 --- a/pulldown-cmark/tests/suite/metadata_blocks.rs +++ b/pulldown-cmark/tests/suite/metadata_blocks.rs @@ -12,7 +12,7 @@ another_field: 0 "##; let expected = r##""##; - test_markdown_html(original, expected, false, true, false); + test_markdown_html(original, expected, false, true, false, false); } #[test] @@ -26,7 +26,7 @@ another_field: 0 another_field: 0

    "##; - test_markdown_html(original, expected, false, true, false); + test_markdown_html(original, expected, false, true, false, false); } #[test] @@ -38,7 +38,7 @@ fn metadata_blocks_test_3() {
    "##; - test_markdown_html(original, expected, false, true, false); + test_markdown_html(original, expected, false, true, false, false); } #[test] @@ -54,7 +54,7 @@ another_field: 0 another_field: 0 "##; - test_markdown_html(original, expected, false, true, false); + test_markdown_html(original, expected, false, true, false, false); } #[test] @@ -70,7 +70,7 @@ another_field: 0 another_field: 0 "##; - test_markdown_html(original, expected, false, true, false); + test_markdown_html(original, expected, false, true, false, false); } #[test] @@ -85,7 +85,7 @@ another_field: 0 let expected = r##"

    My paragraph here.

    "##; - test_markdown_html(original, expected, false, true, false); + test_markdown_html(original, expected, false, true, false, false); } #[test] @@ -105,7 +105,7 @@ another_field: 0 another_field: 0 "##; - test_markdown_html(original, expected, false, true, false); + test_markdown_html(original, expected, false, true, false, false); } #[test] @@ -126,7 +126,7 @@ another_field: 0 ---a

    "##; - test_markdown_html(original, expected, false, true, false); + test_markdown_html(original, expected, false, true, false, false); } #[test] @@ -138,7 +138,7 @@ another_field: 0 "##; let expected = r##""##; - test_markdown_html(original, expected, false, true, false); + test_markdown_html(original, expected, false, true, false, false); } #[test] @@ -150,7 +150,7 @@ another_field: 0 "##; let expected = r##""##; - test_markdown_html(original, expected, false, true, false); + test_markdown_html(original, expected, false, true, false, false); } #[test] @@ -165,7 +165,7 @@ Things "##; - test_markdown_html(original, expected, false, true, false); + test_markdown_html(original, expected, false, true, false, false); } #[test] @@ -177,5 +177,5 @@ fn metadata_blocks_test_12() { "##; let expected = r##""##; - test_markdown_html(original, expected, false, true, false); + test_markdown_html(original, expected, false, true, false, false); } diff --git a/pulldown-cmark/tests/suite/mod.rs b/pulldown-cmark/tests/suite/mod.rs index 090dc71e..79c630c8 100644 --- a/pulldown-cmark/tests/suite/mod.rs +++ b/pulldown-cmark/tests/suite/mod.rs @@ -17,5 +17,5 @@ mod regression; mod smart_punct; mod spec; mod strikethrough; +mod super_sub; mod table; -mod super_sub; \ No newline at end of file diff --git a/pulldown-cmark/tests/suite/old_footnotes.rs b/pulldown-cmark/tests/suite/old_footnotes.rs index 80ec6ef4..a105a32b 100644 --- a/pulldown-cmark/tests/suite/old_footnotes.rs +++ b/pulldown-cmark/tests/suite/old_footnotes.rs @@ -15,7 +15,7 @@ fn old_footnotes_test_1() { "##; - test_markdown_html(original, expected, false, false, true); + test_markdown_html(original, expected, false, false, true, false); } #[test] @@ -34,7 +34,7 @@ Yes it goes on and on my friends. "##; - test_markdown_html(original, expected, false, false, true); + test_markdown_html(original, expected, false, false, true, false); } #[test] @@ -71,7 +71,7 @@ I had largely given over my inquiries into what Professor Angell called the "Cth

    I had largely given over my inquiries into what Professor Angell called the "Cthulhu Cult", and was visiting a learned friend in Paterson, New Jersey; the curator of a local museum and a mineralogist of note. Examining one day the reserve specimens roughly set on the storage shelves in a rear room of the museum, my eye was caught by an odd picture in one of the old papers spread beneath the stones. It was the Sydney Bulletin I have mentioned, for my friend had wide affiliations in all conceivable foreign parts; and the picture was a half-tone cut of a hideous stone image almost identical with that which Legrasse had found in the swamp.

    "##; - test_markdown_html(original, expected, false, false, true); + test_markdown_html(original, expected, false, false, true, false); } #[test] @@ -90,7 +90,7 @@ If a woodchuck could chuck wood.

    Forms of entertainment that aren't childish

    "##; - test_markdown_html(original, expected, false, false, true); + test_markdown_html(original, expected, false, false, true, false); } #[test] @@ -110,7 +110,7 @@ As such, we can guarantee that the non-childish forms of entertainment are proba

    As such, we can guarantee that the non-childish forms of entertainment are probably more entertaining to adults, since, having had a whole childhood doing the childish ones, the non-childish ones are merely the ones that haven't gotten boring yet.

    "##; - test_markdown_html(original, expected, false, false, true); + test_markdown_html(original, expected, false, false, true, false); } #[test] @@ -144,7 +144,7 @@ fn old_footnotes_test_7() { "##; - test_markdown_html(original, expected, false, false, true); + test_markdown_html(original, expected, false, false, true, false); } #[test] @@ -159,7 +159,7 @@ fn old_footnotes_test_8() {
    2

    Common for people practicing music.

    "##; - test_markdown_html(original, expected, false, false, true); + test_markdown_html(original, expected, false, false, true, false); } #[test] @@ -173,7 +173,7 @@ fn old_footnotes_test_9() { let expected = r##"

    [Reference to footnotes A1, B2 and C3.

    1

    Footnote A.

    2

    Footnote B.

    3

    Footnote C.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -192,7 +192,7 @@ fn old_footnotes_test_10() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -211,5 +211,5 @@ fn old_footnotes_test_11() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/regression.rs b/pulldown-cmark/tests/suite/regression.rs index 70229e5c..27d8badc 100644 --- a/pulldown-cmark/tests/suite/regression.rs +++ b/pulldown-cmark/tests/suite/regression.rs @@ -16,7 +16,7 @@ This is a test of the details element. "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -31,7 +31,7 @@ fn regression_test_2() { let expected = r##"

    see the many articles on QuickCheck.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -48,7 +48,7 @@ fn regression_test_3() { debug-stub-derive on docs.rs

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -69,7 +69,7 @@ fn regression_test_4() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -79,7 +79,7 @@ fn regression_test_5() { let expected = r##"

    foo§(bar)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -89,7 +89,7 @@ fn regression_test_6() { let expected = r##"

    https://example.com hello

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -103,7 +103,7 @@ fn regression_test_7() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -130,7 +130,7 @@ fn regression_test_8() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -144,7 +144,7 @@ i8 let expected = r##"

    i8

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -156,7 +156,7 @@ fn regression_test_10() { let expected = r##"

    a

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -168,7 +168,7 @@ fn regression_test_11() { let expected = r##"

    a

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -181,7 +181,7 @@ fn regression_test_12() {

    [a]: /url (title))

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -194,7 +194,7 @@ b

    b

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -205,7 +205,7 @@ foo let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -215,7 +215,7 @@ fn regression_test_15() { let expected = r##"

    `foo`

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -227,7 +227,7 @@ bar bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -240,7 +240,7 @@ fn regression_test_17() {

    1) bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -262,7 +262,7 @@ fn regression_test_18() {

    1)2)3)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -272,7 +272,7 @@ fn regression_test_19() { let expected = r##"

    [](<<>)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -282,7 +282,7 @@ fn regression_test_20() { let expected = r##"

    `foo``bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -292,7 +292,7 @@ fn regression_test_21() { let expected = r##"

    \foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -304,7 +304,7 @@ YOLO let expected = r##"

    YOLO

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -320,7 +320,7 @@ A | B foo | bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -334,7 +334,7 @@ foo|bar "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -348,7 +348,7 @@ foo|bar "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -358,7 +358,7 @@ fn regression_test_26() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -368,7 +368,7 @@ fn regression_test_27() { let expected = r##"

    bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -378,7 +378,7 @@ fn regression_test_28() { let expected = r##"

    http://example.com

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -388,7 +388,7 @@ fn regression_test_29() { let expected = r##"

    http://one http://two

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -403,7 +403,7 @@ some text

    some text

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -424,7 +424,7 @@ fn regression_test_31() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -439,7 +439,7 @@ x

    ]: f

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -449,7 +449,7 @@ fn regression_test_33() { let expected = r##"

    [foo]:

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -464,7 +464,7 @@ fn regression_test_34() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -479,7 +479,7 @@ yolo | swag

    yolo | swag

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -489,7 +489,7 @@ fn regression_test_36() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -501,7 +501,7 @@ fn regression_test_37() { "hi">

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -514,7 +514,7 @@ __a__

    a

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -527,7 +527,7 @@ fn regression_test_39() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -537,7 +537,7 @@ fn regression_test_40() { let expected = r##"

    \|

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -550,7 +550,7 @@ Paragraph 2

    Paragraph 2

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -560,7 +560,7 @@ fn regression_test_42() { let expected = r##"

    [link text]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -572,7 +572,7 @@ fn regression_test_43() { let expected = r##"
    foobar
    [a](<url>)
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -586,7 +586,7 @@ fn regression_test_44() {

    ")

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -599,7 +599,7 @@ fn regression_test_45() {

    )

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -612,7 +612,7 @@ fn regression_test_46() {

    ")

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -622,7 +622,7 @@ fn regression_test_47() { let expected = r##"

    <http:// >

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -632,7 +632,7 @@ fn regression_test_48() { let expected = r##"

    <http://>

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -651,7 +651,7 @@ fn regression_test_49() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -670,7 +670,7 @@ fn regression_test_50() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -680,7 +680,7 @@ fn regression_test_51() { let expected = r##"

    *hi_

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -690,7 +690,7 @@ fn regression_test_52() { let expected = r##"

    email: john@example.com_

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -704,7 +704,7 @@ bar">link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -719,7 +719,7 @@ fn regression_test_54() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -735,7 +735,7 @@ bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -753,7 +753,7 @@ fn regression_test_56() {

    a b c

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -770,7 +770,7 @@ fn regression_test_57() {

    [a b] [a > b]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -783,7 +783,7 @@ package`] let expected = r##"

    cargo package

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -798,7 +798,7 @@ fn regression_test_59() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -811,7 +811,7 @@ fn regression_test_60() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -827,7 +827,7 @@ the size of usize and have the same alignment.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -851,7 +851,7 @@ An unordered list before the footnotes: "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -869,7 +869,7 @@ fn regression_test_63() {

    assimp-rs

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -914,7 +914,7 @@ fn regression_test_64() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -924,7 +924,7 @@ fn regression_test_65() { let expected = r##"

    <foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -942,7 +942,7 @@ lo">

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -953,7 +953,7 @@ fn regression_test_67() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -975,7 +975,7 @@ a 2. a

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -991,7 +991,7 @@ fn regression_test_69() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1010,7 +1010,7 @@ bar

    baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1029,7 +1029,7 @@ fn regression_test_71() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1041,7 +1041,7 @@ fn regression_test_72() { let expected = r##"

    []]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1051,7 +1051,7 @@ fn regression_test_73() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1061,7 +1061,7 @@ fn regression_test_74() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1071,7 +1071,7 @@ fn regression_test_75() { let expected = r##"

    emphasis strike strong strike emphasis strong

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1081,7 +1081,7 @@ fn regression_test_76() { let expected = r##"

    emphasis strike strong strike emphasis strong code

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1091,7 +1091,7 @@ fn regression_test_77() { let expected = r##"

    emphasis strike code strike emphasis strong

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1101,7 +1101,7 @@ fn regression_test_78() { let expected = r##"

    emphasis strike code strike emphasis strong code

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1111,7 +1111,7 @@ fn regression_test_79() { let expected = r##"

    strong strike emphasis strike emphasis strong

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1121,7 +1121,7 @@ fn regression_test_80() { let expected = r##"

    strong strike emphasis strike emphasis strong code

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1131,7 +1131,7 @@ fn regression_test_81() { let expected = r##"

    strong strike code strike emphasis strong

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1141,7 +1141,7 @@ fn regression_test_82() { let expected = r##"

    strong strike code strike emphasis strong code

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1234,7 +1234,7 @@ fn regression_test_83() { | baz | alef |

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1244,7 +1244,7 @@ fn regression_test_84() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1254,7 +1254,7 @@ fn regression_test_85() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1264,7 +1264,7 @@ fn regression_test_86() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1326,7 +1326,7 @@ fn regression_test_87() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1339,7 +1339,7 @@ b

    b

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1353,7 +1353,7 @@ fn regression_test_89() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1367,7 +1367,7 @@ fn regression_test_90() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1379,7 +1379,7 @@ fn regression_test_91() {

    b

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1390,7 +1390,7 @@ fn regression_test_92() { let expected = r##"

    a\

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1403,7 +1403,7 @@ fn regression_test_93() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1415,7 +1415,7 @@ fn regression_test_94() {
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1427,7 +1427,7 @@ fn regression_test_95() { > "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1439,7 +1439,7 @@ fn regression_test_96() {

    quote

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1451,7 +1451,7 @@ fn regression_test_97() { > not quote "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1463,7 +1463,7 @@ fn regression_test_98() {

    quote

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1475,7 +1475,7 @@ fn regression_test_99() { >not quote "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1494,7 +1494,7 @@ fn regression_test_100() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1504,7 +1504,7 @@ fn regression_test_101() { let expected = r##"

    *R]-

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1514,7 +1514,7 @@ fn regression_test_102() { let expected = r##"

    foobarbaz**

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1528,7 +1528,7 @@ fn regression_test_103() { %

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1542,7 +1542,7 @@ fn regression_test_104() { %

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1552,7 +1552,7 @@ fn regression_test_105() { let expected = r##"

    <@1>

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1566,7 +1566,7 @@ Things let expected = r##"

    Things

    "##; - test_markdown_html(original, expected, false, true, false); + test_markdown_html(original, expected, false, true, false, false); } #[test] @@ -1581,7 +1581,7 @@ Things let expected = r##"

    Things

    "##; - test_markdown_html(original, expected, false, true, false); + test_markdown_html(original, expected, false, true, false, false); } #[test] @@ -1595,7 +1595,7 @@ Things let expected = r##"

    Things

    "##; - test_markdown_html(original, expected, false, true, false); + test_markdown_html(original, expected, false, true, false, false); } #[test] @@ -1619,7 +1619,7 @@ fn regression_test_109() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1634,7 +1634,7 @@ fn regression_test_110() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1644,7 +1644,7 @@ fn regression_test_111() { let expected = r##"

    j*5=

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1710,7 +1710,7 @@ Table "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1723,7 +1723,7 @@ fn regression_test_113() {

    [x]: (

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1745,7 +1745,7 @@ an unmatched asterisk.

    {{

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1755,7 +1755,7 @@ fn regression_test_115() { let expected = r##"

    *a.*.a..

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1774,7 +1774,7 @@ _*xx-_-

    *xx--

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1803,7 +1803,7 @@ fn regression_test_117() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1832,7 +1832,7 @@ fn regression_test_118() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1845,7 +1845,7 @@ fn regression_test_119() {

    ]: https://rust-lang.org

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1878,7 +1878,7 @@ fn regression_test_120() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1921,7 +1921,7 @@ The second hyphen should parse the same way in both samples. "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1936,7 +1936,7 @@ https://rust-lang.org "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1949,7 +1949,7 @@ Second try]: https://rust-lang.org

    Second try]: https://rust-lang.org

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1972,7 +1972,7 @@ fn regression_test_124() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1984,7 +1984,7 @@ bar \

    bar \

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1998,7 +1998,7 @@ fn regression_test_126() {

    [third try]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2018,7 +2018,7 @@ bar "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2040,7 +2040,7 @@ fn regression_test_128() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2051,7 +2051,7 @@ fn regression_test_129() { let expected = r##"

    -

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2068,7 +2068,7 @@ foo) "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2085,7 +2085,7 @@ fn regression_test_131() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2104,7 +2104,7 @@ fn regression_test_132() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2125,7 +2125,7 @@ fn regression_test_133() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2136,7 +2136,7 @@ fn regression_test_134() { let expected = r##"

    - baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2154,7 +2154,7 @@ GFM footnotes can interrupt link defs if they have three spaces, but not four.

    GFM footnotes can interrupt link defs if they have three spaces, but not four.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2171,7 +2171,7 @@ Setext heading can interrupt link def if it has three spaces, but not four.

    Setext heading can interrupt link def if it has three spaces, but not four.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2191,7 +2191,7 @@ List can interrupt the paragraph at the start of a link definition if it starts

    List can interrupt the paragraph at the start of a link definition if it starts with three spaces, but not four.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2210,7 +2210,7 @@ second]

    second]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2228,7 +2228,7 @@ second] second

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2245,7 +2245,7 @@ fn regression_test_140() {

    first

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2262,7 +2262,7 @@ fn regression_test_141() { ">first

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2281,7 +2281,7 @@ fn regression_test_142() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2300,7 +2300,7 @@ fn regression_test_143() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2319,7 +2319,7 @@ fn regression_test_144() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2336,7 +2336,7 @@ fn regression_test_145() { ">first

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2355,7 +2355,7 @@ fn regression_test_146() {

    first

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2366,7 +2366,7 @@ fn regression_test_147() { let expected = r##"

    'foo'bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2382,7 +2382,7 @@ fn regression_test_148() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2398,7 +2398,7 @@ a]: https://example.com let expected = r##"

    a b

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2419,7 +2419,7 @@ fn regression_test_150() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2441,7 +2441,7 @@ baz* "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2463,7 +2463,7 @@ baz` "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2485,7 +2485,7 @@ baz](https://example.com) "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2500,7 +2500,7 @@ part of the title' part of the title">mylink

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2517,7 +2517,7 @@ starts in column three. "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2531,7 +2531,7 @@ fn regression_test_156() {

    This is not in the list at all. It's a paragraph after it.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2543,7 +2543,7 @@ fn regression_test_157() { let expected = r##"

    \!\&quot;\#\$\%\& \!\&quot;\#\$\%\& \!\&quot;\#\$\%\&

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2555,7 +2555,7 @@ fn regression_test_158() { -|- *

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2568,7 +2568,7 @@ fn regression_test_159() {

    Another paragraph whose spaces must be removed.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2583,7 +2583,7 @@ fn regression_test_160() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2598,7 +2598,7 @@ fn regression_test_161() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2608,7 +2608,7 @@ fn regression_test_162() { let expected = r##"

    &#00000000; &#x0000000;

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2618,7 +2618,7 @@ fn regression_test_163() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2634,7 +2634,7 @@ t_ "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2650,7 +2650,7 @@ N* "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2661,7 +2661,7 @@ fn regression_test_166() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2672,7 +2672,7 @@ fn regression_test_167() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2683,7 +2683,7 @@ fn regression_test_168() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2699,7 +2699,7 @@ fn regression_test_169() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2718,7 +2718,7 @@ fn regression_test_170() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2734,7 +2734,7 @@ fn regression_test_171() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2750,7 +2750,7 @@ fn regression_test_172() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2766,7 +2766,7 @@ fn regression_test_173() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2782,7 +2782,7 @@ fn regression_test_174() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2800,7 +2800,7 @@ fn regression_test_175() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2813,7 +2813,7 @@ fn regression_test_176() {

    [link]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2826,7 +2826,7 @@ fn regression_test_177() {

    [link]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2838,7 +2838,7 @@ fn regression_test_178() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2851,7 +2851,7 @@ fn regression_test_179() {

    [link]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2863,7 +2863,7 @@ fn regression_test_180() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2876,7 +2876,7 @@ fn regression_test_181() {

    [link]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2888,7 +2888,7 @@ fn regression_test_182() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2906,7 +2906,7 @@ fn regression_test_183() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2920,7 +2920,7 @@ test2

    test2

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2936,7 +2936,7 @@ test2 "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2953,7 +2953,7 @@ fn regression_test_186() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2973,7 +2973,7 @@ fn regression_test_187() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2986,7 +2986,7 @@ fn regression_test_188() {

    <!p>

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2998,7 +2998,7 @@ fn regression_test_189() { let expected = r##"

    linky

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3014,7 +3014,7 @@ junk

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3026,7 +3026,7 @@ fn regression_test_191() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3037,7 +3037,7 @@ fn regression_test_192() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3051,7 +3051,7 @@ fn regression_test_193() { text ">link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3069,7 +3069,7 @@ _** "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3084,7 +3084,7 @@ fn regression_test_195() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3097,7 +3097,7 @@ fn regression_test_196() {

    --

    "##; - test_markdown_html(original, expected, false, true, false); + test_markdown_html(original, expected, false, true, false, false); } #[test] @@ -3109,7 +3109,7 @@ fn regression_test_197() { [40](https://rust.org/something%3A((((((((((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))))))))))

    "##; - test_markdown_html(original, expected, false, true, false); + test_markdown_html(original, expected, false, true, false, false); } #[test] @@ -3124,7 +3124,7 @@ fn regression_test_198() {

    \

    "##; - test_markdown_html(original, expected, false, true, false); + test_markdown_html(original, expected, false, true, false, false); } #[test] @@ -3140,7 +3140,7 @@ bar

    bar

    "##; - test_markdown_html(original, expected, false, true, false); + test_markdown_html(original, expected, false, true, false, false); } #[test] @@ -3151,7 +3151,7 @@ fn regression_test_200() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3169,7 +3169,7 @@ fn regression_test_201() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3188,7 +3188,7 @@ fn regression_test_202() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3212,7 +3212,7 @@ T U, V W
    x:.)
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3234,7 +3234,7 @@ Some preamble foobar_raz, not barfoo_raz

    > Something is wrong!

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3251,7 +3251,7 @@ stuff](https://example.com) "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3300,7 +3300,7 @@ fn regression_test_206() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3313,5 +3313,5 @@ fn regression_test_207() { > "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/smart_punct.rs b/pulldown-cmark/tests/suite/smart_punct.rs index 327c1046..f4341d2f 100644 --- a/pulldown-cmark/tests/suite/smart_punct.rs +++ b/pulldown-cmark/tests/suite/smart_punct.rs @@ -12,7 +12,7 @@ fn smart_punct_test_1() { “‘Shelob’ is my name.”

    "##; - test_markdown_html(original, expected, true, false, false); + test_markdown_html(original, expected, true, false, false, false); } #[test] @@ -22,7 +22,7 @@ fn smart_punct_test_2() { let expected = r##"

    ‘A’, ‘B’, and ‘C’ are letters.

    "##; - test_markdown_html(original, expected, true, false, false); + test_markdown_html(original, expected, true, false, false, false); } #[test] @@ -34,7 +34,7 @@ So is 'pine.' So is ‘pine.’

    "##; - test_markdown_html(original, expected, true, false, false); + test_markdown_html(original, expected, true, false, false, false); } #[test] @@ -44,7 +44,7 @@ fn smart_punct_test_4() { let expected = r##"

    ‘He said, “I want to go.”’

    "##; - test_markdown_html(original, expected, true, false, false); + test_markdown_html(original, expected, true, false, false, false); } #[test] @@ -54,7 +54,7 @@ fn smart_punct_test_5() { let expected = r##"

    Were you alive in the 70’s?

    "##; - test_markdown_html(original, expected, true, false, false); + test_markdown_html(original, expected, true, false, false, false); } #[test] @@ -64,7 +64,7 @@ fn smart_punct_test_6() { let expected = r##"

    Here is some quoted ‘code’ and a “quoted link”.

    "##; - test_markdown_html(original, expected, true, false, false); + test_markdown_html(original, expected, true, false, false, false); } #[test] @@ -74,7 +74,7 @@ fn smart_punct_test_7() { let expected = r##"

    ’tis the season to be ‘jolly’

    "##; - test_markdown_html(original, expected, true, false, false); + test_markdown_html(original, expected, true, false, false, false); } #[test] @@ -84,7 +84,7 @@ fn smart_punct_test_8() { let expected = r##"

    ‘We’ll use Jane’s boat and John’s truck,’ Jenna said.

    "##; - test_markdown_html(original, expected, true, false, false); + test_markdown_html(original, expected, true, false, false, false); } #[test] @@ -97,7 +97,7 @@ fn smart_punct_test_9() {

    “Second paragraph by same speaker, in fiction.”

    "##; - test_markdown_html(original, expected, true, false, false); + test_markdown_html(original, expected, true, false, false, false); } #[test] @@ -107,7 +107,7 @@ fn smart_punct_test_10() { let expected = r##"

    [a]’s b’

    "##; - test_markdown_html(original, expected, true, false, false); + test_markdown_html(original, expected, true, false, false, false); } #[test] @@ -121,7 +121,7 @@ This isn't either. 5'8"

    "##; - test_markdown_html(original, expected, true, false, false); + test_markdown_html(original, expected, true, false, false, false); } #[test] @@ -139,7 +139,7 @@ en – en 2–3

    "##; - test_markdown_html(original, expected, true, false, false); + test_markdown_html(original, expected, true, false, false, false); } #[test] @@ -167,7 +167,7 @@ nine——— thirteen———––.

    "##; - test_markdown_html(original, expected, true, false, false); + test_markdown_html(original, expected, true, false, false, false); } #[test] @@ -177,7 +177,7 @@ fn smart_punct_test_14() { let expected = r##"

    Escaped hyphens: -- ---.

    "##; - test_markdown_html(original, expected, true, false, false); + test_markdown_html(original, expected, true, false, false, false); } #[test] @@ -187,7 +187,7 @@ fn smart_punct_test_15() { let expected = r##"

    Ellipses…and…and….

    "##; - test_markdown_html(original, expected, true, false, false); + test_markdown_html(original, expected, true, false, false, false); } #[test] @@ -197,5 +197,5 @@ fn smart_punct_test_16() { let expected = r##"

    No ellipses...

    "##; - test_markdown_html(original, expected, true, false, false); + test_markdown_html(original, expected, true, false, false, false); } diff --git a/pulldown-cmark/tests/suite/spec.rs b/pulldown-cmark/tests/suite/spec.rs index 5de624c7..2a5520fb 100644 --- a/pulldown-cmark/tests/suite/spec.rs +++ b/pulldown-cmark/tests/suite/spec.rs @@ -11,7 +11,7 @@ fn spec_test_1() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -22,7 +22,7 @@ fn spec_test_2() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -35,7 +35,7 @@ fn spec_test_3() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -52,7 +52,7 @@ fn spec_test_4() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -70,7 +70,7 @@ fn spec_test_5() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -83,7 +83,7 @@ fn spec_test_6() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -98,7 +98,7 @@ fn spec_test_7() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -111,7 +111,7 @@ bar "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -133,7 +133,7 @@ fn spec_test_9() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -143,7 +143,7 @@ fn spec_test_10() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -153,7 +153,7 @@ fn spec_test_11() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -163,7 +163,7 @@ fn spec_test_12() { let expected = r##"

    !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -173,7 +173,7 @@ fn spec_test_13() { let expected = r##"

    \ \A\a\ \3\φ\«

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -199,7 +199,7 @@ fn spec_test_14() { &ouml; not a character entity

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -209,7 +209,7 @@ fn spec_test_15() { let expected = r##"

    \emphasis

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -221,7 +221,7 @@ bar bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -231,7 +231,7 @@ fn spec_test_17() { let expected = r##"

    \[\`

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -242,7 +242,7 @@ fn spec_test_18() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -255,7 +255,7 @@ fn spec_test_19() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -265,7 +265,7 @@ fn spec_test_20() { let expected = r##"

    https://example.com?find=\*

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -275,7 +275,7 @@ fn spec_test_21() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -285,7 +285,7 @@ fn spec_test_22() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -297,7 +297,7 @@ fn spec_test_23() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -310,7 +310,7 @@ foo "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -324,7 +324,7 @@ fn spec_test_25() { ∲ ≧̸

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -334,7 +334,7 @@ fn spec_test_26() { let expected = r##"

    # Ӓ Ϡ �

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -344,7 +344,7 @@ fn spec_test_27() { let expected = r##"

    " ആ ಫ

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -360,7 +360,7 @@ fn spec_test_28() { &ThisIsNotDefined; &hi?;

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -370,7 +370,7 @@ fn spec_test_29() { let expected = r##"

    &copy

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -380,7 +380,7 @@ fn spec_test_30() { let expected = r##"

    &MadeUpEntity;

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -390,7 +390,7 @@ fn spec_test_31() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -400,7 +400,7 @@ fn spec_test_32() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -412,7 +412,7 @@ fn spec_test_33() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -425,7 +425,7 @@ foo "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -435,7 +435,7 @@ fn spec_test_35() { let expected = r##"

    f&ouml;&ouml;

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -446,7 +446,7 @@ fn spec_test_36() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -458,7 +458,7 @@ fn spec_test_37() { foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -473,7 +473,7 @@ fn spec_test_38() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -485,7 +485,7 @@ fn spec_test_39() { bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -495,7 +495,7 @@ fn spec_test_40() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -505,7 +505,7 @@ fn spec_test_41() { let expected = r##"

    [a](url "tit")

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -519,7 +519,7 @@ fn spec_test_42() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -533,7 +533,7 @@ ___
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -543,7 +543,7 @@ fn spec_test_44() { let expected = r##"

    +++

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -553,7 +553,7 @@ fn spec_test_45() { let expected = r##"

    ===

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -567,7 +567,7 @@ __ __

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -581,7 +581,7 @@ fn spec_test_47() {
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -592,7 +592,7 @@ fn spec_test_48() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -604,7 +604,7 @@ fn spec_test_49() { ***

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -614,7 +614,7 @@ fn spec_test_50() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -624,7 +624,7 @@ fn spec_test_51() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -634,7 +634,7 @@ fn spec_test_52() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -644,7 +644,7 @@ fn spec_test_53() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -654,7 +654,7 @@ fn spec_test_54() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -670,7 +670,7 @@ a------

    ---a---

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -680,7 +680,7 @@ fn spec_test_56() { let expected = r##"

    -

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -698,7 +698,7 @@ fn spec_test_57() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -712,7 +712,7 @@ bar

    bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -725,7 +725,7 @@ bar

    bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -743,7 +743,7 @@ fn spec_test_60() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -759,7 +759,7 @@ fn spec_test_61() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -779,7 +779,7 @@ fn spec_test_62() {
    foo
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -789,7 +789,7 @@ fn spec_test_63() { let expected = r##"

    ####### foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -802,7 +802,7 @@ fn spec_test_64() {

    #hashtag

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -812,7 +812,7 @@ fn spec_test_65() { let expected = r##"

    ## foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -822,7 +822,7 @@ fn spec_test_66() { let expected = r##"

    foo bar *baz*

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -832,7 +832,7 @@ fn spec_test_67() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -846,7 +846,7 @@ fn spec_test_68() {

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -857,7 +857,7 @@ fn spec_test_69() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -869,7 +869,7 @@ fn spec_test_70() { # bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -881,7 +881,7 @@ fn spec_test_71() {

    bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -893,7 +893,7 @@ fn spec_test_72() {
    foo
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -903,7 +903,7 @@ fn spec_test_73() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -913,7 +913,7 @@ fn spec_test_74() { let expected = r##"

    foo ### b

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -923,7 +923,7 @@ fn spec_test_75() { let expected = r##"

    foo#

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -937,7 +937,7 @@ fn spec_test_76() {

    foo #

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -951,7 +951,7 @@ fn spec_test_77() {
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -965,7 +965,7 @@ Bar foo

    Bar foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -979,7 +979,7 @@ fn spec_test_79() {

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -994,7 +994,7 @@ Foo *bar*

    Foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1007,7 +1007,7 @@ baz* baz "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1020,7 +1020,7 @@ baz* baz "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1035,7 +1035,7 @@ Foo

    Foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1054,7 +1054,7 @@ fn spec_test_84() {

    Foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1073,7 +1073,7 @@ Foo
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1084,7 +1084,7 @@ fn spec_test_86() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1096,7 +1096,7 @@ fn spec_test_87() { ---

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1113,7 +1113,7 @@ Foo
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1124,7 +1124,7 @@ fn spec_test_89() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1135,7 +1135,7 @@ fn spec_test_90() { let expected = r##"

    Foo\

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1154,7 +1154,7 @@ of dashes"/>

    of dashes"/>

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1168,7 +1168,7 @@ fn spec_test_92() {
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1184,7 +1184,7 @@ bar "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1198,7 +1198,7 @@ fn spec_test_94() {
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1211,7 +1211,7 @@ Bar Bar "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1229,7 +1229,7 @@ Baz

    Baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1240,7 +1240,7 @@ fn spec_test_97() { let expected = r##"

    ====

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1252,7 +1252,7 @@ fn spec_test_98() {
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1266,7 +1266,7 @@ fn spec_test_99() {
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1279,7 +1279,7 @@ fn spec_test_100() {
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1293,7 +1293,7 @@ fn spec_test_101() {
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1304,7 +1304,7 @@ fn spec_test_102() { let expected = r##"

    > foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1320,7 +1320,7 @@ baz

    baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1338,7 +1338,7 @@ bar

    baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1354,7 +1354,7 @@ bar

    baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1370,7 +1370,7 @@ bar baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1383,7 +1383,7 @@ fn spec_test_107() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1400,7 +1400,7 @@ fn spec_test_108() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1419,7 +1419,7 @@ fn spec_test_109() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1436,7 +1436,7 @@ fn spec_test_110() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1459,7 +1459,7 @@ chunk3 "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1474,7 +1474,7 @@ fn spec_test_112() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1487,7 +1487,7 @@ fn spec_test_113() { bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1500,7 +1500,7 @@ bar

    bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1521,7 +1521,7 @@ Heading
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1534,7 +1534,7 @@ bar "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1549,7 +1549,7 @@ fn spec_test_117() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1560,7 +1560,7 @@ fn spec_test_118() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1575,7 +1575,7 @@ fn spec_test_119() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1590,7 +1590,7 @@ fn spec_test_120() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1602,7 +1602,7 @@ foo let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1617,7 +1617,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1632,7 +1632,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1647,7 +1647,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1662,7 +1662,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1672,7 +1672,7 @@ fn spec_test_126() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1688,7 +1688,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1705,7 +1705,7 @@ bbb

    bbb

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1720,7 +1720,7 @@ fn spec_test_129() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1731,7 +1731,7 @@ fn spec_test_130() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1746,7 +1746,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1763,7 +1763,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1780,7 +1780,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1795,7 +1795,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1808,7 +1808,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1821,7 +1821,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1835,7 +1835,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1847,7 +1847,7 @@ aaa aaa

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1861,7 +1861,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1878,7 +1878,7 @@ baz

    baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1896,7 +1896,7 @@ bar

    baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1913,7 +1913,7 @@ end "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1930,7 +1930,7 @@ end "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1941,7 +1941,7 @@ fn spec_test_144() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1953,7 +1953,7 @@ foo foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1966,7 +1966,7 @@ foo "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -1979,7 +1979,7 @@ fn spec_test_147() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2000,7 +2000,7 @@ _world_. "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2025,7 +2025,7 @@ okay.

    okay.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2039,7 +2039,7 @@ fn spec_test_150() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2051,7 +2051,7 @@ fn spec_test_151() { *foo* "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2067,7 +2067,7 @@ fn spec_test_152() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2081,7 +2081,7 @@ fn spec_test_153() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2095,7 +2095,7 @@ fn spec_test_154() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2110,7 +2110,7 @@ fn spec_test_155() {

    bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2122,7 +2122,7 @@ fn spec_test_156() { *hi* "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2134,7 +2134,7 @@ foo foo "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2146,7 +2146,7 @@ fn spec_test_158() { *foo* "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2156,7 +2156,7 @@ fn spec_test_159() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2170,7 +2170,7 @@ foo "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2186,7 +2186,7 @@ int x = 33; ``` "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2200,7 +2200,7 @@ fn spec_test_162() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2214,7 +2214,7 @@ fn spec_test_163() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2228,7 +2228,7 @@ fn spec_test_164() {
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2240,7 +2240,7 @@ fn spec_test_165() { *bar* "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2254,7 +2254,7 @@ fn spec_test_166() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2270,7 +2270,7 @@ fn spec_test_167() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2280,7 +2280,7 @@ fn spec_test_168() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2302,7 +2302,7 @@ main = print $ parseTags tags

    okay

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2322,7 +2322,7 @@ document.getElementById("demo").innerHTML = "Hello JavaScript!";

    okay

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2344,7 +2344,7 @@ _bar_ "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2366,7 +2366,7 @@ p {color:blue;}

    okay

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2382,7 +2382,7 @@ foo foo "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2399,7 +2399,7 @@ foo

    bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2415,7 +2415,7 @@ fn spec_test_175() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2427,7 +2427,7 @@ fn spec_test_176() {

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2439,7 +2439,7 @@ fn spec_test_177() {

    baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2453,7 +2453,7 @@ foo 1. *bar* "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2471,7 +2471,7 @@ bar

    okay

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2491,7 +2491,7 @@ okay

    okay

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2501,7 +2501,7 @@ fn spec_test_181() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2535,7 +2535,7 @@ function matchwo(a,b)

    okay

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2549,7 +2549,7 @@ fn spec_test_183() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2563,7 +2563,7 @@ fn spec_test_184() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2579,7 +2579,7 @@ bar "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2595,7 +2595,7 @@ bar *foo* "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2609,7 +2609,7 @@ baz baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2625,7 +2625,7 @@ fn spec_test_188() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2639,7 +2639,7 @@ fn spec_test_189() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2665,7 +2665,7 @@ Hi "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2692,7 +2692,7 @@ fn spec_test_191() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2704,7 +2704,7 @@ fn spec_test_192() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2718,7 +2718,7 @@ fn spec_test_193() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2730,7 +2730,7 @@ fn spec_test_194() { let expected = r##"

    Foo*bar]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2744,7 +2744,7 @@ fn spec_test_195() { let expected = r##"

    Foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2764,7 +2764,7 @@ line2 ">foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2780,7 +2780,7 @@ with blank line'

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2793,7 +2793,7 @@ fn spec_test_198() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2806,7 +2806,7 @@ fn spec_test_199() {

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2818,7 +2818,7 @@ fn spec_test_200() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2831,7 +2831,7 @@ fn spec_test_201() {

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2843,7 +2843,7 @@ fn spec_test_202() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2855,7 +2855,7 @@ fn spec_test_203() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2868,7 +2868,7 @@ fn spec_test_204() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2880,7 +2880,7 @@ fn spec_test_205() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2892,7 +2892,7 @@ fn spec_test_206() { let expected = r##"

    αγω

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2901,7 +2901,7 @@ fn spec_test_207() { "##; let expected = r##""##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2914,7 +2914,7 @@ bar let expected = r##"

    bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2924,7 +2924,7 @@ fn spec_test_209() { let expected = r##"

    [foo]: /url "title" ok

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2935,7 +2935,7 @@ fn spec_test_210() { let expected = r##"

    "title" ok

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2949,7 +2949,7 @@ fn spec_test_211() {

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2965,7 +2965,7 @@ fn spec_test_212() {

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2980,7 +2980,7 @@ fn spec_test_213() {

    [bar]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -2995,7 +2995,7 @@ fn spec_test_214() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3009,7 +3009,7 @@ bar

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3022,7 +3022,7 @@ fn spec_test_216() { foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3041,7 +3041,7 @@ fn spec_test_217() { baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3055,7 +3055,7 @@ fn spec_test_218() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3068,7 +3068,7 @@ bbb

    bbb

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3085,7 +3085,7 @@ bbb

    ddd

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3099,7 +3099,7 @@ bbb

    bbb

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3111,7 +3111,7 @@ fn spec_test_222() { bbb

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3125,7 +3125,7 @@ bbb ccc

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3137,7 +3137,7 @@ bbb bbb

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3150,7 +3150,7 @@ bbb

    bbb

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3162,7 +3162,7 @@ bbb bbb

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3180,7 +3180,7 @@ aaa

    aaa

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3196,7 +3196,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3212,7 +3212,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3228,7 +3228,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3243,7 +3243,7 @@ fn spec_test_231() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3259,7 +3259,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3275,7 +3275,7 @@ foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3289,7 +3289,7 @@ fn spec_test_234() {
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3307,7 +3307,7 @@ fn spec_test_235() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3323,7 +3323,7 @@ fn spec_test_236() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3339,7 +3339,7 @@ foo
    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3353,7 +3353,7 @@ fn spec_test_238() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3364,7 +3364,7 @@ fn spec_test_239() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3377,7 +3377,7 @@ fn spec_test_240() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3391,7 +3391,7 @@ fn spec_test_241() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3408,7 +3408,7 @@ fn spec_test_242() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3422,7 +3422,7 @@ bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3437,7 +3437,7 @@ fn spec_test_244() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3451,7 +3451,7 @@ fn spec_test_245() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3469,7 +3469,7 @@ fn spec_test_246() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3483,7 +3483,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3498,7 +3498,7 @@ baz

    baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3513,7 +3513,7 @@ baz

    baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3531,7 +3531,7 @@ bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3551,7 +3551,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3569,7 +3569,7 @@ fn spec_test_252() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3590,7 +3590,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3615,7 +3615,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3630,7 +3630,7 @@ fn spec_test_255() {

    two

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3647,7 +3647,7 @@ fn spec_test_256() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3663,7 +3663,7 @@ fn spec_test_257() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3680,7 +3680,7 @@ fn spec_test_258() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3701,7 +3701,7 @@ fn spec_test_259() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3720,7 +3720,7 @@ fn spec_test_260() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3733,7 +3733,7 @@ fn spec_test_261() {

    2.two

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3751,7 +3751,7 @@ fn spec_test_262() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3779,7 +3779,7 @@ fn spec_test_263() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3803,7 +3803,7 @@ baz "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3815,7 +3815,7 @@ fn spec_test_265() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3825,7 +3825,7 @@ fn spec_test_266() { let expected = r##"

    1234567890. not ok

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3837,7 +3837,7 @@ fn spec_test_267() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3849,7 +3849,7 @@ fn spec_test_268() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3859,7 +3859,7 @@ fn spec_test_269() { let expected = r##"

    -1. not ok

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3877,7 +3877,7 @@ fn spec_test_270() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3895,7 +3895,7 @@ fn spec_test_271() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3913,7 +3913,7 @@ paragraph "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3935,7 +3935,7 @@ fn spec_test_273() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3957,7 +3957,7 @@ fn spec_test_274() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3970,7 +3970,7 @@ bar

    bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -3985,7 +3985,7 @@ fn spec_test_276() {

    bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4002,7 +4002,7 @@ fn spec_test_277() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4029,7 +4029,7 @@ fn spec_test_278() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4042,7 +4042,7 @@ fn spec_test_279() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4057,7 +4057,7 @@ fn spec_test_280() {

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4073,7 +4073,7 @@ fn spec_test_281() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4089,7 +4089,7 @@ fn spec_test_282() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4105,7 +4105,7 @@ fn spec_test_283() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4117,7 +4117,7 @@ fn spec_test_284() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4134,7 +4134,7 @@ foo 1.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4159,7 +4159,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4184,7 +4184,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4209,7 +4209,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4230,7 +4230,7 @@ fn spec_test_289() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4255,7 +4255,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4269,7 +4269,7 @@ with two lines. "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4289,7 +4289,7 @@ continued here.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4309,7 +4309,7 @@ continued here.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4336,7 +4336,7 @@ fn spec_test_294() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4354,7 +4354,7 @@ fn spec_test_295() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4371,7 +4371,7 @@ fn spec_test_296() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4387,7 +4387,7 @@ fn spec_test_297() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4403,7 +4403,7 @@ fn spec_test_298() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4423,7 +4423,7 @@ fn spec_test_299() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4443,7 +4443,7 @@ baz "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4461,7 +4461,7 @@ fn spec_test_301() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4479,7 +4479,7 @@ fn spec_test_302() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4495,7 +4495,7 @@ fn spec_test_303() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4507,7 +4507,7 @@ fn spec_test_304() { 14. The number of doors is 6.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4521,7 +4521,7 @@ fn spec_test_305() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4546,7 +4546,7 @@ fn spec_test_306() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4574,7 +4574,7 @@ fn spec_test_307() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4598,7 +4598,7 @@ fn spec_test_308() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4627,7 +4627,7 @@ fn spec_test_309() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4651,7 +4651,7 @@ fn spec_test_310() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4675,7 +4675,7 @@ fn spec_test_311() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4695,7 +4695,7 @@ fn spec_test_312() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4718,7 +4718,7 @@ fn spec_test_313() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4741,7 +4741,7 @@ fn spec_test_314() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4762,7 +4762,7 @@ fn spec_test_315() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4787,7 +4787,7 @@ fn spec_test_316() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4811,7 +4811,7 @@ fn spec_test_317() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4836,7 +4836,7 @@ fn spec_test_318() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4860,7 +4860,7 @@ fn spec_test_319() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4880,7 +4880,7 @@ fn spec_test_320() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4904,7 +4904,7 @@ fn spec_test_321() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4916,7 +4916,7 @@ fn spec_test_322() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4933,7 +4933,7 @@ fn spec_test_323() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4953,7 +4953,7 @@ fn spec_test_324() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -4974,7 +4974,7 @@ fn spec_test_325() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5005,7 +5005,7 @@ fn spec_test_326() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5015,7 +5015,7 @@ fn spec_test_327() { let expected = r##"

    hilo`

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5025,7 +5025,7 @@ fn spec_test_328() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5035,7 +5035,7 @@ fn spec_test_329() { let expected = r##"

    foo ` bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5045,7 +5045,7 @@ fn spec_test_330() { let expected = r##"

    ``

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5055,7 +5055,7 @@ fn spec_test_331() { let expected = r##"

    ``

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5065,7 +5065,7 @@ fn spec_test_332() { let expected = r##"

    a

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5075,7 +5075,7 @@ fn spec_test_333() { let expected = r##"

     b 

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5087,7 +5087,7 @@ fn spec_test_334() {

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5101,7 +5101,7 @@ baz let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5113,7 +5113,7 @@ foo let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5124,7 +5124,7 @@ baz` let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5134,7 +5134,7 @@ fn spec_test_338() { let expected = r##"

    foo\bar`

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5144,7 +5144,7 @@ fn spec_test_339() { let expected = r##"

    foo`bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5154,7 +5154,7 @@ fn spec_test_340() { let expected = r##"

    foo `` bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5164,7 +5164,7 @@ fn spec_test_341() { let expected = r##"

    *foo*

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5174,7 +5174,7 @@ fn spec_test_342() { let expected = r##"

    [not a link](/foo)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5184,7 +5184,7 @@ fn spec_test_343() { let expected = r##"

    <a href="">`

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5194,7 +5194,7 @@ fn spec_test_344() { let expected = r##"

    `

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5204,7 +5204,7 @@ fn spec_test_345() { let expected = r##"

    <https://foo.bar.baz>`

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5214,7 +5214,7 @@ fn spec_test_346() { let expected = r##"

    https://foo.bar.`baz`

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5224,7 +5224,7 @@ fn spec_test_347() { let expected = r##"

    ```foo``

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5234,7 +5234,7 @@ fn spec_test_348() { let expected = r##"

    `foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5244,7 +5244,7 @@ fn spec_test_349() { let expected = r##"

    `foobar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5254,7 +5254,7 @@ fn spec_test_350() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5264,7 +5264,7 @@ fn spec_test_351() { let expected = r##"

    a * foo bar*

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5274,7 +5274,7 @@ fn spec_test_352() { let expected = r##"

    a*"foo"*

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5284,7 +5284,7 @@ fn spec_test_353() { let expected = r##"

    * a *

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5300,7 +5300,7 @@ fn spec_test_354() {

    *€*charlie.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5310,7 +5310,7 @@ fn spec_test_355() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5320,7 +5320,7 @@ fn spec_test_356() { let expected = r##"

    5678

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5330,7 +5330,7 @@ fn spec_test_357() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5340,7 +5340,7 @@ fn spec_test_358() { let expected = r##"

    _ foo bar_

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5350,7 +5350,7 @@ fn spec_test_359() { let expected = r##"

    a_"foo"_

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5360,7 +5360,7 @@ fn spec_test_360() { let expected = r##"

    foo_bar_

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5370,7 +5370,7 @@ fn spec_test_361() { let expected = r##"

    5_6_78

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5380,7 +5380,7 @@ fn spec_test_362() { let expected = r##"

    пристаням_стремятся_

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5390,7 +5390,7 @@ fn spec_test_363() { let expected = r##"

    aa_"bb"_cc

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5400,7 +5400,7 @@ fn spec_test_364() { let expected = r##"

    foo-(bar)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5410,7 +5410,7 @@ fn spec_test_365() { let expected = r##"

    _foo*

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5420,7 +5420,7 @@ fn spec_test_366() { let expected = r##"

    *foo bar *

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5432,7 +5432,7 @@ fn spec_test_367() { *

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5442,7 +5442,7 @@ fn spec_test_368() { let expected = r##"

    *(*foo)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5452,7 +5452,7 @@ fn spec_test_369() { let expected = r##"

    (foo)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5462,7 +5462,7 @@ fn spec_test_370() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5472,7 +5472,7 @@ fn spec_test_371() { let expected = r##"

    _foo bar _

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5482,7 +5482,7 @@ fn spec_test_372() { let expected = r##"

    _(_foo)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5492,7 +5492,7 @@ fn spec_test_373() { let expected = r##"

    (foo)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5502,7 +5502,7 @@ fn spec_test_374() { let expected = r##"

    _foo_bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5512,7 +5512,7 @@ fn spec_test_375() { let expected = r##"

    _пристаням_стремятся

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5522,7 +5522,7 @@ fn spec_test_376() { let expected = r##"

    foo_bar_baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5532,7 +5532,7 @@ fn spec_test_377() { let expected = r##"

    (bar).

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5542,7 +5542,7 @@ fn spec_test_378() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5552,7 +5552,7 @@ fn spec_test_379() { let expected = r##"

    ** foo bar**

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5562,7 +5562,7 @@ fn spec_test_380() { let expected = r##"

    a**"foo"**

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5572,7 +5572,7 @@ fn spec_test_381() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5582,7 +5582,7 @@ fn spec_test_382() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5592,7 +5592,7 @@ fn spec_test_383() { let expected = r##"

    __ foo bar__

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5604,7 +5604,7 @@ foo bar__ foo bar__

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5614,7 +5614,7 @@ fn spec_test_385() { let expected = r##"

    a__"foo"__

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5624,7 +5624,7 @@ fn spec_test_386() { let expected = r##"

    foo__bar__

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5634,7 +5634,7 @@ fn spec_test_387() { let expected = r##"

    5__6__78

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5644,7 +5644,7 @@ fn spec_test_388() { let expected = r##"

    пристаням__стремятся__

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5654,7 +5654,7 @@ fn spec_test_389() { let expected = r##"

    foo, bar, baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5664,7 +5664,7 @@ fn spec_test_390() { let expected = r##"

    foo-(bar)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5674,7 +5674,7 @@ fn spec_test_391() { let expected = r##"

    **foo bar **

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5684,7 +5684,7 @@ fn spec_test_392() { let expected = r##"

    **(**foo)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5694,7 +5694,7 @@ fn spec_test_393() { let expected = r##"

    (foo)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5706,7 +5706,7 @@ fn spec_test_394() { Asclepias physocarpa)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5716,7 +5716,7 @@ fn spec_test_395() { let expected = r##"

    foo "bar" foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5726,7 +5726,7 @@ fn spec_test_396() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5736,7 +5736,7 @@ fn spec_test_397() { let expected = r##"

    __foo bar __

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5746,7 +5746,7 @@ fn spec_test_398() { let expected = r##"

    __(__foo)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5756,7 +5756,7 @@ fn spec_test_399() { let expected = r##"

    (foo)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5766,7 +5766,7 @@ fn spec_test_400() { let expected = r##"

    __foo__bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5776,7 +5776,7 @@ fn spec_test_401() { let expected = r##"

    __пристаням__стремятся

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5786,7 +5786,7 @@ fn spec_test_402() { let expected = r##"

    foo__bar__baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5796,7 +5796,7 @@ fn spec_test_403() { let expected = r##"

    (bar).

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5806,7 +5806,7 @@ fn spec_test_404() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5818,7 +5818,7 @@ bar* bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5828,7 +5828,7 @@ fn spec_test_406() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5838,7 +5838,7 @@ fn spec_test_407() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5848,7 +5848,7 @@ fn spec_test_408() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5858,7 +5858,7 @@ fn spec_test_409() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5868,7 +5868,7 @@ fn spec_test_410() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5878,7 +5878,7 @@ fn spec_test_411() { let expected = r##"

    foobarbaz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5888,7 +5888,7 @@ fn spec_test_412() { let expected = r##"

    foo**bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5898,7 +5898,7 @@ fn spec_test_413() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5908,7 +5908,7 @@ fn spec_test_414() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5918,7 +5918,7 @@ fn spec_test_415() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5928,7 +5928,7 @@ fn spec_test_416() { let expected = r##"

    foobarbaz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5938,7 +5938,7 @@ fn spec_test_417() { let expected = r##"

    foobar***baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5948,7 +5948,7 @@ fn spec_test_418() { let expected = r##"

    foo bar baz bim bop

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5958,7 +5958,7 @@ fn spec_test_419() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5968,7 +5968,7 @@ fn spec_test_420() { let expected = r##"

    ** is not an empty emphasis

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5978,7 +5978,7 @@ fn spec_test_421() { let expected = r##"

    **** is not an empty strong emphasis

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -5988,7 +5988,7 @@ fn spec_test_422() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6000,7 +6000,7 @@ bar** bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6010,7 +6010,7 @@ fn spec_test_424() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6020,7 +6020,7 @@ fn spec_test_425() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6030,7 +6030,7 @@ fn spec_test_426() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6040,7 +6040,7 @@ fn spec_test_427() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6050,7 +6050,7 @@ fn spec_test_428() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6060,7 +6060,7 @@ fn spec_test_429() { let expected = r##"

    foobarbaz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6070,7 +6070,7 @@ fn spec_test_430() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6080,7 +6080,7 @@ fn spec_test_431() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6092,7 +6092,7 @@ bim* bop** bim bop

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6102,7 +6102,7 @@ fn spec_test_433() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6112,7 +6112,7 @@ fn spec_test_434() { let expected = r##"

    __ is not an empty emphasis

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6122,7 +6122,7 @@ fn spec_test_435() { let expected = r##"

    ____ is not an empty strong emphasis

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6132,7 +6132,7 @@ fn spec_test_436() { let expected = r##"

    foo ***

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6142,7 +6142,7 @@ fn spec_test_437() { let expected = r##"

    foo *

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6152,7 +6152,7 @@ fn spec_test_438() { let expected = r##"

    foo _

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6162,7 +6162,7 @@ fn spec_test_439() { let expected = r##"

    foo *****

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6172,7 +6172,7 @@ fn spec_test_440() { let expected = r##"

    foo *

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6182,7 +6182,7 @@ fn spec_test_441() { let expected = r##"

    foo _

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6192,7 +6192,7 @@ fn spec_test_442() { let expected = r##"

    *foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6202,7 +6202,7 @@ fn spec_test_443() { let expected = r##"

    foo*

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6212,7 +6212,7 @@ fn spec_test_444() { let expected = r##"

    *foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6222,7 +6222,7 @@ fn spec_test_445() { let expected = r##"

    ***foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6232,7 +6232,7 @@ fn spec_test_446() { let expected = r##"

    foo*

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6242,7 +6242,7 @@ fn spec_test_447() { let expected = r##"

    foo***

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6252,7 +6252,7 @@ fn spec_test_448() { let expected = r##"

    foo ___

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6262,7 +6262,7 @@ fn spec_test_449() { let expected = r##"

    foo _

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6272,7 +6272,7 @@ fn spec_test_450() { let expected = r##"

    foo *

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6282,7 +6282,7 @@ fn spec_test_451() { let expected = r##"

    foo _____

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6292,7 +6292,7 @@ fn spec_test_452() { let expected = r##"

    foo _

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6302,7 +6302,7 @@ fn spec_test_453() { let expected = r##"

    foo *

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6312,7 +6312,7 @@ fn spec_test_454() { let expected = r##"

    _foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6322,7 +6322,7 @@ fn spec_test_455() { let expected = r##"

    foo_

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6332,7 +6332,7 @@ fn spec_test_456() { let expected = r##"

    _foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6342,7 +6342,7 @@ fn spec_test_457() { let expected = r##"

    ___foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6352,7 +6352,7 @@ fn spec_test_458() { let expected = r##"

    foo_

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6362,7 +6362,7 @@ fn spec_test_459() { let expected = r##"

    foo___

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6372,7 +6372,7 @@ fn spec_test_460() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6382,7 +6382,7 @@ fn spec_test_461() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6392,7 +6392,7 @@ fn spec_test_462() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6402,7 +6402,7 @@ fn spec_test_463() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6412,7 +6412,7 @@ fn spec_test_464() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6422,7 +6422,7 @@ fn spec_test_465() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6432,7 +6432,7 @@ fn spec_test_466() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6442,7 +6442,7 @@ fn spec_test_467() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6452,7 +6452,7 @@ fn spec_test_468() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6462,7 +6462,7 @@ fn spec_test_469() { let expected = r##"

    foo _bar baz_

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6472,7 +6472,7 @@ fn spec_test_470() { let expected = r##"

    foo bar *baz bim bam

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6482,7 +6482,7 @@ fn spec_test_471() { let expected = r##"

    **foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6492,7 +6492,7 @@ fn spec_test_472() { let expected = r##"

    *foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6502,7 +6502,7 @@ fn spec_test_473() { let expected = r##"

    *bar*

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6512,7 +6512,7 @@ fn spec_test_474() { let expected = r##"

    _foo bar_

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6522,7 +6522,7 @@ fn spec_test_475() { let expected = r##"

    *

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6532,7 +6532,7 @@ fn spec_test_476() { let expected = r##"

    **

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6542,7 +6542,7 @@ fn spec_test_477() { let expected = r##"

    __

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6552,7 +6552,7 @@ fn spec_test_478() { let expected = r##"

    a *

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6562,7 +6562,7 @@ fn spec_test_479() { let expected = r##"

    a _

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6572,7 +6572,7 @@ fn spec_test_480() { let expected = r##"

    **ahttps://foo.bar/?q=**

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6582,7 +6582,7 @@ fn spec_test_481() { let expected = r##"

    __ahttps://foo.bar/?q=__

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6592,7 +6592,7 @@ fn spec_test_482() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6602,7 +6602,7 @@ fn spec_test_483() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6612,7 +6612,7 @@ fn spec_test_484() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6622,7 +6622,7 @@ fn spec_test_485() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6632,7 +6632,7 @@ fn spec_test_486() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6642,7 +6642,7 @@ fn spec_test_487() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6652,7 +6652,7 @@ fn spec_test_488() { let expected = r##"

    [link](/my uri)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6662,7 +6662,7 @@ fn spec_test_489() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6674,7 +6674,7 @@ bar) bar)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6686,7 +6686,7 @@ bar>) bar>)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6696,7 +6696,7 @@ fn spec_test_492() { let expected = r##"

    a

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6706,7 +6706,7 @@ fn spec_test_493() { let expected = r##"

    [link](<foo>)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6720,7 +6720,7 @@ fn spec_test_494() { [a](c)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6730,7 +6730,7 @@ fn spec_test_495() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6740,7 +6740,7 @@ fn spec_test_496() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6750,7 +6750,7 @@ fn spec_test_497() { let expected = r##"

    [link](foo(and(bar))

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6760,7 +6760,7 @@ fn spec_test_498() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6770,7 +6770,7 @@ fn spec_test_499() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6780,7 +6780,7 @@ fn spec_test_500() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6796,7 +6796,7 @@ fn spec_test_501() {

    link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6806,7 +6806,7 @@ fn spec_test_502() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6816,7 +6816,7 @@ fn spec_test_503() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6826,7 +6826,7 @@ fn spec_test_504() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6840,7 +6840,7 @@ fn spec_test_505() { link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6850,7 +6850,7 @@ fn spec_test_506() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6860,7 +6860,7 @@ fn spec_test_507() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6870,7 +6870,7 @@ fn spec_test_508() { let expected = r##"

    [link](/url "title "and" title")

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6880,7 +6880,7 @@ fn spec_test_509() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6891,7 +6891,7 @@ fn spec_test_510() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6901,7 +6901,7 @@ fn spec_test_511() { let expected = r##"

    [link] (/uri)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6911,7 +6911,7 @@ fn spec_test_512() { let expected = r##"

    link [foo [bar]]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6921,7 +6921,7 @@ fn spec_test_513() { let expected = r##"

    [link] bar](/uri)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6931,7 +6931,7 @@ fn spec_test_514() { let expected = r##"

    [link bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6941,7 +6941,7 @@ fn spec_test_515() { let expected = r##"

    link [bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6951,7 +6951,7 @@ fn spec_test_516() { let expected = r##"

    link foo bar #

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6961,7 +6961,7 @@ fn spec_test_517() { let expected = r##"

    moon

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6971,7 +6971,7 @@ fn spec_test_518() { let expected = r##"

    [foo bar](/uri)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6981,7 +6981,7 @@ fn spec_test_519() { let expected = r##"

    [foo [bar baz](/uri)](/uri)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -6991,7 +6991,7 @@ fn spec_test_520() { let expected = r##"

    [foo](uri2)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7001,7 +7001,7 @@ fn spec_test_521() { let expected = r##"

    *foo*

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7011,7 +7011,7 @@ fn spec_test_522() { let expected = r##"

    foo *bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7021,7 +7021,7 @@ fn spec_test_523() { let expected = r##"

    foo [bar baz]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7031,7 +7031,7 @@ fn spec_test_524() { let expected = r##"

    [foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7041,7 +7041,7 @@ fn spec_test_525() { let expected = r##"

    [foo](/uri)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7051,7 +7051,7 @@ fn spec_test_526() { let expected = r##"

    [foohttps://example.com/?search=](uri)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7063,7 +7063,7 @@ fn spec_test_527() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7075,7 +7075,7 @@ fn spec_test_528() { let expected = r##"

    link [foo [bar]]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7087,7 +7087,7 @@ fn spec_test_529() { let expected = r##"

    link [bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7099,7 +7099,7 @@ fn spec_test_530() { let expected = r##"

    link foo bar #

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7111,7 +7111,7 @@ fn spec_test_531() { let expected = r##"

    moon

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7123,7 +7123,7 @@ fn spec_test_532() { let expected = r##"

    [foo bar]ref

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7135,7 +7135,7 @@ fn spec_test_533() { let expected = r##"

    [foo bar baz]ref

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7147,7 +7147,7 @@ fn spec_test_534() { let expected = r##"

    *foo*

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7159,7 +7159,7 @@ fn spec_test_535() { let expected = r##"

    foo *bar*

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7171,7 +7171,7 @@ fn spec_test_536() { let expected = r##"

    [foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7183,7 +7183,7 @@ fn spec_test_537() { let expected = r##"

    [foo][ref]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7195,7 +7195,7 @@ fn spec_test_538() { let expected = r##"

    [foohttps://example.com/?search=][ref]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7207,7 +7207,7 @@ fn spec_test_539() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7219,7 +7219,7 @@ fn spec_test_540() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7232,7 +7232,7 @@ fn spec_test_541() { let expected = r##"

    Baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7244,7 +7244,7 @@ fn spec_test_542() { let expected = r##"

    [foo] bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7258,7 +7258,7 @@ fn spec_test_543() { bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7272,7 +7272,7 @@ fn spec_test_544() { let expected = r##"

    bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7284,7 +7284,7 @@ fn spec_test_545() { let expected = r##"

    [bar][foo!]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7297,7 +7297,7 @@ fn spec_test_546() {

    [ref[]: /uri

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7310,7 +7310,7 @@ fn spec_test_547() {

    [ref[bar]]: /uri

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7323,7 +7323,7 @@ fn spec_test_548() {

    [[[foo]]]: /url

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7335,7 +7335,7 @@ fn spec_test_549() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7347,7 +7347,7 @@ fn spec_test_550() { let expected = r##"

    bar\

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7360,7 +7360,7 @@ fn spec_test_551() {

    []: /uri

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7377,7 +7377,7 @@ fn spec_test_552() { ]: /uri

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7389,7 +7389,7 @@ fn spec_test_553() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7401,7 +7401,7 @@ fn spec_test_554() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7413,7 +7413,7 @@ fn spec_test_555() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7427,7 +7427,7 @@ fn spec_test_556() { []

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7439,7 +7439,7 @@ fn spec_test_557() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7451,7 +7451,7 @@ fn spec_test_558() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7463,7 +7463,7 @@ fn spec_test_559() { let expected = r##"

    [foo bar]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7475,7 +7475,7 @@ fn spec_test_560() { let expected = r##"

    [[bar foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7487,7 +7487,7 @@ fn spec_test_561() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7499,7 +7499,7 @@ fn spec_test_562() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7511,7 +7511,7 @@ fn spec_test_563() { let expected = r##"

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7523,7 +7523,7 @@ fn spec_test_564() { let expected = r##"

    *foo*

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7536,7 +7536,7 @@ fn spec_test_565() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7548,7 +7548,7 @@ fn spec_test_566() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7560,7 +7560,7 @@ fn spec_test_567() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7572,7 +7572,7 @@ fn spec_test_568() { let expected = r##"

    foo(not a link)

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7584,7 +7584,7 @@ fn spec_test_569() { let expected = r##"

    [foo]bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7597,7 +7597,7 @@ fn spec_test_570() { let expected = r##"

    foobaz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7610,7 +7610,7 @@ fn spec_test_571() { let expected = r##"

    [foo]bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7620,7 +7620,7 @@ fn spec_test_572() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7632,7 +7632,7 @@ fn spec_test_573() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7642,7 +7642,7 @@ fn spec_test_574() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7652,7 +7652,7 @@ fn spec_test_575() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7664,7 +7664,7 @@ fn spec_test_576() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7676,7 +7676,7 @@ fn spec_test_577() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7686,7 +7686,7 @@ fn spec_test_578() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7696,7 +7696,7 @@ fn spec_test_579() { let expected = r##"

    My foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7706,7 +7706,7 @@ fn spec_test_580() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7716,7 +7716,7 @@ fn spec_test_581() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7728,7 +7728,7 @@ fn spec_test_582() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7740,7 +7740,7 @@ fn spec_test_583() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7752,7 +7752,7 @@ fn spec_test_584() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7764,7 +7764,7 @@ fn spec_test_585() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7776,7 +7776,7 @@ fn spec_test_586() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7790,7 +7790,7 @@ fn spec_test_587() { []

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7802,7 +7802,7 @@ fn spec_test_588() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7814,7 +7814,7 @@ fn spec_test_589() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7827,7 +7827,7 @@ fn spec_test_590() {

    [[foo]]: /url "title"

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7839,7 +7839,7 @@ fn spec_test_591() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7851,7 +7851,7 @@ fn spec_test_592() { let expected = r##"

    ![foo]

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7863,7 +7863,7 @@ fn spec_test_593() { let expected = r##"

    !foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7873,7 +7873,7 @@ fn spec_test_594() { let expected = r##"

    http://foo.bar.baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7883,7 +7883,7 @@ fn spec_test_595() { let expected = r##"

    https://foo.bar.baz/test?q=hello&id=22&boolean

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7893,7 +7893,7 @@ fn spec_test_596() { let expected = r##"

    irc://foo.bar:2233/baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7903,7 +7903,7 @@ fn spec_test_597() { let expected = r##"

    MAILTO:FOO@BAR.BAZ

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7913,7 +7913,7 @@ fn spec_test_598() { let expected = r##"

    a+b+c:d

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7923,7 +7923,7 @@ fn spec_test_599() { let expected = r##"

    made-up-scheme://foo,bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7933,7 +7933,7 @@ fn spec_test_600() { let expected = r##"

    https://../

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7943,7 +7943,7 @@ fn spec_test_601() { let expected = r##"

    localhost:5001/foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7953,7 +7953,7 @@ fn spec_test_602() { let expected = r##"

    <https://foo.bar/baz bim>

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7963,7 +7963,7 @@ fn spec_test_603() { let expected = r##"

    https://example.com/\[\

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7973,7 +7973,7 @@ fn spec_test_604() { let expected = r##"

    foo@bar.example.com

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7983,7 +7983,7 @@ fn spec_test_605() { let expected = r##"

    foo+special@Bar.baz-bar0.com

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -7993,7 +7993,7 @@ fn spec_test_606() { let expected = r##"

    <foo+@bar.example.com>

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8003,7 +8003,7 @@ fn spec_test_607() { let expected = r##"

    <>

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8013,7 +8013,7 @@ fn spec_test_608() { let expected = r##"

    < https://foo.bar >

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8023,7 +8023,7 @@ fn spec_test_609() { let expected = r##"

    <m:abc>

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8033,7 +8033,7 @@ fn spec_test_610() { let expected = r##"

    <foo.bar.baz>

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8043,7 +8043,7 @@ fn spec_test_611() { let expected = r##"

    https://example.com

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8053,7 +8053,7 @@ fn spec_test_612() { let expected = r##"

    foo@bar.example.com

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8063,7 +8063,7 @@ fn spec_test_613() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8073,7 +8073,7 @@ fn spec_test_614() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8085,7 +8085,7 @@ data="foo" > data="foo" >

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8097,7 +8097,7 @@ _boolean zoop:33=zoop:33 /> _boolean zoop:33=zoop:33 />

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8107,7 +8107,7 @@ fn spec_test_617() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8117,7 +8117,7 @@ fn spec_test_618() { let expected = r##"

    <33> <__>

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8127,7 +8127,7 @@ fn spec_test_619() { let expected = r##"

    <a h*#ref="hi">

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8137,7 +8137,7 @@ fn spec_test_620() { let expected = r##"

    <a href="hi'> <a href=hi'>

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8153,7 +8153,7 @@ foo><bar/ > bim!bop />

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8163,7 +8163,7 @@ fn spec_test_622() { let expected = r##"

    <a href='bar'title=title>

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8173,7 +8173,7 @@ fn spec_test_623() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8183,7 +8183,7 @@ fn spec_test_624() { let expected = r##"

    </a href="foo">

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8195,7 +8195,7 @@ comment - with hyphens --> comment - with hyphens -->

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8208,7 +8208,7 @@ foo foo -->

    foo foo -->

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8218,7 +8218,7 @@ fn spec_test_627() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8228,7 +8228,7 @@ fn spec_test_628() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8238,7 +8238,7 @@ fn spec_test_629() { let expected = r##"

    foo &<]]>

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8248,7 +8248,7 @@ fn spec_test_630() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8258,7 +8258,7 @@ fn spec_test_631() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8268,7 +8268,7 @@ fn spec_test_632() { let expected = r##"

    <a href=""">

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8280,7 +8280,7 @@ baz baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8292,7 +8292,7 @@ baz baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8304,7 +8304,7 @@ baz baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8316,7 +8316,7 @@ fn spec_test_636() { bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8328,7 +8328,7 @@ fn spec_test_637() { bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8340,7 +8340,7 @@ bar* bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8352,7 +8352,7 @@ bar* bar

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8363,7 +8363,7 @@ span` let expected = r##"

    code span

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8374,7 +8374,7 @@ span` let expected = r##"

    code\ span

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8386,7 +8386,7 @@ bar"> bar">

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8398,7 +8398,7 @@ bar"> bar">

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8408,7 +8408,7 @@ fn spec_test_644() { let expected = r##"

    foo\

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8418,7 +8418,7 @@ fn spec_test_645() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8428,7 +8428,7 @@ fn spec_test_646() { let expected = r##"

    foo\

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8438,7 +8438,7 @@ fn spec_test_647() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8450,7 +8450,7 @@ baz baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8462,7 +8462,7 @@ fn spec_test_649() { baz

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8472,7 +8472,7 @@ fn spec_test_650() { let expected = r##"

    hello $.;'there

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8482,7 +8482,7 @@ fn spec_test_651() { let expected = r##"

    Foo χρῆν

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -8492,5 +8492,5 @@ fn spec_test_652() { let expected = r##"

    Multiple spaces

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/strikethrough.rs b/pulldown-cmark/tests/suite/strikethrough.rs index 95cb1e27..621ed179 100644 --- a/pulldown-cmark/tests/suite/strikethrough.rs +++ b/pulldown-cmark/tests/suite/strikethrough.rs @@ -10,7 +10,7 @@ fn strikethrough_test_1() { let expected = r##"

    This is stricken out

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -20,7 +20,7 @@ fn strikethrough_test_2() { let expected = r##"

    This is ~~stricken

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -30,7 +30,7 @@ fn strikethrough_test_3() { let expected = r##"

    Thisisstricken

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -40,7 +40,7 @@ fn strikethrough_test_4() { let expected = r##"

    Thisisstricken

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -50,7 +50,27 @@ fn strikethrough_test_5() { let expected = r##"

    Here I strike out an exclamation point!.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); +} + +#[test] +fn strikethrough_test_6() { + let original = r##"~This is stricken out~ +"##; + let expected = r##"

    This is stricken out

    +"##; + + test_markdown_html(original, expected, false, false, false, false); +} + +#[test] +fn strikethrough_test_7() { + let original = r##"~This is \~stricken~ +"##; + let expected = r##"

    This is ~stricken

    +"##; + + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -60,7 +80,17 @@ fn strikethrough_test_8() { let expected = r##"

    This~is~nothing

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); +} + +#[test] +fn strikethrough_test_9() { + let original = r##"~This~is~nothing~ +"##; + let expected = r##"

    This~is~nothing

    +"##; + + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -70,7 +100,7 @@ fn strikethrough_test_10() { let expected = r##"

    Here I fail to strike out an exclamation point~!~.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -80,7 +110,7 @@ fn strikethrough_test_11() { let expected = r##"

    Here I fail to strike out a tilde ~~~.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -90,7 +120,7 @@ fn strikethrough_test_12() { let expected = r##"

    Here I fail to match up ~~tildes~.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -100,7 +130,7 @@ fn strikethrough_test_13() { let expected = r##"

    Here I fail to match up ~tildes~~.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -110,5 +140,15 @@ fn strikethrough_test_14() { let expected = r##"

    This ~is stricken.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); +} + +#[test] +fn strikethrough_test_15() { + let original = r##"~This ~~is stricken.~ +"##; + let expected = r##"

    This ~~is stricken.

    +"##; + + test_markdown_html(original, expected, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/super_sub.rs b/pulldown-cmark/tests/suite/super_sub.rs index ad8027d1..6cf84261 100644 --- a/pulldown-cmark/tests/suite/super_sub.rs +++ b/pulldown-cmark/tests/suite/super_sub.rs @@ -4,61 +4,61 @@ use super::test_markdown_html; #[test] -fn super_sub_test_0() { +fn super_sub_test_1() { let original = r##"^This is super^ ~This is sub~ "##; let expected = r##"

    This is super This is sub

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, true); } #[test] -fn super_sub_test_6() { +fn super_sub_test_2() { let original = r##"~This is stricken out~ "##; let expected = r##"

    This is stricken out

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, true); } #[test] -fn super_sub_test_7() { +fn super_sub_test_3() { let original = r##"~This is \~stricken~ "##; let expected = r##"

    This is ~stricken

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, true); } #[test] -fn super_sub_test_9() { +fn super_sub_test_4() { let original = r##"~This~is~nothing~ "##; let expected = r##"

    This~is~nothing

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, true); } #[test] -fn super_sub_test_15() { +fn super_sub_test_5() { let original = r##"~This ~~is stricken.~ "##; let expected = r##"

    This ~~is stricken.

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, true); } #[test] -fn super_sub_test_16() { +fn super_sub_test_6() { let original = r##"~This ~~is stricken~ but this is not~~ "##; let expected = r##"

    This ~~is stricken but this is not~~

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, true); } diff --git a/pulldown-cmark/tests/suite/table.rs b/pulldown-cmark/tests/suite/table.rs index 6cc378ad..97d7b06d 100644 --- a/pulldown-cmark/tests/suite/table.rs +++ b/pulldown-cmark/tests/suite/table.rs @@ -11,7 +11,7 @@ fn table_test_1() { let expected = r##"

    Test header

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -23,7 +23,7 @@ fn table_test_2() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -44,7 +44,7 @@ fn table_test_3() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -71,7 +71,7 @@ fn table_test_4() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -87,7 +87,7 @@ fn table_test_5() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -103,7 +103,7 @@ fn table_test_6() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -119,7 +119,7 @@ fn table_test_7() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -135,7 +135,7 @@ fn table_test_8() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -161,7 +161,7 @@ fn table_test_9() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -173,7 +173,7 @@ fn table_test_10() { |ぃ|い|

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -187,7 +187,7 @@ fn table_test_11() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -201,7 +201,7 @@ fn table_test_12() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -302,7 +302,7 @@ b

    b

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -316,7 +316,7 @@ fn table_test_14() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -332,7 +332,7 @@ fn table_test_15() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -348,7 +348,7 @@ fn table_test_16() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -398,7 +398,7 @@ fn table_test_17() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -436,7 +436,7 @@ fn table_test_18() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -466,7 +466,7 @@ fn table_test_19() { | Not | Enough |

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -480,7 +480,7 @@ fn table_test_20() {

    |

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -494,7 +494,7 @@ fn table_test_21() { | Table | Body |

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -516,7 +516,7 @@ fn table_test_22() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -542,7 +542,7 @@ fn table_test_23() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -564,7 +564,7 @@ A: Interrupting —?

    "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -578,7 +578,7 @@ fn table_test_25() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -592,7 +592,7 @@ fn table_test_26() { "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -610,7 +610,7 @@ moo | moo "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } #[test] @@ -628,5 +628,5 @@ moo | moo "##; - test_markdown_html(original, expected, false, false, false); + test_markdown_html(original, expected, false, false, false, false); } From 68197a394f1900a3362f6ec72ce2fe10ef35feb8 Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Mon, 25 Nov 2024 13:03:22 +0000 Subject: [PATCH 066/180] correct simd errors --- pulldown-cmark/src/firstpass.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index df1e10b5..a9f652d4 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -2615,11 +2615,11 @@ mod simd { add_lookup_byte(&mut lookup, b'|'); } if options.contains(Options::ENABLE_STRIKETHROUGH) - || options.contains(Options::ENABLE_SUPER_SUB) + || options.contains(Options::ENABLE_SUBSCRIPT) { add_lookup_byte(&mut lookup, b'~'); } - if options.contains(Options::ENABLE_SUPER_SUB) { + if options.contains(Options::ENABLE_SUPERSCRIPT) { add_lookup_byte(&mut lookup, b'^'); } if options.contains(Options::ENABLE_MATH) { @@ -2777,7 +2777,7 @@ mod simd { opts.insert(Options::ENABLE_TABLES); opts.insert(Options::ENABLE_FOOTNOTES); opts.insert(Options::ENABLE_STRIKETHROUGH); - opts.insert(Options::ENABLE_SUPER_SUB); + opts.insert(Options::ENABLE_SUPERSCRIPT); opts.insert(Options::ENABLE_TASKLISTS); let lut = create_lut(&opts); @@ -2819,7 +2819,7 @@ mod simd { #[test] fn exhaustive_search() { let chars = [ - b'\n', b'\r', b'*', b'_', b'~', b'|', b'&', b'\\', b'[', b']', b'<', b'!', b'`', + b'\n', b'\r', b'*', b'_', b'~', b'^', b'|', b'&', b'\\', b'[', b']', b'<', b'!', b'`', b'$', b'{', b'}', ]; From dbffb44fa9f706cd69f13fff324795bbd38885b4 Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Mon, 25 Nov 2024 13:53:47 +0000 Subject: [PATCH 067/180] fmt --- pulldown-cmark/src/firstpass.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index a9f652d4..2d4b4946 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -2819,8 +2819,8 @@ mod simd { #[test] fn exhaustive_search() { let chars = [ - b'\n', b'\r', b'*', b'_', b'~', b'^', b'|', b'&', b'\\', b'[', b']', b'<', b'!', b'`', - b'$', b'{', b'}', + b'\n', b'\r', b'*', b'_', b'~', b'^', b'|', b'&', b'\\', b'[', b']', b'<', b'!', + b'`', b'$', b'{', b'}', ]; for &c in &chars { From 66c907accd5db14ac270a150fa86b4b5d9ed559a Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Fri, 13 Dec 2024 21:18:15 +0200 Subject: [PATCH 068/180] Add optional simd feature to bench & fuzz --- bench/Cargo.toml | 3 +++ fuzz/Cargo.toml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/bench/Cargo.toml b/bench/Cargo.toml index 21938218..13be69d1 100644 --- a/bench/Cargo.toml +++ b/bench/Cargo.toml @@ -19,5 +19,8 @@ harness = false [dependencies] pulldown-cmark = { path = "../pulldown-cmark" } +[features] +simd = [ "pulldown-cmark/simd" ] + [dev-dependencies] criterion = "0.5.1" diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 9b39e32d..f53a8778 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -22,6 +22,9 @@ urlencoding = "2.1.2" [dependencies.pulldown-cmark] path = "../pulldown-cmark" +[features] +simd = [ "pulldown-cmark/simd" ] + [[bin]] name = "parse" path = "fuzz_targets/parse.rs" From 2f0cf80cf2fca263a6e216e6c9b720123a15b1f9 Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Fri, 13 Dec 2024 21:19:33 +0200 Subject: [PATCH 069/180] Check shift amount explicitly instead of wrapping --- pulldown-cmark/src/firstpass.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 2d4b4946..557ca973 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -2722,7 +2722,11 @@ mod simd { match callback(offset, *bytes.get_unchecked(offset)) { LoopInstruction::ContinueAndSkip(skip) => { offset += skip + 1; - mask = mask.wrapping_shr((skip + 1 + mask_ix) as u32); + let shift = skip + 1 + mask_ix; + if shift >= 32 { + break; + } + mask >>= shift; } LoopInstruction::BreakAtWith(ix, val) => return Err((ix, val)), } From e664fab488d6eaf0bd2f0a2c19d42d45571d439f Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Fri, 13 Dec 2024 21:38:34 +0200 Subject: [PATCH 070/180] Add regression test for wrapping shift issue --- pulldown-cmark/tests/errors.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pulldown-cmark/tests/errors.rs b/pulldown-cmark/tests/errors.rs index b194bcb1..c5055f5b 100644 --- a/pulldown-cmark/tests/errors.rs +++ b/pulldown-cmark/tests/errors.rs @@ -138,3 +138,8 @@ fn test_bad_slice_b() { fn test_bad_slice_unicode() { parse(">
    ") } + +#[test] +fn test_simd_wrapping_shr_issue_651() { + parse("`````````````````````````````````x`"); +} From 420b729035ddb186d0c088caa791db6dca15cd97 Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Fri, 13 Dec 2024 15:22:15 -0800 Subject: [PATCH 071/180] impl wikilinks --- guide/src/SUMMARY.md | 2 + guide/src/examples/wikilink-prefix.md | 5 + pulldown-cmark/Cargo.toml | 5 + pulldown-cmark/build.rs | 23 +- pulldown-cmark/examples/wikilink-prefix.rs | 40 + pulldown-cmark/specs/wikilinks.txt | 69 + pulldown-cmark/src/firstpass.rs | 10 +- pulldown-cmark/src/lib.rs | 4 + pulldown-cmark/src/parse.rs | 135 +- pulldown-cmark/src/scanners.rs | 19 + pulldown-cmark/tests/lib.rs | 4 + .../tests/suite/blockquotes_tags.rs | 36 +- .../tests/suite/definition_lists.rs | 54 +- pulldown-cmark/tests/suite/footnotes.rs | 52 +- .../tests/suite/gfm_strikethrough.rs | 6 +- pulldown-cmark/tests/suite/gfm_table.rs | 18 +- pulldown-cmark/tests/suite/gfm_tasklist.rs | 4 +- pulldown-cmark/tests/suite/heading_attrs.rs | 84 +- pulldown-cmark/tests/suite/math.rs | 94 +- pulldown-cmark/tests/suite/metadata_blocks.rs | 24 +- pulldown-cmark/tests/suite/mod.rs | 1 + pulldown-cmark/tests/suite/old_footnotes.rs | 22 +- pulldown-cmark/tests/suite/regression.rs | 414 +++--- pulldown-cmark/tests/suite/smart_punct.rs | 32 +- pulldown-cmark/tests/suite/spec.rs | 1304 ++++++++--------- pulldown-cmark/tests/suite/strikethrough.rs | 30 +- pulldown-cmark/tests/suite/super_sub.rs | 12 +- pulldown-cmark/tests/suite/table.rs | 56 +- pulldown-cmark/tests/suite/wikilinks.rs | 78 + 29 files changed, 1496 insertions(+), 1141 deletions(-) create mode 100644 guide/src/examples/wikilink-prefix.md create mode 100644 pulldown-cmark/examples/wikilink-prefix.rs create mode 100644 pulldown-cmark/specs/wikilinks.txt create mode 100644 pulldown-cmark/tests/suite/wikilinks.rs diff --git a/guide/src/SUMMARY.md b/guide/src/SUMMARY.md index 5cc94ea9..acc34e25 100644 --- a/guide/src/SUMMARY.md +++ b/guide/src/SUMMARY.md @@ -10,6 +10,7 @@ - [parser-map-event-print.rs](examples/parser-map-event-print.md) - [parser-map-tag-print.rs](examples/parser-map-tag-print.md) - [string-to-string.rs](examples/string-to-string.md) + - [wikilink-prefix.rs](examples/wikilink-prefix.md) --- - [Detailed Specifications](specs.md) @@ -25,3 +26,4 @@ - [math](./specs/math.md) - [heading attributes](./specs/heading_attrs.md) - [metadata blocks](./specs/metadata_blocks.md) + - [wikilinks](./specs/wikilinks.md) diff --git a/guide/src/examples/wikilink-prefix.md b/guide/src/examples/wikilink-prefix.md new file mode 100644 index 00000000..dc21fc70 --- /dev/null +++ b/guide/src/examples/wikilink-prefix.md @@ -0,0 +1,5 @@ +Prefixes all wikilinks in source with a string. + +```rust +{{#include ../../../pulldown-cmark/examples/wikilink-prefix.rs}} +``` diff --git a/pulldown-cmark/Cargo.toml b/pulldown-cmark/Cargo.toml index 644c8c08..24b7b620 100644 --- a/pulldown-cmark/Cargo.toml +++ b/pulldown-cmark/Cargo.toml @@ -57,6 +57,11 @@ name = "broken-link-callbacks" required-features = ["html"] doc-scrape-examples = true +[[example]] +name = "wikilink-prefix" +required-features = ["html"] +doc-scrape-examples = true + [dependencies] bitflags = "2" unicase = "2.6" diff --git a/pulldown-cmark/build.rs b/pulldown-cmark/build.rs index 223c9024..55fdd07e 100644 --- a/pulldown-cmark/build.rs +++ b/pulldown-cmark/build.rs @@ -86,7 +86,7 @@ fn {}_test_{i}() {{ let original = r##"{original}"##; let expected = r##"{expected}"##; - test_markdown_html(original, expected, {smart_punct}, {metadata_blocks}, {old_footnotes}, {subscript}); + test_markdown_html(original, expected, {smart_punct}, {metadata_blocks}, {old_footnotes}, {subscript}, {wikilinks}); }} "###, spec_name, @@ -97,6 +97,7 @@ fn {}_test_{i}() {{ metadata_blocks = testcase.metadata_blocks, old_footnotes = testcase.old_footnotes, subscript = testcase.subscript, + wikilinks = testcase.wikilinks, )) .unwrap(); @@ -153,6 +154,7 @@ pub struct TestCase { pub metadata_blocks: bool, pub old_footnotes: bool, pub subscript: bool, + pub wikilinks: bool, } #[cfg(feature = "gen-tests")] @@ -163,12 +165,13 @@ impl<'a> Iterator for Spec<'a> { let spec = self.spec; let prefix = "```````````````````````````````` example"; - let (i_start, smart_punct, metadata_blocks, old_footnotes, subscript) = + let (i_start, smart_punct, metadata_blocks, old_footnotes, subscript, wikilinks) = self.spec.find(prefix).and_then(|pos| { let smartpunct_suffix = "_smartpunct\n"; let metadata_blocks_suffix = "_metadata_blocks\n"; let old_footnotes_suffix = "_old_footnotes\n"; let super_sub_suffix = "_super_sub\n"; + let wikilinks_suffix = "_wikilinks\n"; if spec[(pos + prefix.len())..].starts_with(smartpunct_suffix) { Some(( pos + prefix.len() + smartpunct_suffix.len(), @@ -176,6 +179,7 @@ impl<'a> Iterator for Spec<'a> { false, false, false, + false, )) } else if spec[(pos + prefix.len())..].starts_with(metadata_blocks_suffix) { Some(( @@ -184,6 +188,7 @@ impl<'a> Iterator for Spec<'a> { true, false, false, + false, )) } else if spec[(pos + prefix.len())..].starts_with(old_footnotes_suffix) { Some(( @@ -192,6 +197,7 @@ impl<'a> Iterator for Spec<'a> { false, true, false, + false, )) } else if spec[(pos + prefix.len())..].starts_with(super_sub_suffix) { Some(( @@ -200,9 +206,19 @@ impl<'a> Iterator for Spec<'a> { false, false, true, + false, + )) + } else if spec[(pos + prefix.len())..].starts_with(wikilinks_suffix) { + Some(( + pos + prefix.len() + wikilinks_suffix.len(), + false, + false, + false, + false, + true, )) } else if spec[(pos + prefix.len())..].starts_with('\n') { - Some((pos + prefix.len() + 1, false, false, false, false)) + Some((pos + prefix.len() + 1, false, false, false, false, false)) } else { None } @@ -225,6 +241,7 @@ impl<'a> Iterator for Spec<'a> { metadata_blocks, old_footnotes, subscript, + wikilinks, }; Some(test_case) diff --git a/pulldown-cmark/examples/wikilink-prefix.rs b/pulldown-cmark/examples/wikilink-prefix.rs new file mode 100644 index 00000000..6d0d6915 --- /dev/null +++ b/pulldown-cmark/examples/wikilink-prefix.rs @@ -0,0 +1,40 @@ +use pulldown_cmark::{html, Event, LinkType, Options, Parser, Tag}; +use std::io::Write; + +/// This example demonstrates how to prefix wikilinks with a special prefix, to +/// correctly render hrefs. +fn main() { + // your wiki is stored at "/wiki" + let prefix: &str = "/wiki"; + let markdown_input: &str = "Wanna go for a [[Wiki Walk]]?"; + + let parser = Parser::new_ext(markdown_input, Options::ENABLE_WIKILINKS).map(|event| { + if let Event::Start(Tag::Link { + link_type: LinkType::WikiLink, + dest_url, + title, + id, + }) = event + { + // prefix wikilink + let mut new_link = String::with_capacity(prefix.len() + dest_url.len()); + new_link.push_str(prefix); + new_link.push_str(&dest_url); + Event::Start(Tag::Link { + link_type: LinkType::WikiLink, + dest_url: new_link.into(), + title, + id, + }) + } else { + event + } + }); + + // Write to anything implementing the `Write` trait. This could also be a file + // or network socket. + let stdout = std::io::stdout(); + let mut handle = stdout.lock(); + handle.write_all(b"\nHTML output:\n").unwrap(); + html::write_html_io(&mut handle, parser).unwrap(); +} diff --git a/pulldown-cmark/specs/wikilinks.txt b/pulldown-cmark/specs/wikilinks.txt new file mode 100644 index 00000000..cd88a7d1 --- /dev/null +++ b/pulldown-cmark/specs/wikilinks.txt @@ -0,0 +1,69 @@ +Run this with `cargo test --features gen-tests suite::wikilinks` + +# Wikilinks +Shorthand link definitions for use in Markdown-based wikis. Syntax and design +choices inspired heavily by +[Python Markdown WikiLinks](https://python-markdown.github.io/extensions/wikilinks/). + +A wikilink works very similarly to a normal link. In fact, it might as well be +syntatic sugar. Define wikilinks with double brackets: + +```````````````````````````````` example_wikilinks +This is a [[WikiLink]]. +. +

    This is a WikiLink.

    +```````````````````````````````` + +Wikilinks take precedence over reference links: + +```````````````````````````````` example_wikilinks +This is [[Ambiguous]]. + +[Ambiguous]: https://example.com/ +. +

    This is Ambiguous.

    +```````````````````````````````` + +They also take precedence over inline links: + +```````````````````````````````` example_wikilinks +This is [also [[Ambiguous]]](https://example.com/). +. +

    This is [also Ambiguous](https://example.com/).

    +```````````````````````````````` + +Wikilinks can have different display text, called piping: + +```````````````````````````````` example_wikilinks +This is [[WikiLink|a pothole]]. +. +

    This is a pothole.

    +```````````````````````````````` + +Using this syntax, it is possible to show more Markdown in the text: + +```````````````````````````````` example_wikilinks +This is [[WikiLink|a **strong** pothole]]. +. +

    This is a strong pothole.

    +```````````````````````````````` + +Or images: + +```````````````````````````````` example_wikilinks +This is a cute dog, linked to the page "/WikiLink/" + +[[WikiLink|![dog](dog.png)]] +. +

    This is a cute dog, linked to the page "/WikiLink/"

    dog

    +```````````````````````````````` + +The content of a wikilink *becomes* the link, modified with some basic rules: +* The `/`` character is appended to the front and back of the link. +* Any whitespace characters are replaced with `_`. + +```````````````````````````````` example_wikilinks +The url of [[This Link]] becomes "/This_Link/" +. +

    The url of This Link becomes "/This_Link/"

    +```````````````````````````````` diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 2d4b4946..0e38bc32 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -1071,23 +1071,29 @@ impl<'a, 'b> FirstPass<'a, 'b> { } } b'[' => { + let double = ix > 0 + && bytes[ix - 1] == b'[' + && self.options.contains(Options::ENABLE_WIKILINKS); self.tree.append_text(begin_text, ix, backslash_escaped); backslash_escaped = false; self.tree.append(Item { start: ix, end: ix + 1, - body: ItemBody::MaybeLinkOpen, + body: ItemBody::MaybeLinkOpen(double), }); begin_text = ix + 1; LoopInstruction::ContinueAndSkip(0) } b']' => { + let double = ix + 1 < bytes_len + && bytes[ix + 1] == b']' + && self.options.contains(Options::ENABLE_WIKILINKS); self.tree.append_text(begin_text, ix, backslash_escaped); backslash_escaped = false; self.tree.append(Item { start: ix, end: ix + 1, - body: ItemBody::MaybeLinkClose(true), + body: ItemBody::MaybeLinkClose(double, true), }); begin_text = ix + 1; LoopInstruction::ContinueAndSkip(0) diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index 87757b4c..94d61394 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -434,6 +434,8 @@ pub enum LinkType { Autolink, /// Email address in autolink like `` Email, + /// Wikilink link like `[[foo]]` or `[[foo|bar]]` + WikiLink, } impl LinkType { @@ -607,6 +609,8 @@ bitflags::bitflags! { const ENABLE_DEFINITION_LIST = 1 << 12; const ENABLE_SUPERSCRIPT = 1 << 13; const ENABLE_SUBSCRIPT = 1 << 14; + /// Obsidian-style Wikilinks. + const ENABLE_WIKILINKS = 1 << 15; } } diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 6e992f71..a0fb2d22 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -22,7 +22,7 @@ use std::cmp::{max, min}; use std::collections::{HashMap, VecDeque}; -use std::iter::FusedIterator; +use std::iter::{once, FusedIterator}; use std::num::NonZeroUsize; use std::ops::{Index, Range}; @@ -64,9 +64,10 @@ pub(crate) enum ItemBody { MaybeSmartQuote(u8, bool, bool), MaybeCode(usize, bool), // number of backticks, preceded by backslash MaybeHtml, - MaybeLinkOpen, - // bool indicates whether or not the preceding section could be a reference - MaybeLinkClose(bool), + // bool `double` indicating this could be a wikilink + MaybeLinkOpen(bool), + // double, bool indicates whether or not the preceding section could be a reference + MaybeLinkClose(bool, bool), MaybeImage, // These are inline items after resolution. @@ -137,7 +138,7 @@ impl ItemBody { | MaybeSmartQuote(..) | MaybeCode(..) | MaybeHtml - | MaybeLinkOpen + | MaybeLinkOpen(..) | MaybeLinkClose(..) | MaybeImage ) @@ -151,7 +152,7 @@ impl ItemBody { | MaybeSmartQuote(..) | MaybeCode(..) | MaybeHtml - | MaybeLinkOpen + | MaybeLinkOpen(..) | MaybeLinkClose(..) | MaybeImage | Emphasis @@ -599,13 +600,13 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { } } } - ItemBody::MaybeLinkOpen => { + ItemBody::MaybeLinkOpen(double) => { self.tree[cur_ix].item.body = ItemBody::Text { backslash_escaped: false, }; self.link_stack.push(LinkStackEl { node: cur_ix, - ty: LinkStackTy::Link, + ty: LinkStackTy::Link(double), }); } ItemBody::MaybeImage => { @@ -617,11 +618,82 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { ty: LinkStackTy::Image, }); } - ItemBody::MaybeLinkClose(could_be_ref) => { + ItemBody::MaybeLinkClose(double, could_be_ref) => { self.tree[cur_ix].item.body = ItemBody::Text { backslash_escaped: false, }; - if let Some(tos) = self.link_stack.pop() { + let wikilink = if double { + // wikilinks take precedence over normal links + // TODO: it may be better to peek for a doubled + // linkopen instead of manipulating the stack like this + self.link_stack.pop_doubled_link() + } else { + None + }; + if let Some(el) = wikilink { + // if this really is doubled, the item below the + // doubled link should have the true start of the link + // we are making lots of assumptions that the first + // pass should protect + let Some(outer_el) = self.link_stack.pop() else { + continue; + }; + let Some(body_node) = self.tree[el.node].next else { + continue; + }; + let Some(next_node) = self.tree[cur_ix].next.map(|n| self.tree[n].next) + else { + continue; + }; + if let Some(prev_ix) = prev { + self.tree[prev_ix].next = None; + } + let start_ix = self.tree[body_node].item.start; + let end_ix = self.tree[cur_ix].item.start; + let wikilink = match scan_wikilink_pipe( + block_text, start_ix, // bounded by closing tag + end_ix, + ) { + Some((rest, wikiname)) => { + // [[WikiName|rest]] + let body_node = scan_nodes_to_ix(&self.tree, Some(body_node), rest); + if let Some(body_node) = body_node { + // break node so passes can actually format + // the display text + self.tree[body_node].item.start = start_ix + rest; + Some((body_node, wikiname)) + } else { + None + } + } + None => { + // [[WikiName]] + let wikiname = &block_text[start_ix..end_ix]; + Some((body_node, wikiname)) + } + }; + // exists only to panic guard against edge cases, this + // should run 99.9% of the time + if let Some((body_node, wikiname)) = wikilink { + let link_ix = self.allocs.allocate_link( + LinkType::WikiLink, + format_wikilink(wikiname), + "".into(), + "".into(), + ); + self.tree[outer_el.node].item.body = ItemBody::Link(link_ix); + self.tree[outer_el.node].child = Some(body_node); + self.tree[outer_el.node].next = next_node; + self.tree[outer_el.node].item.end = end_ix + 1; + self.link_stack.disable_all_links(); + } + // at this point, regardless of whether we were + // successful the stack has been trashed, so use this + // to bring the pass back in a valid state + prev = Some(outer_el.node); + cur = next_node; + continue; + } else if let Some(tos) = self.link_stack.pop() { if tos.ty == LinkStackTy::Disabled { continue; } @@ -651,7 +723,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { max(self.tree[next_node_ix].item.start, next_ix); } - if tos.ty == LinkStackTy::Link { + if matches!(tos.ty, LinkStackTy::Link(..)) { self.link_stack.disable_all_links(); } } else { @@ -674,7 +746,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { continue; }; self.tree[reference_close_node].item.body = - ItemBody::MaybeLinkClose(false); + ItemBody::MaybeLinkClose(double, false); let next_node = self.tree[reference_close_node].next; (next_node, LinkType::Reference) @@ -809,7 +881,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { cur = Some(tos.node); cur_ix = tos.node; - if tos.ty == LinkStackTy::Link { + if matches!(tos.ty, LinkStackTy::Link(..)) { self.link_stack.disable_all_links(); } } @@ -1665,6 +1737,22 @@ impl LinkStack { el } + /// Consumes the link stack until a doubled link is found. Should only be + /// called when a closing wikilink tag is ABSOLUTELY there, since this + /// messes with the link stack in a way that's only valid after completing + /// the closing tag of a wikilink. + fn pop_doubled_link(&mut self) -> Option { + if let Some(ix) = self + .inner + .iter() + .rposition(|el| el.ty == LinkStackTy::Link(true)) + { + self.inner.drain(ix..).next() + } else { + None + } + } + fn clear(&mut self) { self.inner.clear(); self.disabled_ix = 0; @@ -1672,7 +1760,7 @@ impl LinkStack { fn disable_all_links(&mut self) { for el in &mut self.inner[self.disabled_ix..] { - if el.ty == LinkStackTy::Link { + if matches!(el.ty, LinkStackTy::Link(..)) { el.ty = LinkStackTy::Disabled; } } @@ -1688,7 +1776,8 @@ struct LinkStackEl { #[derive(PartialEq, Clone, Debug)] enum LinkStackTy { - Link, + // if this is doubled up, could be a wikilink + Link(bool), Image, Disabled, } @@ -2091,6 +2180,22 @@ impl<'a, F: BrokenLinkCallback<'a>> Iterator for OffsetIter<'a, F> { } } +fn format_wikilink<'a>(text: &'a str) -> CowStr<'a> { + // this does not check if the link already has the special control + // characters, as in the "href" of [[/Wiki_Link/]] becomes "//Wiki_Link//" + // no support planned because it defeats a core design decision of + // wikilinks + once('/') + .chain( + text.chars() + .map(|b| if b.is_ascii_whitespace() { '_' } else { b }), + ) + .chain(once('/')) + // written like this to enable iter optimization + .collect::() + .into() +} + fn body_to_tag_end(body: &ItemBody) -> TagEnd { match *body { ItemBody::Paragraph => TagEnd::Paragraph, diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index b2fc4c39..3b61c606 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -933,6 +933,25 @@ pub(crate) fn scan_entity(bytes: &[u8]) -> (usize, Option>) { (0, None) } +pub(crate) fn scan_wikilink_pipe( + data: &str, + start_ix: usize, + max_ix: usize, +) -> Option<(usize, &str)> { + let bytes = &data.as_bytes()[start_ix..]; + // skip any possibly empty wikilinks + // [[|empty wikilink]] + let mut i = 1; + + while i < bytes.len() && i < max_ix { + if bytes[i] == b'|' { + return Some((i + 1, &data[start_ix..start_ix + i])); + } + i += 1; + } + None +} + // note: dest returned is raw, still needs to be unescaped // TODO: check that nested parens are really not allowed for refdefs // TODO(performance): this func should probably its own unescaping diff --git a/pulldown-cmark/tests/lib.rs b/pulldown-cmark/tests/lib.rs index 26cbcb48..f074f7be 100644 --- a/pulldown-cmark/tests/lib.rs +++ b/pulldown-cmark/tests/lib.rs @@ -13,6 +13,7 @@ pub fn test_markdown_html( metadata_blocks: bool, old_footnotes: bool, subscript: bool, + wikilinks: bool, ) { let mut s = String::new(); @@ -21,6 +22,9 @@ pub fn test_markdown_html( opts.insert(Options::ENABLE_TABLES); opts.insert(Options::ENABLE_STRIKETHROUGH); opts.insert(Options::ENABLE_SUPERSCRIPT); + if wikilinks { + opts.insert(Options::ENABLE_WIKILINKS); + } if subscript { opts.insert(Options::ENABLE_SUBSCRIPT); } diff --git a/pulldown-cmark/tests/suite/blockquotes_tags.rs b/pulldown-cmark/tests/suite/blockquotes_tags.rs index b2674706..47bc48b0 100644 --- a/pulldown-cmark/tests/suite/blockquotes_tags.rs +++ b/pulldown-cmark/tests/suite/blockquotes_tags.rs @@ -10,7 +10,7 @@ fn blockquotes_tags_test_1() { let expected = r##"

    This is a normal blockquote without tag.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -21,7 +21,7 @@ fn blockquotes_tags_test_2() { let expected = r##"

    Note blockquote

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -32,7 +32,7 @@ fn blockquotes_tags_test_3() { let expected = r##"

    Tip blockquote

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -43,7 +43,7 @@ fn blockquotes_tags_test_4() { let expected = r##"

    Important blockquote

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -54,7 +54,7 @@ fn blockquotes_tags_test_5() { let expected = r##"

    Warning blockquote

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -65,7 +65,7 @@ fn blockquotes_tags_test_6() { let expected = r##"

    Caution blockquote

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -75,7 +75,7 @@ fn blockquotes_tags_test_7() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -88,7 +88,7 @@ fn blockquotes_tags_test_8() { Line 2.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -103,7 +103,7 @@ fn blockquotes_tags_test_9() { Line 2.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -116,7 +116,7 @@ fn blockquotes_tags_test_10() { let expected = r##"

    Line 1.

    Line 2.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -131,7 +131,7 @@ fn blockquotes_tags_test_11() { let expected = r##"

    Line 1.

    Line 2.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -144,7 +144,7 @@ fn blockquotes_tags_test_12() { Line 2.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -159,7 +159,7 @@ fn blockquotes_tags_test_13() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -174,7 +174,7 @@ fn blockquotes_tags_test_14() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -189,7 +189,7 @@ fn blockquotes_tags_test_15() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -216,7 +216,7 @@ sink ships "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -237,7 +237,7 @@ fn blockquotes_tags_test_17() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -251,5 +251,5 @@ This should be a normal block quote.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/definition_lists.rs b/pulldown-cmark/tests/suite/definition_lists.rs index 37ff4f82..b14855d9 100644 --- a/pulldown-cmark/tests/suite/definition_lists.rs +++ b/pulldown-cmark/tests/suite/definition_lists.rs @@ -19,7 +19,7 @@ orange "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -44,7 +44,7 @@ orange "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -61,7 +61,7 @@ fn definition_lists_test_3() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -80,7 +80,7 @@ orange "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -105,7 +105,7 @@ orange "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -144,7 +144,7 @@ crisp, pleasant to taste

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -166,7 +166,7 @@ fn definition_lists_test_7() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -189,7 +189,7 @@ orange "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -223,7 +223,7 @@ orange "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -261,7 +261,7 @@ fruit

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -282,7 +282,7 @@ c "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -304,7 +304,7 @@ bim "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -326,7 +326,7 @@ Bloze

    Bloze

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -341,7 +341,7 @@ Bloze

    Bloze

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -358,7 +358,7 @@ Bloze

    Bloze

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -401,7 +401,7 @@ bar : baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -447,7 +447,7 @@ fn definition_lists_test_17() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -461,7 +461,7 @@ fn definition_lists_test_18() {

    : first

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -482,7 +482,7 @@ Test|Table

    : fourth

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -495,7 +495,7 @@ fn definition_lists_test_20() {

    : first

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -515,7 +515,7 @@ My section

    : fourth

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -527,7 +527,7 @@ fn definition_lists_test_22() {

    : first

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -546,7 +546,7 @@ fn definition_lists_test_23() {

    : fourth

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -565,7 +565,7 @@ third "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -588,7 +588,7 @@ first : fourth "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -612,7 +612,7 @@ third "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -647,5 +647,5 @@ level three "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/footnotes.rs b/pulldown-cmark/tests/suite/footnotes.rs index c9a59f4a..dd9b15ee 100644 --- a/pulldown-cmark/tests/suite/footnotes.rs +++ b/pulldown-cmark/tests/suite/footnotes.rs @@ -15,7 +15,7 @@ fn footnotes_test_1() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -34,7 +34,7 @@ Yes it goes on and on my friends. "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -77,7 +77,7 @@ fn footnotes_test_4() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -114,7 +114,7 @@ fn footnotes_test_5() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -138,7 +138,7 @@ d

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -161,7 +161,7 @@ I had largely given over my inquiries into what Professor Angell called the "Cth "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -180,7 +180,7 @@ If a woodchuck could chuck wood.

    Forms of entertainment that aren't childish

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -213,7 +213,7 @@ fn footnotes_test_9() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -233,7 +233,7 @@ As such, we can guarantee that the non-childish forms of entertainment are proba

    As such, we can guarantee that the non-childish forms of entertainment are probably more entertaining to adults, since, having had a whole childhood doing the childish ones, the non-childish ones are merely the ones that haven't gotten boring yet.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -277,7 +277,7 @@ fn footnotes_test_11() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -293,7 +293,7 @@ fn footnotes_test_12() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -312,7 +312,7 @@ fn footnotes_test_13() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -336,7 +336,7 @@ An unordered list before the footnotes: "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -393,7 +393,7 @@ Songs that simply loop are a popular way to annoy people. [^examples3] "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -431,7 +431,7 @@ test suite into pulldown-cmark should be fine.

    [otherlink1]: https://github.com/github/cmark-gfm/blob/1e230827a584ebc9938c3eadc5059c55ef3c9abf/test/extensions.txt#L702

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -456,7 +456,7 @@ fn main() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -470,7 +470,7 @@ fn footnotes_test_18() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -494,7 +494,7 @@ fn footnotes_test_19() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -556,7 +556,7 @@ Second 2 test

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -568,7 +568,7 @@ fn footnotes_test_21() { let expected = r##"

    Test ^ link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -608,7 +608,7 @@ second fourth]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -623,7 +623,7 @@ fn footnotes_test_23() {

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -644,7 +644,7 @@ footnote [^quux]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -663,7 +663,7 @@ fn footnotes_test_25() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -682,5 +682,5 @@ fn footnotes_test_26() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/gfm_strikethrough.rs b/pulldown-cmark/tests/suite/gfm_strikethrough.rs index 34902781..720b99d6 100644 --- a/pulldown-cmark/tests/suite/gfm_strikethrough.rs +++ b/pulldown-cmark/tests/suite/gfm_strikethrough.rs @@ -10,7 +10,7 @@ fn gfm_strikethrough_test_1() { let expected = r##"

    Hi Hello, there world!

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -23,7 +23,7 @@ new paragraph~~.

    new paragraph~~.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -33,5 +33,5 @@ fn gfm_strikethrough_test_3() { let expected = r##"

    This will ~~~not~~~ strike.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/gfm_table.rs b/pulldown-cmark/tests/suite/gfm_table.rs index f2c7fc69..3e5a1e14 100644 --- a/pulldown-cmark/tests/suite/gfm_table.rs +++ b/pulldown-cmark/tests/suite/gfm_table.rs @@ -25,7 +25,7 @@ fn gfm_table_test_1() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -50,7 +50,7 @@ bar | baz "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -77,7 +77,7 @@ fn gfm_table_test_3() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -106,7 +106,7 @@ fn gfm_table_test_4() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -139,7 +139,7 @@ bar

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -153,7 +153,7 @@ fn gfm_table_test_6() { | bar |

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -183,7 +183,7 @@ fn gfm_table_test_7() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -202,7 +202,7 @@ fn gfm_table_test_8() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -229,5 +229,5 @@ fn gfm_table_test_9() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/gfm_tasklist.rs b/pulldown-cmark/tests/suite/gfm_tasklist.rs index ced6086b..232d8737 100644 --- a/pulldown-cmark/tests/suite/gfm_tasklist.rs +++ b/pulldown-cmark/tests/suite/gfm_tasklist.rs @@ -16,7 +16,7 @@ bar "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -41,5 +41,5 @@ bim "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/heading_attrs.rs b/pulldown-cmark/tests/suite/heading_attrs.rs index ed9cf2d7..3b933da5 100644 --- a/pulldown-cmark/tests/suite/heading_attrs.rs +++ b/pulldown-cmark/tests/suite/heading_attrs.rs @@ -20,7 +20,7 @@ multiple! {.myclass1 myattr #myh3 otherattr=value .myclass2}

    multiple!

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -36,7 +36,7 @@ fn heading_attrs_test_2() {

    multiple!

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -53,7 +53,7 @@ fn heading_attrs_test_3() {

    non-attribute-block {#id4}

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -65,7 +65,7 @@ fn heading_attrs_test_4() {

    tabs

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -77,7 +77,7 @@ nextline

    nextline

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -99,7 +99,7 @@ nextline {.class}

    ](https://example.com/) {#myid3}

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -114,7 +114,7 @@ cont "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -133,7 +133,7 @@ fn heading_attrs_test_8() { } "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -145,7 +145,7 @@ fn heading_attrs_test_9() {

    recommended style with spaces

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -159,7 +159,7 @@ fn heading_attrs_test_10() {

    H3

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -171,7 +171,7 @@ fn heading_attrs_test_11() {

    H2

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -183,7 +183,7 @@ fn heading_attrs_test_12() {

    H2 {#id2

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -195,7 +195,7 @@ fn heading_attrs_test_13() {

    H2 #id2}

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -207,7 +207,7 @@ fn heading_attrs_test_14() {

    H2 {#id2}

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -225,7 +225,7 @@ fn heading_attrs_test_15() {
    text
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -235,7 +235,7 @@ fn heading_attrs_test_16() { let expected = r##"

    H1

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -245,7 +245,7 @@ fn heading_attrs_test_17() { let expected = r##"

    H1

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -255,7 +255,7 @@ fn heading_attrs_test_18() { let expected = r##"

    H1

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -267,7 +267,7 @@ fn heading_attrs_test_19() {

    H2

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -279,7 +279,7 @@ fn heading_attrs_test_20() {

    H2

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -289,7 +289,7 @@ fn heading_attrs_test_21() { let expected = r##"

    Header

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -299,7 +299,7 @@ fn heading_attrs_test_22() { let expected = r##"

    Header

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -311,7 +311,7 @@ fn heading_attrs_test_23() {

    H2 {.foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -321,7 +321,7 @@ fn heading_attrs_test_24() { let expected = r##"

    H1 {.foo}bar}

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -331,7 +331,7 @@ fn heading_attrs_test_25() { let expected = r##"

    H1 {foo}

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -341,7 +341,7 @@ fn heading_attrs_test_26() { let expected = r##"

    H1 {.foo}

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -354,7 +354,7 @@ fn heading_attrs_test_27() { .bar} "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -368,7 +368,7 @@ fn heading_attrs_test_28() {

    H2 {}

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -378,7 +378,7 @@ fn heading_attrs_test_29() { let expected = r##"

    H2 {}

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -396,7 +396,7 @@ newline can be used for setext heading { } "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -410,7 +410,7 @@ fn heading_attrs_test_31() {

    stray backslash at the end is preserved \

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -428,7 +428,7 @@ stray backslash at the end is preserved \

    stray backslash at the end is preserved \

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -442,7 +442,7 @@ fn heading_attrs_test_33() {

    H3

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -461,7 +461,7 @@ H2-2 {#foo**bar**baz}

    H2-2

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -475,7 +475,7 @@ fn heading_attrs_test_35() {

    H3

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -487,7 +487,7 @@ fn heading_attrs_test_36() {

    H2

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -499,7 +499,7 @@ fn heading_attrs_test_37() {

    H1

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -518,7 +518,7 @@ fn heading_attrs_test_38() {

    #{}

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -545,7 +545,7 @@ fn heading_attrs_test_39() {

    {}

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -565,7 +565,7 @@ fn heading_attrs_test_40() {

    vertical tab

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -580,7 +580,7 @@ fn heading_attrs_test_41() {

    vertical tab (U+000B)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -592,5 +592,5 @@ fn heading_attrs_test_42() {

    IDEOGRAPHIC SPACE (U+3000)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/math.rs b/pulldown-cmark/tests/suite/math.rs index feacd785..f5d595b2 100644 --- a/pulldown-cmark/tests/suite/math.rs +++ b/pulldown-cmark/tests/suite/math.rs @@ -15,7 +15,7 @@ $\sum_{k=1}^n a_k b_k$: Mathematical expression at head of line

    \ may follow just after the first $: \{1, 2, 3\}

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -28,7 +28,7 @@ $$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \

    \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -41,7 +41,7 @@ $$$$

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -57,7 +57,7 @@ $$x$$$$$$y$$

    xy$$

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -82,7 +82,7 @@ $α$

    &alpha;

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -95,7 +95,7 @@ Dollar at end of line$

    Dollar at end of line$

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -112,7 +112,7 @@ $$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -126,7 +126,7 @@ hard break either

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -139,7 +139,7 @@ $$y = \$ x$$

    y = \$ x

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -152,7 +152,7 @@ $$ $ $$

    $$ $ $$

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -162,7 +162,7 @@ fn math_test_11() { let expected = r##"

    alpha$betagamma$$delta

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -190,7 +190,7 @@ they should not allow inlines to do that $$2 + *

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -200,7 +200,7 @@ fn math_test_13() { let expected = r##"

    these are math texts: fooy=xbar and y=xbar and fooy=x bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -216,7 +216,7 @@ braces: ($x=y$) [$x=y$] {$x=y$}

    braces: (x=y) [x=y] {x=y}

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -226,7 +226,7 @@ fn math_test_15() { let expected = r##"

    x=y

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -245,7 +245,7 @@ $$a$$$$b$$

    ab

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -264,7 +264,7 @@ $$ Display `first $$ then` code

    Code $$ first then $$ display

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -288,7 +288,7 @@ $$ x + y "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -311,7 +311,7 @@ not

    $$

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -334,7 +334,7 @@ math$ "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -354,7 +354,7 @@ And this is inline math: \text{Hello $x$ there!}

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -379,7 +379,7 @@ Math environment contains y: $x {$ $ } $y$

    Math environment contains y: $x {$ $ } y

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -412,7 +412,7 @@ and expected to be as short as possible:

    \text{first $$ second}$$

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -434,7 +434,7 @@ $}$] $$

    $}$] $$

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -444,7 +444,7 @@ fn math_test_25() { let expected = r##"

    x `y`

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -486,7 +486,7 @@ b "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -500,7 +500,7 @@ fn math_test_27() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -523,7 +523,7 @@ A = 5 "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -536,7 +536,7 @@ $$aa<b

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -551,7 +551,7 @@ fn math_test_30() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -563,7 +563,7 @@ fn math_test_31() {

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -579,7 +579,7 @@ fn math_test_32() {

    1x

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -595,7 +595,7 @@ _$a$ equals $b$_

    a equals b

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -618,7 +618,7 @@ a "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -628,7 +628,7 @@ fn math_test_35() { let expected = r##"

    \{a\,b\}

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -644,7 +644,7 @@ ${a}_b c_{d}$

    {a}_b c_{d}

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -656,7 +656,7 @@ $$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$ x = {-b \pm \sqrt{b^2-4ac} \over 2a}

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -666,7 +666,7 @@ fn math_test_38() { let expected = r##"

    x = \$

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -676,7 +676,7 @@ fn math_test_39() { let expected = r##"

    Equation \Omega(69) in italic text

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -700,7 +700,7 @@ fn math_test_40() {

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -716,7 +716,7 @@ fn math_test_41() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -732,7 +732,7 @@ fn math_test_42() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -770,7 +770,7 @@ fn math_test_43() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -790,7 +790,7 @@ improperly }{ nested But this still isn't, because the braces are still counted: $}{$

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -819,7 +819,7 @@ another improperly nested example }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -853,7 +853,7 @@ fn math_test_46() { {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{ 255 brace pairs and one unclosed brace

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -915,5 +915,5 @@ fn math_test_47() { }}}}}}}}}}}}}}}{$ 255 close braces and one open brace

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/metadata_blocks.rs b/pulldown-cmark/tests/suite/metadata_blocks.rs index 0020ebba..f85d6ded 100644 --- a/pulldown-cmark/tests/suite/metadata_blocks.rs +++ b/pulldown-cmark/tests/suite/metadata_blocks.rs @@ -12,7 +12,7 @@ another_field: 0 "##; let expected = r##""##; - test_markdown_html(original, expected, false, true, false, false); + test_markdown_html(original, expected, false, true, false, false, false); } #[test] @@ -26,7 +26,7 @@ another_field: 0 another_field: 0

    "##; - test_markdown_html(original, expected, false, true, false, false); + test_markdown_html(original, expected, false, true, false, false, false); } #[test] @@ -38,7 +38,7 @@ fn metadata_blocks_test_3() {
    "##; - test_markdown_html(original, expected, false, true, false, false); + test_markdown_html(original, expected, false, true, false, false, false); } #[test] @@ -54,7 +54,7 @@ another_field: 0 another_field: 0 "##; - test_markdown_html(original, expected, false, true, false, false); + test_markdown_html(original, expected, false, true, false, false, false); } #[test] @@ -70,7 +70,7 @@ another_field: 0 another_field: 0 "##; - test_markdown_html(original, expected, false, true, false, false); + test_markdown_html(original, expected, false, true, false, false, false); } #[test] @@ -85,7 +85,7 @@ another_field: 0 let expected = r##"

    My paragraph here.

    "##; - test_markdown_html(original, expected, false, true, false, false); + test_markdown_html(original, expected, false, true, false, false, false); } #[test] @@ -105,7 +105,7 @@ another_field: 0 another_field: 0 "##; - test_markdown_html(original, expected, false, true, false, false); + test_markdown_html(original, expected, false, true, false, false, false); } #[test] @@ -126,7 +126,7 @@ another_field: 0 ---a

    "##; - test_markdown_html(original, expected, false, true, false, false); + test_markdown_html(original, expected, false, true, false, false, false); } #[test] @@ -138,7 +138,7 @@ another_field: 0 "##; let expected = r##""##; - test_markdown_html(original, expected, false, true, false, false); + test_markdown_html(original, expected, false, true, false, false, false); } #[test] @@ -150,7 +150,7 @@ another_field: 0 "##; let expected = r##""##; - test_markdown_html(original, expected, false, true, false, false); + test_markdown_html(original, expected, false, true, false, false, false); } #[test] @@ -165,7 +165,7 @@ Things "##; - test_markdown_html(original, expected, false, true, false, false); + test_markdown_html(original, expected, false, true, false, false, false); } #[test] @@ -177,5 +177,5 @@ fn metadata_blocks_test_12() { "##; let expected = r##""##; - test_markdown_html(original, expected, false, true, false, false); + test_markdown_html(original, expected, false, true, false, false, false); } diff --git a/pulldown-cmark/tests/suite/mod.rs b/pulldown-cmark/tests/suite/mod.rs index 79c630c8..a5efb382 100644 --- a/pulldown-cmark/tests/suite/mod.rs +++ b/pulldown-cmark/tests/suite/mod.rs @@ -19,3 +19,4 @@ mod spec; mod strikethrough; mod super_sub; mod table; +mod wikilinks; diff --git a/pulldown-cmark/tests/suite/old_footnotes.rs b/pulldown-cmark/tests/suite/old_footnotes.rs index a105a32b..cf767130 100644 --- a/pulldown-cmark/tests/suite/old_footnotes.rs +++ b/pulldown-cmark/tests/suite/old_footnotes.rs @@ -15,7 +15,7 @@ fn old_footnotes_test_1() { "##; - test_markdown_html(original, expected, false, false, true, false); + test_markdown_html(original, expected, false, false, true, false, false); } #[test] @@ -34,7 +34,7 @@ Yes it goes on and on my friends. "##; - test_markdown_html(original, expected, false, false, true, false); + test_markdown_html(original, expected, false, false, true, false, false); } #[test] @@ -71,7 +71,7 @@ I had largely given over my inquiries into what Professor Angell called the "Cth

    I had largely given over my inquiries into what Professor Angell called the "Cthulhu Cult", and was visiting a learned friend in Paterson, New Jersey; the curator of a local museum and a mineralogist of note. Examining one day the reserve specimens roughly set on the storage shelves in a rear room of the museum, my eye was caught by an odd picture in one of the old papers spread beneath the stones. It was the Sydney Bulletin I have mentioned, for my friend had wide affiliations in all conceivable foreign parts; and the picture was a half-tone cut of a hideous stone image almost identical with that which Legrasse had found in the swamp.

    "##; - test_markdown_html(original, expected, false, false, true, false); + test_markdown_html(original, expected, false, false, true, false, false); } #[test] @@ -90,7 +90,7 @@ If a woodchuck could chuck wood.

    Forms of entertainment that aren't childish

    "##; - test_markdown_html(original, expected, false, false, true, false); + test_markdown_html(original, expected, false, false, true, false, false); } #[test] @@ -110,7 +110,7 @@ As such, we can guarantee that the non-childish forms of entertainment are proba

    As such, we can guarantee that the non-childish forms of entertainment are probably more entertaining to adults, since, having had a whole childhood doing the childish ones, the non-childish ones are merely the ones that haven't gotten boring yet.

    "##; - test_markdown_html(original, expected, false, false, true, false); + test_markdown_html(original, expected, false, false, true, false, false); } #[test] @@ -144,7 +144,7 @@ fn old_footnotes_test_7() { "##; - test_markdown_html(original, expected, false, false, true, false); + test_markdown_html(original, expected, false, false, true, false, false); } #[test] @@ -159,7 +159,7 @@ fn old_footnotes_test_8() {
    2

    Common for people practicing music.

    "##; - test_markdown_html(original, expected, false, false, true, false); + test_markdown_html(original, expected, false, false, true, false, false); } #[test] @@ -173,7 +173,7 @@ fn old_footnotes_test_9() { let expected = r##"

    [Reference to footnotes A1, B2 and C3.

    1

    Footnote A.

    2

    Footnote B.

    3

    Footnote C.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -192,7 +192,7 @@ fn old_footnotes_test_10() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -211,5 +211,5 @@ fn old_footnotes_test_11() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/regression.rs b/pulldown-cmark/tests/suite/regression.rs index 27d8badc..118d89b1 100644 --- a/pulldown-cmark/tests/suite/regression.rs +++ b/pulldown-cmark/tests/suite/regression.rs @@ -16,7 +16,7 @@ This is a test of the details element. "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -31,7 +31,7 @@ fn regression_test_2() { let expected = r##"

    see the many articles on QuickCheck.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -48,7 +48,7 @@ fn regression_test_3() { debug-stub-derive on docs.rs

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -69,7 +69,7 @@ fn regression_test_4() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -79,7 +79,7 @@ fn regression_test_5() { let expected = r##"

    foo§(bar)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -89,7 +89,7 @@ fn regression_test_6() { let expected = r##"

    https://example.com hello

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -103,7 +103,7 @@ fn regression_test_7() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -130,7 +130,7 @@ fn regression_test_8() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -144,7 +144,7 @@ i8 let expected = r##"

    i8

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -156,7 +156,7 @@ fn regression_test_10() { let expected = r##"

    a

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -168,7 +168,7 @@ fn regression_test_11() { let expected = r##"

    a

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -181,7 +181,7 @@ fn regression_test_12() {

    [a]: /url (title))

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -194,7 +194,7 @@ b

    b

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -205,7 +205,7 @@ foo let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -215,7 +215,7 @@ fn regression_test_15() { let expected = r##"

    `foo`

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -227,7 +227,7 @@ bar bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -240,7 +240,7 @@ fn regression_test_17() {

    1) bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -262,7 +262,7 @@ fn regression_test_18() {

    1)2)3)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -272,7 +272,7 @@ fn regression_test_19() { let expected = r##"

    [](<<>)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -282,7 +282,7 @@ fn regression_test_20() { let expected = r##"

    `foo``bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -292,7 +292,7 @@ fn regression_test_21() { let expected = r##"

    \foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -304,7 +304,7 @@ YOLO let expected = r##"

    YOLO

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -320,7 +320,7 @@ A | B foo | bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -334,7 +334,7 @@ foo|bar "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -348,7 +348,7 @@ foo|bar "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -358,7 +358,7 @@ fn regression_test_26() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -368,7 +368,7 @@ fn regression_test_27() { let expected = r##"

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -378,7 +378,7 @@ fn regression_test_28() { let expected = r##"

    http://example.com

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -388,7 +388,7 @@ fn regression_test_29() { let expected = r##"

    http://one http://two

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -403,7 +403,7 @@ some text

    some text

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -424,7 +424,7 @@ fn regression_test_31() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -439,7 +439,7 @@ x

    ]: f

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -449,7 +449,7 @@ fn regression_test_33() { let expected = r##"

    [foo]:

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -464,7 +464,7 @@ fn regression_test_34() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -479,7 +479,7 @@ yolo | swag

    yolo | swag

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -489,7 +489,7 @@ fn regression_test_36() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -501,7 +501,7 @@ fn regression_test_37() { "hi">

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -514,7 +514,7 @@ __a__

    a

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -527,7 +527,7 @@ fn regression_test_39() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -537,7 +537,7 @@ fn regression_test_40() { let expected = r##"

    \|

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -550,7 +550,7 @@ Paragraph 2

    Paragraph 2

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -560,7 +560,7 @@ fn regression_test_42() { let expected = r##"

    [link text]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -572,7 +572,7 @@ fn regression_test_43() { let expected = r##"
    foobar
    [a](<url>)
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -586,7 +586,7 @@ fn regression_test_44() {

    ")

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -599,7 +599,7 @@ fn regression_test_45() {

    )

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -612,7 +612,7 @@ fn regression_test_46() {

    ")

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -622,7 +622,7 @@ fn regression_test_47() { let expected = r##"

    <http:// >

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -632,7 +632,7 @@ fn regression_test_48() { let expected = r##"

    <http://>

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -651,7 +651,7 @@ fn regression_test_49() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -670,7 +670,7 @@ fn regression_test_50() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -680,7 +680,7 @@ fn regression_test_51() { let expected = r##"

    *hi_

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -690,7 +690,7 @@ fn regression_test_52() { let expected = r##"

    email: john@example.com_

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -704,7 +704,7 @@ bar">link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -719,7 +719,7 @@ fn regression_test_54() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -735,7 +735,7 @@ bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -753,7 +753,7 @@ fn regression_test_56() {

    a b c

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -770,7 +770,7 @@ fn regression_test_57() {

    [a b] [a > b]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -783,7 +783,7 @@ package`] let expected = r##"

    cargo package

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -798,7 +798,7 @@ fn regression_test_59() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -811,7 +811,7 @@ fn regression_test_60() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -827,7 +827,7 @@ the size of usize and have the same alignment.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -851,7 +851,7 @@ An unordered list before the footnotes: "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -869,7 +869,7 @@ fn regression_test_63() {

    assimp-rs

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -914,7 +914,7 @@ fn regression_test_64() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -924,7 +924,7 @@ fn regression_test_65() { let expected = r##"

    <foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -942,7 +942,7 @@ lo">

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -953,7 +953,7 @@ fn regression_test_67() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -975,7 +975,7 @@ a 2. a

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -991,7 +991,7 @@ fn regression_test_69() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1010,7 +1010,7 @@ bar

    baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1029,7 +1029,7 @@ fn regression_test_71() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1041,7 +1041,7 @@ fn regression_test_72() { let expected = r##"

    []]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1051,7 +1051,7 @@ fn regression_test_73() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1061,7 +1061,7 @@ fn regression_test_74() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1071,7 +1071,7 @@ fn regression_test_75() { let expected = r##"

    emphasis strike strong strike emphasis strong

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1081,7 +1081,7 @@ fn regression_test_76() { let expected = r##"

    emphasis strike strong strike emphasis strong code

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1091,7 +1091,7 @@ fn regression_test_77() { let expected = r##"

    emphasis strike code strike emphasis strong

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1101,7 +1101,7 @@ fn regression_test_78() { let expected = r##"

    emphasis strike code strike emphasis strong code

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1111,7 +1111,7 @@ fn regression_test_79() { let expected = r##"

    strong strike emphasis strike emphasis strong

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1121,7 +1121,7 @@ fn regression_test_80() { let expected = r##"

    strong strike emphasis strike emphasis strong code

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1131,7 +1131,7 @@ fn regression_test_81() { let expected = r##"

    strong strike code strike emphasis strong

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1141,7 +1141,7 @@ fn regression_test_82() { let expected = r##"

    strong strike code strike emphasis strong code

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1234,7 +1234,7 @@ fn regression_test_83() { | baz | alef |

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1244,7 +1244,7 @@ fn regression_test_84() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1254,7 +1254,7 @@ fn regression_test_85() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1264,7 +1264,7 @@ fn regression_test_86() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1326,7 +1326,7 @@ fn regression_test_87() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1339,7 +1339,7 @@ b

    b

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1353,7 +1353,7 @@ fn regression_test_89() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1367,7 +1367,7 @@ fn regression_test_90() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1379,7 +1379,7 @@ fn regression_test_91() {

    b

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1390,7 +1390,7 @@ fn regression_test_92() { let expected = r##"

    a\

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1403,7 +1403,7 @@ fn regression_test_93() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1415,7 +1415,7 @@ fn regression_test_94() {
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1427,7 +1427,7 @@ fn regression_test_95() { > "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1439,7 +1439,7 @@ fn regression_test_96() {

    quote

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1451,7 +1451,7 @@ fn regression_test_97() { > not quote "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1463,7 +1463,7 @@ fn regression_test_98() {

    quote

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1475,7 +1475,7 @@ fn regression_test_99() { >not quote "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1494,7 +1494,7 @@ fn regression_test_100() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1504,7 +1504,7 @@ fn regression_test_101() { let expected = r##"

    *R]-

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1514,7 +1514,7 @@ fn regression_test_102() { let expected = r##"

    foobarbaz**

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1528,7 +1528,7 @@ fn regression_test_103() { %

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1542,7 +1542,7 @@ fn regression_test_104() { %

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1552,7 +1552,7 @@ fn regression_test_105() { let expected = r##"

    <@1>

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1566,7 +1566,7 @@ Things let expected = r##"

    Things

    "##; - test_markdown_html(original, expected, false, true, false, false); + test_markdown_html(original, expected, false, true, false, false, false); } #[test] @@ -1581,7 +1581,7 @@ Things let expected = r##"

    Things

    "##; - test_markdown_html(original, expected, false, true, false, false); + test_markdown_html(original, expected, false, true, false, false, false); } #[test] @@ -1595,7 +1595,7 @@ Things let expected = r##"

    Things

    "##; - test_markdown_html(original, expected, false, true, false, false); + test_markdown_html(original, expected, false, true, false, false, false); } #[test] @@ -1619,7 +1619,7 @@ fn regression_test_109() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1634,7 +1634,7 @@ fn regression_test_110() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1644,7 +1644,7 @@ fn regression_test_111() { let expected = r##"

    j*5=

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1710,7 +1710,7 @@ Table "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1723,7 +1723,7 @@ fn regression_test_113() {

    [x]: (

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1745,7 +1745,7 @@ an unmatched asterisk.

    {{

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1755,7 +1755,7 @@ fn regression_test_115() { let expected = r##"

    *a.*.a..

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1774,7 +1774,7 @@ _*xx-_-

    *xx--

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1803,7 +1803,7 @@ fn regression_test_117() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1832,7 +1832,7 @@ fn regression_test_118() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1845,7 +1845,7 @@ fn regression_test_119() {

    ]: https://rust-lang.org

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1878,7 +1878,7 @@ fn regression_test_120() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1921,7 +1921,7 @@ The second hyphen should parse the same way in both samples. "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1936,7 +1936,7 @@ https://rust-lang.org "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1949,7 +1949,7 @@ Second try]: https://rust-lang.org

    Second try]: https://rust-lang.org

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1972,7 +1972,7 @@ fn regression_test_124() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1984,7 +1984,7 @@ bar \

    bar \

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1998,7 +1998,7 @@ fn regression_test_126() {

    [third try]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2018,7 +2018,7 @@ bar "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2040,7 +2040,7 @@ fn regression_test_128() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2051,7 +2051,7 @@ fn regression_test_129() { let expected = r##"

    -

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2068,7 +2068,7 @@ foo) "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2085,7 +2085,7 @@ fn regression_test_131() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2104,7 +2104,7 @@ fn regression_test_132() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2125,7 +2125,7 @@ fn regression_test_133() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2136,7 +2136,7 @@ fn regression_test_134() { let expected = r##"

    - baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2154,7 +2154,7 @@ GFM footnotes can interrupt link defs if they have three spaces, but not four.

    GFM footnotes can interrupt link defs if they have three spaces, but not four.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2171,7 +2171,7 @@ Setext heading can interrupt link def if it has three spaces, but not four.

    Setext heading can interrupt link def if it has three spaces, but not four.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2191,7 +2191,7 @@ List can interrupt the paragraph at the start of a link definition if it starts

    List can interrupt the paragraph at the start of a link definition if it starts with three spaces, but not four.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2210,7 +2210,7 @@ second]

    second]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2228,7 +2228,7 @@ second] second

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2245,7 +2245,7 @@ fn regression_test_140() {

    first

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2262,7 +2262,7 @@ fn regression_test_141() { ">first

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2281,7 +2281,7 @@ fn regression_test_142() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2300,7 +2300,7 @@ fn regression_test_143() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2319,7 +2319,7 @@ fn regression_test_144() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2336,7 +2336,7 @@ fn regression_test_145() { ">first

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2355,7 +2355,7 @@ fn regression_test_146() {

    first

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2366,7 +2366,7 @@ fn regression_test_147() { let expected = r##"

    'foo'bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2382,7 +2382,7 @@ fn regression_test_148() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2398,7 +2398,7 @@ a]: https://example.com let expected = r##"

    a b

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2419,7 +2419,7 @@ fn regression_test_150() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2441,7 +2441,7 @@ baz* "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2463,7 +2463,7 @@ baz` "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2485,7 +2485,7 @@ baz](https://example.com) "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2500,7 +2500,7 @@ part of the title' part of the title">mylink

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2517,7 +2517,7 @@ starts in column three. "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2531,7 +2531,7 @@ fn regression_test_156() {

    This is not in the list at all. It's a paragraph after it.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2543,7 +2543,7 @@ fn regression_test_157() { let expected = r##"

    \!\&quot;\#\$\%\& \!\&quot;\#\$\%\& \!\&quot;\#\$\%\&

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2555,7 +2555,7 @@ fn regression_test_158() { -|- *

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2568,7 +2568,7 @@ fn regression_test_159() {

    Another paragraph whose spaces must be removed.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2583,7 +2583,7 @@ fn regression_test_160() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2598,7 +2598,7 @@ fn regression_test_161() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2608,7 +2608,7 @@ fn regression_test_162() { let expected = r##"

    &#00000000; &#x0000000;

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2618,7 +2618,7 @@ fn regression_test_163() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2634,7 +2634,7 @@ t_ "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2650,7 +2650,7 @@ N* "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2661,7 +2661,7 @@ fn regression_test_166() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2672,7 +2672,7 @@ fn regression_test_167() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2683,7 +2683,7 @@ fn regression_test_168() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2699,7 +2699,7 @@ fn regression_test_169() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2718,7 +2718,7 @@ fn regression_test_170() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2734,7 +2734,7 @@ fn regression_test_171() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2750,7 +2750,7 @@ fn regression_test_172() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2766,7 +2766,7 @@ fn regression_test_173() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2782,7 +2782,7 @@ fn regression_test_174() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2800,7 +2800,7 @@ fn regression_test_175() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2813,7 +2813,7 @@ fn regression_test_176() {

    [link]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2826,7 +2826,7 @@ fn regression_test_177() {

    [link]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2838,7 +2838,7 @@ fn regression_test_178() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2851,7 +2851,7 @@ fn regression_test_179() {

    [link]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2863,7 +2863,7 @@ fn regression_test_180() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2876,7 +2876,7 @@ fn regression_test_181() {

    [link]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2888,7 +2888,7 @@ fn regression_test_182() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2906,7 +2906,7 @@ fn regression_test_183() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2920,7 +2920,7 @@ test2

    test2

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2936,7 +2936,7 @@ test2 "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2953,7 +2953,7 @@ fn regression_test_186() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2973,7 +2973,7 @@ fn regression_test_187() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2986,7 +2986,7 @@ fn regression_test_188() {

    <!p>

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2998,7 +2998,7 @@ fn regression_test_189() { let expected = r##"

    linky

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3014,7 +3014,7 @@ junk

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3026,7 +3026,7 @@ fn regression_test_191() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3037,7 +3037,7 @@ fn regression_test_192() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3051,7 +3051,7 @@ fn regression_test_193() { text ">link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3069,7 +3069,7 @@ _** "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3084,7 +3084,7 @@ fn regression_test_195() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3097,7 +3097,7 @@ fn regression_test_196() {

    --

    "##; - test_markdown_html(original, expected, false, true, false, false); + test_markdown_html(original, expected, false, true, false, false, false); } #[test] @@ -3109,7 +3109,7 @@ fn regression_test_197() { [40](https://rust.org/something%3A((((((((((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))))))))))

    "##; - test_markdown_html(original, expected, false, true, false, false); + test_markdown_html(original, expected, false, true, false, false, false); } #[test] @@ -3124,7 +3124,7 @@ fn regression_test_198() {

    \

    "##; - test_markdown_html(original, expected, false, true, false, false); + test_markdown_html(original, expected, false, true, false, false, false); } #[test] @@ -3140,7 +3140,7 @@ bar

    bar

    "##; - test_markdown_html(original, expected, false, true, false, false); + test_markdown_html(original, expected, false, true, false, false, false); } #[test] @@ -3151,7 +3151,7 @@ fn regression_test_200() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3169,7 +3169,7 @@ fn regression_test_201() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3188,7 +3188,7 @@ fn regression_test_202() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3212,7 +3212,7 @@ T U, V W
    x:.)
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3234,7 +3234,7 @@ Some preamble foobar_raz, not barfoo_raz

    > Something is wrong!

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3251,7 +3251,7 @@ stuff](https://example.com) "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3300,7 +3300,7 @@ fn regression_test_206() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3313,5 +3313,5 @@ fn regression_test_207() { > "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/smart_punct.rs b/pulldown-cmark/tests/suite/smart_punct.rs index f4341d2f..89a653b8 100644 --- a/pulldown-cmark/tests/suite/smart_punct.rs +++ b/pulldown-cmark/tests/suite/smart_punct.rs @@ -12,7 +12,7 @@ fn smart_punct_test_1() { “‘Shelob’ is my name.”

    "##; - test_markdown_html(original, expected, true, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false); } #[test] @@ -22,7 +22,7 @@ fn smart_punct_test_2() { let expected = r##"

    ‘A’, ‘B’, and ‘C’ are letters.

    "##; - test_markdown_html(original, expected, true, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false); } #[test] @@ -34,7 +34,7 @@ So is 'pine.' So is ‘pine.’

    "##; - test_markdown_html(original, expected, true, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false); } #[test] @@ -44,7 +44,7 @@ fn smart_punct_test_4() { let expected = r##"

    ‘He said, “I want to go.”’

    "##; - test_markdown_html(original, expected, true, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false); } #[test] @@ -54,7 +54,7 @@ fn smart_punct_test_5() { let expected = r##"

    Were you alive in the 70’s?

    "##; - test_markdown_html(original, expected, true, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false); } #[test] @@ -64,7 +64,7 @@ fn smart_punct_test_6() { let expected = r##"

    Here is some quoted ‘code’ and a “quoted link”.

    "##; - test_markdown_html(original, expected, true, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false); } #[test] @@ -74,7 +74,7 @@ fn smart_punct_test_7() { let expected = r##"

    ’tis the season to be ‘jolly’

    "##; - test_markdown_html(original, expected, true, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false); } #[test] @@ -84,7 +84,7 @@ fn smart_punct_test_8() { let expected = r##"

    ‘We’ll use Jane’s boat and John’s truck,’ Jenna said.

    "##; - test_markdown_html(original, expected, true, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false); } #[test] @@ -97,7 +97,7 @@ fn smart_punct_test_9() {

    “Second paragraph by same speaker, in fiction.”

    "##; - test_markdown_html(original, expected, true, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false); } #[test] @@ -107,7 +107,7 @@ fn smart_punct_test_10() { let expected = r##"

    [a]’s b’

    "##; - test_markdown_html(original, expected, true, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false); } #[test] @@ -121,7 +121,7 @@ This isn't either. 5'8"

    "##; - test_markdown_html(original, expected, true, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false); } #[test] @@ -139,7 +139,7 @@ en – en 2–3

    "##; - test_markdown_html(original, expected, true, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false); } #[test] @@ -167,7 +167,7 @@ nine——— thirteen———––.

    "##; - test_markdown_html(original, expected, true, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false); } #[test] @@ -177,7 +177,7 @@ fn smart_punct_test_14() { let expected = r##"

    Escaped hyphens: -- ---.

    "##; - test_markdown_html(original, expected, true, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false); } #[test] @@ -187,7 +187,7 @@ fn smart_punct_test_15() { let expected = r##"

    Ellipses…and…and….

    "##; - test_markdown_html(original, expected, true, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false); } #[test] @@ -197,5 +197,5 @@ fn smart_punct_test_16() { let expected = r##"

    No ellipses...

    "##; - test_markdown_html(original, expected, true, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/spec.rs b/pulldown-cmark/tests/suite/spec.rs index 2a5520fb..da3374f6 100644 --- a/pulldown-cmark/tests/suite/spec.rs +++ b/pulldown-cmark/tests/suite/spec.rs @@ -11,7 +11,7 @@ fn spec_test_1() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -22,7 +22,7 @@ fn spec_test_2() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -35,7 +35,7 @@ fn spec_test_3() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -52,7 +52,7 @@ fn spec_test_4() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -70,7 +70,7 @@ fn spec_test_5() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -83,7 +83,7 @@ fn spec_test_6() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -98,7 +98,7 @@ fn spec_test_7() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -111,7 +111,7 @@ bar "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -133,7 +133,7 @@ fn spec_test_9() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -143,7 +143,7 @@ fn spec_test_10() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -153,7 +153,7 @@ fn spec_test_11() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -163,7 +163,7 @@ fn spec_test_12() { let expected = r##"

    !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -173,7 +173,7 @@ fn spec_test_13() { let expected = r##"

    \ \A\a\ \3\φ\«

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -199,7 +199,7 @@ fn spec_test_14() { &ouml; not a character entity

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -209,7 +209,7 @@ fn spec_test_15() { let expected = r##"

    \emphasis

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -221,7 +221,7 @@ bar bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -231,7 +231,7 @@ fn spec_test_17() { let expected = r##"

    \[\`

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -242,7 +242,7 @@ fn spec_test_18() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -255,7 +255,7 @@ fn spec_test_19() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -265,7 +265,7 @@ fn spec_test_20() { let expected = r##"

    https://example.com?find=\*

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -275,7 +275,7 @@ fn spec_test_21() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -285,7 +285,7 @@ fn spec_test_22() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -297,7 +297,7 @@ fn spec_test_23() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -310,7 +310,7 @@ foo "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -324,7 +324,7 @@ fn spec_test_25() { ∲ ≧̸

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -334,7 +334,7 @@ fn spec_test_26() { let expected = r##"

    # Ӓ Ϡ �

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -344,7 +344,7 @@ fn spec_test_27() { let expected = r##"

    " ആ ಫ

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -360,7 +360,7 @@ fn spec_test_28() { &ThisIsNotDefined; &hi?;

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -370,7 +370,7 @@ fn spec_test_29() { let expected = r##"

    &copy

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -380,7 +380,7 @@ fn spec_test_30() { let expected = r##"

    &MadeUpEntity;

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -390,7 +390,7 @@ fn spec_test_31() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -400,7 +400,7 @@ fn spec_test_32() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -412,7 +412,7 @@ fn spec_test_33() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -425,7 +425,7 @@ foo "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -435,7 +435,7 @@ fn spec_test_35() { let expected = r##"

    f&ouml;&ouml;

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -446,7 +446,7 @@ fn spec_test_36() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -458,7 +458,7 @@ fn spec_test_37() { foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -473,7 +473,7 @@ fn spec_test_38() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -485,7 +485,7 @@ fn spec_test_39() { bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -495,7 +495,7 @@ fn spec_test_40() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -505,7 +505,7 @@ fn spec_test_41() { let expected = r##"

    [a](url "tit")

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -519,7 +519,7 @@ fn spec_test_42() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -533,7 +533,7 @@ ___
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -543,7 +543,7 @@ fn spec_test_44() { let expected = r##"

    +++

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -553,7 +553,7 @@ fn spec_test_45() { let expected = r##"

    ===

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -567,7 +567,7 @@ __ __

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -581,7 +581,7 @@ fn spec_test_47() {
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -592,7 +592,7 @@ fn spec_test_48() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -604,7 +604,7 @@ fn spec_test_49() { ***

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -614,7 +614,7 @@ fn spec_test_50() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -624,7 +624,7 @@ fn spec_test_51() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -634,7 +634,7 @@ fn spec_test_52() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -644,7 +644,7 @@ fn spec_test_53() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -654,7 +654,7 @@ fn spec_test_54() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -670,7 +670,7 @@ a------

    ---a---

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -680,7 +680,7 @@ fn spec_test_56() { let expected = r##"

    -

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -698,7 +698,7 @@ fn spec_test_57() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -712,7 +712,7 @@ bar

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -725,7 +725,7 @@ bar

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -743,7 +743,7 @@ fn spec_test_60() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -759,7 +759,7 @@ fn spec_test_61() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -779,7 +779,7 @@ fn spec_test_62() {
    foo
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -789,7 +789,7 @@ fn spec_test_63() { let expected = r##"

    ####### foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -802,7 +802,7 @@ fn spec_test_64() {

    #hashtag

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -812,7 +812,7 @@ fn spec_test_65() { let expected = r##"

    ## foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -822,7 +822,7 @@ fn spec_test_66() { let expected = r##"

    foo bar *baz*

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -832,7 +832,7 @@ fn spec_test_67() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -846,7 +846,7 @@ fn spec_test_68() {

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -857,7 +857,7 @@ fn spec_test_69() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -869,7 +869,7 @@ fn spec_test_70() { # bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -881,7 +881,7 @@ fn spec_test_71() {

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -893,7 +893,7 @@ fn spec_test_72() {
    foo
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -903,7 +903,7 @@ fn spec_test_73() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -913,7 +913,7 @@ fn spec_test_74() { let expected = r##"

    foo ### b

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -923,7 +923,7 @@ fn spec_test_75() { let expected = r##"

    foo#

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -937,7 +937,7 @@ fn spec_test_76() {

    foo #

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -951,7 +951,7 @@ fn spec_test_77() {
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -965,7 +965,7 @@ Bar foo

    Bar foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -979,7 +979,7 @@ fn spec_test_79() {

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -994,7 +994,7 @@ Foo *bar*

    Foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1007,7 +1007,7 @@ baz* baz "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1020,7 +1020,7 @@ baz* baz "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1035,7 +1035,7 @@ Foo

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1054,7 +1054,7 @@ fn spec_test_84() {

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1073,7 +1073,7 @@ Foo
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1084,7 +1084,7 @@ fn spec_test_86() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1096,7 +1096,7 @@ fn spec_test_87() { ---

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1113,7 +1113,7 @@ Foo
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1124,7 +1124,7 @@ fn spec_test_89() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1135,7 +1135,7 @@ fn spec_test_90() { let expected = r##"

    Foo\

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1154,7 +1154,7 @@ of dashes"/>

    of dashes"/>

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1168,7 +1168,7 @@ fn spec_test_92() {
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1184,7 +1184,7 @@ bar "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1198,7 +1198,7 @@ fn spec_test_94() {
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1211,7 +1211,7 @@ Bar Bar "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1229,7 +1229,7 @@ Baz

    Baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1240,7 +1240,7 @@ fn spec_test_97() { let expected = r##"

    ====

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1252,7 +1252,7 @@ fn spec_test_98() {
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1266,7 +1266,7 @@ fn spec_test_99() {
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1279,7 +1279,7 @@ fn spec_test_100() {
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1293,7 +1293,7 @@ fn spec_test_101() {
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1304,7 +1304,7 @@ fn spec_test_102() { let expected = r##"

    > foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1320,7 +1320,7 @@ baz

    baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1338,7 +1338,7 @@ bar

    baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1354,7 +1354,7 @@ bar

    baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1370,7 +1370,7 @@ bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1383,7 +1383,7 @@ fn spec_test_107() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1400,7 +1400,7 @@ fn spec_test_108() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1419,7 +1419,7 @@ fn spec_test_109() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1436,7 +1436,7 @@ fn spec_test_110() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1459,7 +1459,7 @@ chunk3 "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1474,7 +1474,7 @@ fn spec_test_112() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1487,7 +1487,7 @@ fn spec_test_113() { bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1500,7 +1500,7 @@ bar

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1521,7 +1521,7 @@ Heading
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1534,7 +1534,7 @@ bar "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1549,7 +1549,7 @@ fn spec_test_117() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1560,7 +1560,7 @@ fn spec_test_118() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1575,7 +1575,7 @@ fn spec_test_119() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1590,7 +1590,7 @@ fn spec_test_120() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1602,7 +1602,7 @@ foo let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1617,7 +1617,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1632,7 +1632,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1647,7 +1647,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1662,7 +1662,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1672,7 +1672,7 @@ fn spec_test_126() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1688,7 +1688,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1705,7 +1705,7 @@ bbb

    bbb

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1720,7 +1720,7 @@ fn spec_test_129() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1731,7 +1731,7 @@ fn spec_test_130() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1746,7 +1746,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1763,7 +1763,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1780,7 +1780,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1795,7 +1795,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1808,7 +1808,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1821,7 +1821,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1835,7 +1835,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1847,7 +1847,7 @@ aaa aaa

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1861,7 +1861,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1878,7 +1878,7 @@ baz

    baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1896,7 +1896,7 @@ bar

    baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1913,7 +1913,7 @@ end "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1930,7 +1930,7 @@ end "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1941,7 +1941,7 @@ fn spec_test_144() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1953,7 +1953,7 @@ foo foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1966,7 +1966,7 @@ foo "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -1979,7 +1979,7 @@ fn spec_test_147() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2000,7 +2000,7 @@ _world_. "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2025,7 +2025,7 @@ okay.

    okay.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2039,7 +2039,7 @@ fn spec_test_150() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2051,7 +2051,7 @@ fn spec_test_151() { *foo* "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2067,7 +2067,7 @@ fn spec_test_152() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2081,7 +2081,7 @@ fn spec_test_153() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2095,7 +2095,7 @@ fn spec_test_154() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2110,7 +2110,7 @@ fn spec_test_155() {

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2122,7 +2122,7 @@ fn spec_test_156() { *hi* "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2134,7 +2134,7 @@ foo foo "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2146,7 +2146,7 @@ fn spec_test_158() { *foo* "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2156,7 +2156,7 @@ fn spec_test_159() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2170,7 +2170,7 @@ foo "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2186,7 +2186,7 @@ int x = 33; ``` "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2200,7 +2200,7 @@ fn spec_test_162() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2214,7 +2214,7 @@ fn spec_test_163() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2228,7 +2228,7 @@ fn spec_test_164() {
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2240,7 +2240,7 @@ fn spec_test_165() { *bar* "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2254,7 +2254,7 @@ fn spec_test_166() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2270,7 +2270,7 @@ fn spec_test_167() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2280,7 +2280,7 @@ fn spec_test_168() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2302,7 +2302,7 @@ main = print $ parseTags tags

    okay

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2322,7 +2322,7 @@ document.getElementById("demo").innerHTML = "Hello JavaScript!";

    okay

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2344,7 +2344,7 @@ _bar_ "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2366,7 +2366,7 @@ p {color:blue;}

    okay

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2382,7 +2382,7 @@ foo foo "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2399,7 +2399,7 @@ foo

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2415,7 +2415,7 @@ fn spec_test_175() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2427,7 +2427,7 @@ fn spec_test_176() {

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2439,7 +2439,7 @@ fn spec_test_177() {

    baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2453,7 +2453,7 @@ foo 1. *bar* "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2471,7 +2471,7 @@ bar

    okay

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2491,7 +2491,7 @@ okay

    okay

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2501,7 +2501,7 @@ fn spec_test_181() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2535,7 +2535,7 @@ function matchwo(a,b)

    okay

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2549,7 +2549,7 @@ fn spec_test_183() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2563,7 +2563,7 @@ fn spec_test_184() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2579,7 +2579,7 @@ bar "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2595,7 +2595,7 @@ bar *foo* "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2609,7 +2609,7 @@ baz baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2625,7 +2625,7 @@ fn spec_test_188() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2639,7 +2639,7 @@ fn spec_test_189() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2665,7 +2665,7 @@ Hi "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2692,7 +2692,7 @@ fn spec_test_191() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2704,7 +2704,7 @@ fn spec_test_192() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2718,7 +2718,7 @@ fn spec_test_193() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2730,7 +2730,7 @@ fn spec_test_194() { let expected = r##"

    Foo*bar]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2744,7 +2744,7 @@ fn spec_test_195() { let expected = r##"

    Foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2764,7 +2764,7 @@ line2 ">foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2780,7 +2780,7 @@ with blank line'

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2793,7 +2793,7 @@ fn spec_test_198() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2806,7 +2806,7 @@ fn spec_test_199() {

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2818,7 +2818,7 @@ fn spec_test_200() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2831,7 +2831,7 @@ fn spec_test_201() {

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2843,7 +2843,7 @@ fn spec_test_202() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2855,7 +2855,7 @@ fn spec_test_203() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2868,7 +2868,7 @@ fn spec_test_204() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2880,7 +2880,7 @@ fn spec_test_205() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2892,7 +2892,7 @@ fn spec_test_206() { let expected = r##"

    αγω

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2901,7 +2901,7 @@ fn spec_test_207() { "##; let expected = r##""##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2914,7 +2914,7 @@ bar let expected = r##"

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2924,7 +2924,7 @@ fn spec_test_209() { let expected = r##"

    [foo]: /url "title" ok

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2935,7 +2935,7 @@ fn spec_test_210() { let expected = r##"

    "title" ok

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2949,7 +2949,7 @@ fn spec_test_211() {

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2965,7 +2965,7 @@ fn spec_test_212() {

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2980,7 +2980,7 @@ fn spec_test_213() {

    [bar]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -2995,7 +2995,7 @@ fn spec_test_214() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3009,7 +3009,7 @@ bar

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3022,7 +3022,7 @@ fn spec_test_216() { foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3041,7 +3041,7 @@ fn spec_test_217() { baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3055,7 +3055,7 @@ fn spec_test_218() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3068,7 +3068,7 @@ bbb

    bbb

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3085,7 +3085,7 @@ bbb

    ddd

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3099,7 +3099,7 @@ bbb

    bbb

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3111,7 +3111,7 @@ fn spec_test_222() { bbb

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3125,7 +3125,7 @@ bbb ccc

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3137,7 +3137,7 @@ bbb bbb

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3150,7 +3150,7 @@ bbb

    bbb

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3162,7 +3162,7 @@ bbb bbb

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3180,7 +3180,7 @@ aaa

    aaa

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3196,7 +3196,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3212,7 +3212,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3228,7 +3228,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3243,7 +3243,7 @@ fn spec_test_231() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3259,7 +3259,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3275,7 +3275,7 @@ foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3289,7 +3289,7 @@ fn spec_test_234() {
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3307,7 +3307,7 @@ fn spec_test_235() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3323,7 +3323,7 @@ fn spec_test_236() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3339,7 +3339,7 @@ foo
    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3353,7 +3353,7 @@ fn spec_test_238() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3364,7 +3364,7 @@ fn spec_test_239() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3377,7 +3377,7 @@ fn spec_test_240() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3391,7 +3391,7 @@ fn spec_test_241() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3408,7 +3408,7 @@ fn spec_test_242() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3422,7 +3422,7 @@ bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3437,7 +3437,7 @@ fn spec_test_244() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3451,7 +3451,7 @@ fn spec_test_245() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3469,7 +3469,7 @@ fn spec_test_246() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3483,7 +3483,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3498,7 +3498,7 @@ baz

    baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3513,7 +3513,7 @@ baz

    baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3531,7 +3531,7 @@ bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3551,7 +3551,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3569,7 +3569,7 @@ fn spec_test_252() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3590,7 +3590,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3615,7 +3615,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3630,7 +3630,7 @@ fn spec_test_255() {

    two

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3647,7 +3647,7 @@ fn spec_test_256() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3663,7 +3663,7 @@ fn spec_test_257() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3680,7 +3680,7 @@ fn spec_test_258() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3701,7 +3701,7 @@ fn spec_test_259() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3720,7 +3720,7 @@ fn spec_test_260() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3733,7 +3733,7 @@ fn spec_test_261() {

    2.two

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3751,7 +3751,7 @@ fn spec_test_262() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3779,7 +3779,7 @@ fn spec_test_263() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3803,7 +3803,7 @@ baz "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3815,7 +3815,7 @@ fn spec_test_265() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3825,7 +3825,7 @@ fn spec_test_266() { let expected = r##"

    1234567890. not ok

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3837,7 +3837,7 @@ fn spec_test_267() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3849,7 +3849,7 @@ fn spec_test_268() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3859,7 +3859,7 @@ fn spec_test_269() { let expected = r##"

    -1. not ok

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3877,7 +3877,7 @@ fn spec_test_270() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3895,7 +3895,7 @@ fn spec_test_271() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3913,7 +3913,7 @@ paragraph "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3935,7 +3935,7 @@ fn spec_test_273() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3957,7 +3957,7 @@ fn spec_test_274() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3970,7 +3970,7 @@ bar

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -3985,7 +3985,7 @@ fn spec_test_276() {

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4002,7 +4002,7 @@ fn spec_test_277() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4029,7 +4029,7 @@ fn spec_test_278() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4042,7 +4042,7 @@ fn spec_test_279() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4057,7 +4057,7 @@ fn spec_test_280() {

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4073,7 +4073,7 @@ fn spec_test_281() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4089,7 +4089,7 @@ fn spec_test_282() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4105,7 +4105,7 @@ fn spec_test_283() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4117,7 +4117,7 @@ fn spec_test_284() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4134,7 +4134,7 @@ foo 1.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4159,7 +4159,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4184,7 +4184,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4209,7 +4209,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4230,7 +4230,7 @@ fn spec_test_289() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4255,7 +4255,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4269,7 +4269,7 @@ with two lines. "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4289,7 +4289,7 @@ continued here.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4309,7 +4309,7 @@ continued here.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4336,7 +4336,7 @@ fn spec_test_294() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4354,7 +4354,7 @@ fn spec_test_295() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4371,7 +4371,7 @@ fn spec_test_296() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4387,7 +4387,7 @@ fn spec_test_297() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4403,7 +4403,7 @@ fn spec_test_298() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4423,7 +4423,7 @@ fn spec_test_299() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4443,7 +4443,7 @@ baz "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4461,7 +4461,7 @@ fn spec_test_301() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4479,7 +4479,7 @@ fn spec_test_302() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4495,7 +4495,7 @@ fn spec_test_303() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4507,7 +4507,7 @@ fn spec_test_304() { 14. The number of doors is 6.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4521,7 +4521,7 @@ fn spec_test_305() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4546,7 +4546,7 @@ fn spec_test_306() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4574,7 +4574,7 @@ fn spec_test_307() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4598,7 +4598,7 @@ fn spec_test_308() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4627,7 +4627,7 @@ fn spec_test_309() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4651,7 +4651,7 @@ fn spec_test_310() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4675,7 +4675,7 @@ fn spec_test_311() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4695,7 +4695,7 @@ fn spec_test_312() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4718,7 +4718,7 @@ fn spec_test_313() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4741,7 +4741,7 @@ fn spec_test_314() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4762,7 +4762,7 @@ fn spec_test_315() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4787,7 +4787,7 @@ fn spec_test_316() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4811,7 +4811,7 @@ fn spec_test_317() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4836,7 +4836,7 @@ fn spec_test_318() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4860,7 +4860,7 @@ fn spec_test_319() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4880,7 +4880,7 @@ fn spec_test_320() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4904,7 +4904,7 @@ fn spec_test_321() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4916,7 +4916,7 @@ fn spec_test_322() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4933,7 +4933,7 @@ fn spec_test_323() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4953,7 +4953,7 @@ fn spec_test_324() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -4974,7 +4974,7 @@ fn spec_test_325() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5005,7 +5005,7 @@ fn spec_test_326() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5015,7 +5015,7 @@ fn spec_test_327() { let expected = r##"

    hilo`

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5025,7 +5025,7 @@ fn spec_test_328() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5035,7 +5035,7 @@ fn spec_test_329() { let expected = r##"

    foo ` bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5045,7 +5045,7 @@ fn spec_test_330() { let expected = r##"

    ``

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5055,7 +5055,7 @@ fn spec_test_331() { let expected = r##"

    ``

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5065,7 +5065,7 @@ fn spec_test_332() { let expected = r##"

    a

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5075,7 +5075,7 @@ fn spec_test_333() { let expected = r##"

     b 

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5087,7 +5087,7 @@ fn spec_test_334() {

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5101,7 +5101,7 @@ baz let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5113,7 +5113,7 @@ foo let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5124,7 +5124,7 @@ baz` let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5134,7 +5134,7 @@ fn spec_test_338() { let expected = r##"

    foo\bar`

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5144,7 +5144,7 @@ fn spec_test_339() { let expected = r##"

    foo`bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5154,7 +5154,7 @@ fn spec_test_340() { let expected = r##"

    foo `` bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5164,7 +5164,7 @@ fn spec_test_341() { let expected = r##"

    *foo*

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5174,7 +5174,7 @@ fn spec_test_342() { let expected = r##"

    [not a link](/foo)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5184,7 +5184,7 @@ fn spec_test_343() { let expected = r##"

    <a href="">`

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5194,7 +5194,7 @@ fn spec_test_344() { let expected = r##"

    `

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5204,7 +5204,7 @@ fn spec_test_345() { let expected = r##"

    <https://foo.bar.baz>`

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5214,7 +5214,7 @@ fn spec_test_346() { let expected = r##"

    https://foo.bar.`baz`

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5224,7 +5224,7 @@ fn spec_test_347() { let expected = r##"

    ```foo``

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5234,7 +5234,7 @@ fn spec_test_348() { let expected = r##"

    `foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5244,7 +5244,7 @@ fn spec_test_349() { let expected = r##"

    `foobar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5254,7 +5254,7 @@ fn spec_test_350() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5264,7 +5264,7 @@ fn spec_test_351() { let expected = r##"

    a * foo bar*

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5274,7 +5274,7 @@ fn spec_test_352() { let expected = r##"

    a*"foo"*

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5284,7 +5284,7 @@ fn spec_test_353() { let expected = r##"

    * a *

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5300,7 +5300,7 @@ fn spec_test_354() {

    *€*charlie.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5310,7 +5310,7 @@ fn spec_test_355() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5320,7 +5320,7 @@ fn spec_test_356() { let expected = r##"

    5678

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5330,7 +5330,7 @@ fn spec_test_357() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5340,7 +5340,7 @@ fn spec_test_358() { let expected = r##"

    _ foo bar_

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5350,7 +5350,7 @@ fn spec_test_359() { let expected = r##"

    a_"foo"_

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5360,7 +5360,7 @@ fn spec_test_360() { let expected = r##"

    foo_bar_

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5370,7 +5370,7 @@ fn spec_test_361() { let expected = r##"

    5_6_78

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5380,7 +5380,7 @@ fn spec_test_362() { let expected = r##"

    пристаням_стремятся_

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5390,7 +5390,7 @@ fn spec_test_363() { let expected = r##"

    aa_"bb"_cc

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5400,7 +5400,7 @@ fn spec_test_364() { let expected = r##"

    foo-(bar)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5410,7 +5410,7 @@ fn spec_test_365() { let expected = r##"

    _foo*

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5420,7 +5420,7 @@ fn spec_test_366() { let expected = r##"

    *foo bar *

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5432,7 +5432,7 @@ fn spec_test_367() { *

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5442,7 +5442,7 @@ fn spec_test_368() { let expected = r##"

    *(*foo)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5452,7 +5452,7 @@ fn spec_test_369() { let expected = r##"

    (foo)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5462,7 +5462,7 @@ fn spec_test_370() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5472,7 +5472,7 @@ fn spec_test_371() { let expected = r##"

    _foo bar _

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5482,7 +5482,7 @@ fn spec_test_372() { let expected = r##"

    _(_foo)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5492,7 +5492,7 @@ fn spec_test_373() { let expected = r##"

    (foo)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5502,7 +5502,7 @@ fn spec_test_374() { let expected = r##"

    _foo_bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5512,7 +5512,7 @@ fn spec_test_375() { let expected = r##"

    _пристаням_стремятся

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5522,7 +5522,7 @@ fn spec_test_376() { let expected = r##"

    foo_bar_baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5532,7 +5532,7 @@ fn spec_test_377() { let expected = r##"

    (bar).

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5542,7 +5542,7 @@ fn spec_test_378() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5552,7 +5552,7 @@ fn spec_test_379() { let expected = r##"

    ** foo bar**

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5562,7 +5562,7 @@ fn spec_test_380() { let expected = r##"

    a**"foo"**

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5572,7 +5572,7 @@ fn spec_test_381() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5582,7 +5582,7 @@ fn spec_test_382() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5592,7 +5592,7 @@ fn spec_test_383() { let expected = r##"

    __ foo bar__

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5604,7 +5604,7 @@ foo bar__ foo bar__

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5614,7 +5614,7 @@ fn spec_test_385() { let expected = r##"

    a__"foo"__

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5624,7 +5624,7 @@ fn spec_test_386() { let expected = r##"

    foo__bar__

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5634,7 +5634,7 @@ fn spec_test_387() { let expected = r##"

    5__6__78

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5644,7 +5644,7 @@ fn spec_test_388() { let expected = r##"

    пристаням__стремятся__

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5654,7 +5654,7 @@ fn spec_test_389() { let expected = r##"

    foo, bar, baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5664,7 +5664,7 @@ fn spec_test_390() { let expected = r##"

    foo-(bar)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5674,7 +5674,7 @@ fn spec_test_391() { let expected = r##"

    **foo bar **

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5684,7 +5684,7 @@ fn spec_test_392() { let expected = r##"

    **(**foo)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5694,7 +5694,7 @@ fn spec_test_393() { let expected = r##"

    (foo)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5706,7 +5706,7 @@ fn spec_test_394() { Asclepias physocarpa)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5716,7 +5716,7 @@ fn spec_test_395() { let expected = r##"

    foo "bar" foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5726,7 +5726,7 @@ fn spec_test_396() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5736,7 +5736,7 @@ fn spec_test_397() { let expected = r##"

    __foo bar __

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5746,7 +5746,7 @@ fn spec_test_398() { let expected = r##"

    __(__foo)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5756,7 +5756,7 @@ fn spec_test_399() { let expected = r##"

    (foo)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5766,7 +5766,7 @@ fn spec_test_400() { let expected = r##"

    __foo__bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5776,7 +5776,7 @@ fn spec_test_401() { let expected = r##"

    __пристаням__стремятся

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5786,7 +5786,7 @@ fn spec_test_402() { let expected = r##"

    foo__bar__baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5796,7 +5796,7 @@ fn spec_test_403() { let expected = r##"

    (bar).

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5806,7 +5806,7 @@ fn spec_test_404() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5818,7 +5818,7 @@ bar* bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5828,7 +5828,7 @@ fn spec_test_406() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5838,7 +5838,7 @@ fn spec_test_407() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5848,7 +5848,7 @@ fn spec_test_408() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5858,7 +5858,7 @@ fn spec_test_409() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5868,7 +5868,7 @@ fn spec_test_410() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5878,7 +5878,7 @@ fn spec_test_411() { let expected = r##"

    foobarbaz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5888,7 +5888,7 @@ fn spec_test_412() { let expected = r##"

    foo**bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5898,7 +5898,7 @@ fn spec_test_413() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5908,7 +5908,7 @@ fn spec_test_414() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5918,7 +5918,7 @@ fn spec_test_415() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5928,7 +5928,7 @@ fn spec_test_416() { let expected = r##"

    foobarbaz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5938,7 +5938,7 @@ fn spec_test_417() { let expected = r##"

    foobar***baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5948,7 +5948,7 @@ fn spec_test_418() { let expected = r##"

    foo bar baz bim bop

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5958,7 +5958,7 @@ fn spec_test_419() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5968,7 +5968,7 @@ fn spec_test_420() { let expected = r##"

    ** is not an empty emphasis

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5978,7 +5978,7 @@ fn spec_test_421() { let expected = r##"

    **** is not an empty strong emphasis

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -5988,7 +5988,7 @@ fn spec_test_422() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6000,7 +6000,7 @@ bar** bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6010,7 +6010,7 @@ fn spec_test_424() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6020,7 +6020,7 @@ fn spec_test_425() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6030,7 +6030,7 @@ fn spec_test_426() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6040,7 +6040,7 @@ fn spec_test_427() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6050,7 +6050,7 @@ fn spec_test_428() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6060,7 +6060,7 @@ fn spec_test_429() { let expected = r##"

    foobarbaz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6070,7 +6070,7 @@ fn spec_test_430() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6080,7 +6080,7 @@ fn spec_test_431() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6092,7 +6092,7 @@ bim* bop** bim bop

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6102,7 +6102,7 @@ fn spec_test_433() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6112,7 +6112,7 @@ fn spec_test_434() { let expected = r##"

    __ is not an empty emphasis

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6122,7 +6122,7 @@ fn spec_test_435() { let expected = r##"

    ____ is not an empty strong emphasis

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6132,7 +6132,7 @@ fn spec_test_436() { let expected = r##"

    foo ***

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6142,7 +6142,7 @@ fn spec_test_437() { let expected = r##"

    foo *

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6152,7 +6152,7 @@ fn spec_test_438() { let expected = r##"

    foo _

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6162,7 +6162,7 @@ fn spec_test_439() { let expected = r##"

    foo *****

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6172,7 +6172,7 @@ fn spec_test_440() { let expected = r##"

    foo *

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6182,7 +6182,7 @@ fn spec_test_441() { let expected = r##"

    foo _

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6192,7 +6192,7 @@ fn spec_test_442() { let expected = r##"

    *foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6202,7 +6202,7 @@ fn spec_test_443() { let expected = r##"

    foo*

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6212,7 +6212,7 @@ fn spec_test_444() { let expected = r##"

    *foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6222,7 +6222,7 @@ fn spec_test_445() { let expected = r##"

    ***foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6232,7 +6232,7 @@ fn spec_test_446() { let expected = r##"

    foo*

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6242,7 +6242,7 @@ fn spec_test_447() { let expected = r##"

    foo***

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6252,7 +6252,7 @@ fn spec_test_448() { let expected = r##"

    foo ___

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6262,7 +6262,7 @@ fn spec_test_449() { let expected = r##"

    foo _

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6272,7 +6272,7 @@ fn spec_test_450() { let expected = r##"

    foo *

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6282,7 +6282,7 @@ fn spec_test_451() { let expected = r##"

    foo _____

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6292,7 +6292,7 @@ fn spec_test_452() { let expected = r##"

    foo _

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6302,7 +6302,7 @@ fn spec_test_453() { let expected = r##"

    foo *

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6312,7 +6312,7 @@ fn spec_test_454() { let expected = r##"

    _foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6322,7 +6322,7 @@ fn spec_test_455() { let expected = r##"

    foo_

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6332,7 +6332,7 @@ fn spec_test_456() { let expected = r##"

    _foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6342,7 +6342,7 @@ fn spec_test_457() { let expected = r##"

    ___foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6352,7 +6352,7 @@ fn spec_test_458() { let expected = r##"

    foo_

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6362,7 +6362,7 @@ fn spec_test_459() { let expected = r##"

    foo___

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6372,7 +6372,7 @@ fn spec_test_460() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6382,7 +6382,7 @@ fn spec_test_461() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6392,7 +6392,7 @@ fn spec_test_462() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6402,7 +6402,7 @@ fn spec_test_463() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6412,7 +6412,7 @@ fn spec_test_464() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6422,7 +6422,7 @@ fn spec_test_465() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6432,7 +6432,7 @@ fn spec_test_466() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6442,7 +6442,7 @@ fn spec_test_467() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6452,7 +6452,7 @@ fn spec_test_468() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6462,7 +6462,7 @@ fn spec_test_469() { let expected = r##"

    foo _bar baz_

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6472,7 +6472,7 @@ fn spec_test_470() { let expected = r##"

    foo bar *baz bim bam

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6482,7 +6482,7 @@ fn spec_test_471() { let expected = r##"

    **foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6492,7 +6492,7 @@ fn spec_test_472() { let expected = r##"

    *foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6502,7 +6502,7 @@ fn spec_test_473() { let expected = r##"

    *bar*

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6512,7 +6512,7 @@ fn spec_test_474() { let expected = r##"

    _foo bar_

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6522,7 +6522,7 @@ fn spec_test_475() { let expected = r##"

    *

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6532,7 +6532,7 @@ fn spec_test_476() { let expected = r##"

    **

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6542,7 +6542,7 @@ fn spec_test_477() { let expected = r##"

    __

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6552,7 +6552,7 @@ fn spec_test_478() { let expected = r##"

    a *

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6562,7 +6562,7 @@ fn spec_test_479() { let expected = r##"

    a _

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6572,7 +6572,7 @@ fn spec_test_480() { let expected = r##"

    **ahttps://foo.bar/?q=**

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6582,7 +6582,7 @@ fn spec_test_481() { let expected = r##"

    __ahttps://foo.bar/?q=__

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6592,7 +6592,7 @@ fn spec_test_482() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6602,7 +6602,7 @@ fn spec_test_483() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6612,7 +6612,7 @@ fn spec_test_484() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6622,7 +6622,7 @@ fn spec_test_485() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6632,7 +6632,7 @@ fn spec_test_486() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6642,7 +6642,7 @@ fn spec_test_487() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6652,7 +6652,7 @@ fn spec_test_488() { let expected = r##"

    [link](/my uri)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6662,7 +6662,7 @@ fn spec_test_489() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6674,7 +6674,7 @@ bar) bar)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6686,7 +6686,7 @@ bar>) bar>)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6696,7 +6696,7 @@ fn spec_test_492() { let expected = r##"

    a

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6706,7 +6706,7 @@ fn spec_test_493() { let expected = r##"

    [link](<foo>)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6720,7 +6720,7 @@ fn spec_test_494() { [a](c)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6730,7 +6730,7 @@ fn spec_test_495() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6740,7 +6740,7 @@ fn spec_test_496() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6750,7 +6750,7 @@ fn spec_test_497() { let expected = r##"

    [link](foo(and(bar))

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6760,7 +6760,7 @@ fn spec_test_498() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6770,7 +6770,7 @@ fn spec_test_499() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6780,7 +6780,7 @@ fn spec_test_500() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6796,7 +6796,7 @@ fn spec_test_501() {

    link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6806,7 +6806,7 @@ fn spec_test_502() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6816,7 +6816,7 @@ fn spec_test_503() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6826,7 +6826,7 @@ fn spec_test_504() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6840,7 +6840,7 @@ fn spec_test_505() { link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6850,7 +6850,7 @@ fn spec_test_506() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6860,7 +6860,7 @@ fn spec_test_507() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6870,7 +6870,7 @@ fn spec_test_508() { let expected = r##"

    [link](/url "title "and" title")

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6880,7 +6880,7 @@ fn spec_test_509() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6891,7 +6891,7 @@ fn spec_test_510() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6901,7 +6901,7 @@ fn spec_test_511() { let expected = r##"

    [link] (/uri)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6911,7 +6911,7 @@ fn spec_test_512() { let expected = r##"

    link [foo [bar]]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6921,7 +6921,7 @@ fn spec_test_513() { let expected = r##"

    [link] bar](/uri)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6931,7 +6931,7 @@ fn spec_test_514() { let expected = r##"

    [link bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6941,7 +6941,7 @@ fn spec_test_515() { let expected = r##"

    link [bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6951,7 +6951,7 @@ fn spec_test_516() { let expected = r##"

    link foo bar #

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6961,7 +6961,7 @@ fn spec_test_517() { let expected = r##"

    moon

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6971,7 +6971,7 @@ fn spec_test_518() { let expected = r##"

    [foo bar](/uri)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6981,7 +6981,7 @@ fn spec_test_519() { let expected = r##"

    [foo [bar baz](/uri)](/uri)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -6991,7 +6991,7 @@ fn spec_test_520() { let expected = r##"

    [foo](uri2)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7001,7 +7001,7 @@ fn spec_test_521() { let expected = r##"

    *foo*

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7011,7 +7011,7 @@ fn spec_test_522() { let expected = r##"

    foo *bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7021,7 +7021,7 @@ fn spec_test_523() { let expected = r##"

    foo [bar baz]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7031,7 +7031,7 @@ fn spec_test_524() { let expected = r##"

    [foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7041,7 +7041,7 @@ fn spec_test_525() { let expected = r##"

    [foo](/uri)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7051,7 +7051,7 @@ fn spec_test_526() { let expected = r##"

    [foohttps://example.com/?search=](uri)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7063,7 +7063,7 @@ fn spec_test_527() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7075,7 +7075,7 @@ fn spec_test_528() { let expected = r##"

    link [foo [bar]]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7087,7 +7087,7 @@ fn spec_test_529() { let expected = r##"

    link [bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7099,7 +7099,7 @@ fn spec_test_530() { let expected = r##"

    link foo bar #

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7111,7 +7111,7 @@ fn spec_test_531() { let expected = r##"

    moon

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7123,7 +7123,7 @@ fn spec_test_532() { let expected = r##"

    [foo bar]ref

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7135,7 +7135,7 @@ fn spec_test_533() { let expected = r##"

    [foo bar baz]ref

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7147,7 +7147,7 @@ fn spec_test_534() { let expected = r##"

    *foo*

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7159,7 +7159,7 @@ fn spec_test_535() { let expected = r##"

    foo *bar*

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7171,7 +7171,7 @@ fn spec_test_536() { let expected = r##"

    [foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7183,7 +7183,7 @@ fn spec_test_537() { let expected = r##"

    [foo][ref]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7195,7 +7195,7 @@ fn spec_test_538() { let expected = r##"

    [foohttps://example.com/?search=][ref]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7207,7 +7207,7 @@ fn spec_test_539() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7219,7 +7219,7 @@ fn spec_test_540() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7232,7 +7232,7 @@ fn spec_test_541() { let expected = r##"

    Baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7244,7 +7244,7 @@ fn spec_test_542() { let expected = r##"

    [foo] bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7258,7 +7258,7 @@ fn spec_test_543() { bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7272,7 +7272,7 @@ fn spec_test_544() { let expected = r##"

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7284,7 +7284,7 @@ fn spec_test_545() { let expected = r##"

    [bar][foo!]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7297,7 +7297,7 @@ fn spec_test_546() {

    [ref[]: /uri

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7310,7 +7310,7 @@ fn spec_test_547() {

    [ref[bar]]: /uri

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7323,7 +7323,7 @@ fn spec_test_548() {

    [[[foo]]]: /url

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7335,7 +7335,7 @@ fn spec_test_549() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7347,7 +7347,7 @@ fn spec_test_550() { let expected = r##"

    bar\

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7360,7 +7360,7 @@ fn spec_test_551() {

    []: /uri

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7377,7 +7377,7 @@ fn spec_test_552() { ]: /uri

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7389,7 +7389,7 @@ fn spec_test_553() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7401,7 +7401,7 @@ fn spec_test_554() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7413,7 +7413,7 @@ fn spec_test_555() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7427,7 +7427,7 @@ fn spec_test_556() { []

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7439,7 +7439,7 @@ fn spec_test_557() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7451,7 +7451,7 @@ fn spec_test_558() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7463,7 +7463,7 @@ fn spec_test_559() { let expected = r##"

    [foo bar]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7475,7 +7475,7 @@ fn spec_test_560() { let expected = r##"

    [[bar foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7487,7 +7487,7 @@ fn spec_test_561() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7499,7 +7499,7 @@ fn spec_test_562() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7511,7 +7511,7 @@ fn spec_test_563() { let expected = r##"

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7523,7 +7523,7 @@ fn spec_test_564() { let expected = r##"

    *foo*

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7536,7 +7536,7 @@ fn spec_test_565() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7548,7 +7548,7 @@ fn spec_test_566() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7560,7 +7560,7 @@ fn spec_test_567() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7572,7 +7572,7 @@ fn spec_test_568() { let expected = r##"

    foo(not a link)

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7584,7 +7584,7 @@ fn spec_test_569() { let expected = r##"

    [foo]bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7597,7 +7597,7 @@ fn spec_test_570() { let expected = r##"

    foobaz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7610,7 +7610,7 @@ fn spec_test_571() { let expected = r##"

    [foo]bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7620,7 +7620,7 @@ fn spec_test_572() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7632,7 +7632,7 @@ fn spec_test_573() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7642,7 +7642,7 @@ fn spec_test_574() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7652,7 +7652,7 @@ fn spec_test_575() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7664,7 +7664,7 @@ fn spec_test_576() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7676,7 +7676,7 @@ fn spec_test_577() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7686,7 +7686,7 @@ fn spec_test_578() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7696,7 +7696,7 @@ fn spec_test_579() { let expected = r##"

    My foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7706,7 +7706,7 @@ fn spec_test_580() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7716,7 +7716,7 @@ fn spec_test_581() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7728,7 +7728,7 @@ fn spec_test_582() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7740,7 +7740,7 @@ fn spec_test_583() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7752,7 +7752,7 @@ fn spec_test_584() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7764,7 +7764,7 @@ fn spec_test_585() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7776,7 +7776,7 @@ fn spec_test_586() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7790,7 +7790,7 @@ fn spec_test_587() { []

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7802,7 +7802,7 @@ fn spec_test_588() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7814,7 +7814,7 @@ fn spec_test_589() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7827,7 +7827,7 @@ fn spec_test_590() {

    [[foo]]: /url "title"

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7839,7 +7839,7 @@ fn spec_test_591() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7851,7 +7851,7 @@ fn spec_test_592() { let expected = r##"

    ![foo]

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7863,7 +7863,7 @@ fn spec_test_593() { let expected = r##"

    !foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7873,7 +7873,7 @@ fn spec_test_594() { let expected = r##"

    http://foo.bar.baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7883,7 +7883,7 @@ fn spec_test_595() { let expected = r##"

    https://foo.bar.baz/test?q=hello&id=22&boolean

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7893,7 +7893,7 @@ fn spec_test_596() { let expected = r##"

    irc://foo.bar:2233/baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7903,7 +7903,7 @@ fn spec_test_597() { let expected = r##"

    MAILTO:FOO@BAR.BAZ

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7913,7 +7913,7 @@ fn spec_test_598() { let expected = r##"

    a+b+c:d

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7923,7 +7923,7 @@ fn spec_test_599() { let expected = r##"

    made-up-scheme://foo,bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7933,7 +7933,7 @@ fn spec_test_600() { let expected = r##"

    https://../

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7943,7 +7943,7 @@ fn spec_test_601() { let expected = r##"

    localhost:5001/foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7953,7 +7953,7 @@ fn spec_test_602() { let expected = r##"

    <https://foo.bar/baz bim>

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7963,7 +7963,7 @@ fn spec_test_603() { let expected = r##"

    https://example.com/\[\

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7973,7 +7973,7 @@ fn spec_test_604() { let expected = r##"

    foo@bar.example.com

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7983,7 +7983,7 @@ fn spec_test_605() { let expected = r##"

    foo+special@Bar.baz-bar0.com

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -7993,7 +7993,7 @@ fn spec_test_606() { let expected = r##"

    <foo+@bar.example.com>

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8003,7 +8003,7 @@ fn spec_test_607() { let expected = r##"

    <>

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8013,7 +8013,7 @@ fn spec_test_608() { let expected = r##"

    < https://foo.bar >

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8023,7 +8023,7 @@ fn spec_test_609() { let expected = r##"

    <m:abc>

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8033,7 +8033,7 @@ fn spec_test_610() { let expected = r##"

    <foo.bar.baz>

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8043,7 +8043,7 @@ fn spec_test_611() { let expected = r##"

    https://example.com

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8053,7 +8053,7 @@ fn spec_test_612() { let expected = r##"

    foo@bar.example.com

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8063,7 +8063,7 @@ fn spec_test_613() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8073,7 +8073,7 @@ fn spec_test_614() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8085,7 +8085,7 @@ data="foo" > data="foo" >

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8097,7 +8097,7 @@ _boolean zoop:33=zoop:33 /> _boolean zoop:33=zoop:33 />

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8107,7 +8107,7 @@ fn spec_test_617() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8117,7 +8117,7 @@ fn spec_test_618() { let expected = r##"

    <33> <__>

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8127,7 +8127,7 @@ fn spec_test_619() { let expected = r##"

    <a h*#ref="hi">

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8137,7 +8137,7 @@ fn spec_test_620() { let expected = r##"

    <a href="hi'> <a href=hi'>

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8153,7 +8153,7 @@ foo><bar/ > bim!bop />

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8163,7 +8163,7 @@ fn spec_test_622() { let expected = r##"

    <a href='bar'title=title>

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8173,7 +8173,7 @@ fn spec_test_623() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8183,7 +8183,7 @@ fn spec_test_624() { let expected = r##"

    </a href="foo">

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8195,7 +8195,7 @@ comment - with hyphens --> comment - with hyphens -->

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8208,7 +8208,7 @@ foo foo -->

    foo foo -->

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8218,7 +8218,7 @@ fn spec_test_627() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8228,7 +8228,7 @@ fn spec_test_628() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8238,7 +8238,7 @@ fn spec_test_629() { let expected = r##"

    foo &<]]>

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8248,7 +8248,7 @@ fn spec_test_630() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8258,7 +8258,7 @@ fn spec_test_631() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8268,7 +8268,7 @@ fn spec_test_632() { let expected = r##"

    <a href=""">

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8280,7 +8280,7 @@ baz baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8292,7 +8292,7 @@ baz baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8304,7 +8304,7 @@ baz baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8316,7 +8316,7 @@ fn spec_test_636() { bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8328,7 +8328,7 @@ fn spec_test_637() { bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8340,7 +8340,7 @@ bar* bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8352,7 +8352,7 @@ bar* bar

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8363,7 +8363,7 @@ span` let expected = r##"

    code span

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8374,7 +8374,7 @@ span` let expected = r##"

    code\ span

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8386,7 +8386,7 @@ bar"> bar">

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8398,7 +8398,7 @@ bar"> bar">

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8408,7 +8408,7 @@ fn spec_test_644() { let expected = r##"

    foo\

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8418,7 +8418,7 @@ fn spec_test_645() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8428,7 +8428,7 @@ fn spec_test_646() { let expected = r##"

    foo\

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8438,7 +8438,7 @@ fn spec_test_647() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8450,7 +8450,7 @@ baz baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8462,7 +8462,7 @@ fn spec_test_649() { baz

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8472,7 +8472,7 @@ fn spec_test_650() { let expected = r##"

    hello $.;'there

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8482,7 +8482,7 @@ fn spec_test_651() { let expected = r##"

    Foo χρῆν

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -8492,5 +8492,5 @@ fn spec_test_652() { let expected = r##"

    Multiple spaces

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/strikethrough.rs b/pulldown-cmark/tests/suite/strikethrough.rs index 621ed179..ae672a09 100644 --- a/pulldown-cmark/tests/suite/strikethrough.rs +++ b/pulldown-cmark/tests/suite/strikethrough.rs @@ -10,7 +10,7 @@ fn strikethrough_test_1() { let expected = r##"

    This is stricken out

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -20,7 +20,7 @@ fn strikethrough_test_2() { let expected = r##"

    This is ~~stricken

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -30,7 +30,7 @@ fn strikethrough_test_3() { let expected = r##"

    Thisisstricken

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -40,7 +40,7 @@ fn strikethrough_test_4() { let expected = r##"

    Thisisstricken

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -50,7 +50,7 @@ fn strikethrough_test_5() { let expected = r##"

    Here I strike out an exclamation point!.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -60,7 +60,7 @@ fn strikethrough_test_6() { let expected = r##"

    This is stricken out

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -70,7 +70,7 @@ fn strikethrough_test_7() { let expected = r##"

    This is ~stricken

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -80,7 +80,7 @@ fn strikethrough_test_8() { let expected = r##"

    This~is~nothing

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -90,7 +90,7 @@ fn strikethrough_test_9() { let expected = r##"

    This~is~nothing

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -100,7 +100,7 @@ fn strikethrough_test_10() { let expected = r##"

    Here I fail to strike out an exclamation point~!~.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -110,7 +110,7 @@ fn strikethrough_test_11() { let expected = r##"

    Here I fail to strike out a tilde ~~~.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -120,7 +120,7 @@ fn strikethrough_test_12() { let expected = r##"

    Here I fail to match up ~~tildes~.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -130,7 +130,7 @@ fn strikethrough_test_13() { let expected = r##"

    Here I fail to match up ~tildes~~.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -140,7 +140,7 @@ fn strikethrough_test_14() { let expected = r##"

    This ~is stricken.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -150,5 +150,5 @@ fn strikethrough_test_15() { let expected = r##"

    This ~~is stricken.

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/super_sub.rs b/pulldown-cmark/tests/suite/super_sub.rs index 6cf84261..283bda0b 100644 --- a/pulldown-cmark/tests/suite/super_sub.rs +++ b/pulldown-cmark/tests/suite/super_sub.rs @@ -10,7 +10,7 @@ fn super_sub_test_1() { let expected = r##"

    This is super This is sub

    "##; - test_markdown_html(original, expected, false, false, false, true); + test_markdown_html(original, expected, false, false, false, true, false); } #[test] @@ -20,7 +20,7 @@ fn super_sub_test_2() { let expected = r##"

    This is stricken out

    "##; - test_markdown_html(original, expected, false, false, false, true); + test_markdown_html(original, expected, false, false, false, true, false); } #[test] @@ -30,7 +30,7 @@ fn super_sub_test_3() { let expected = r##"

    This is ~stricken

    "##; - test_markdown_html(original, expected, false, false, false, true); + test_markdown_html(original, expected, false, false, false, true, false); } #[test] @@ -40,7 +40,7 @@ fn super_sub_test_4() { let expected = r##"

    This~is~nothing

    "##; - test_markdown_html(original, expected, false, false, false, true); + test_markdown_html(original, expected, false, false, false, true, false); } #[test] @@ -50,7 +50,7 @@ fn super_sub_test_5() { let expected = r##"

    This ~~is stricken.

    "##; - test_markdown_html(original, expected, false, false, false, true); + test_markdown_html(original, expected, false, false, false, true, false); } #[test] @@ -60,5 +60,5 @@ fn super_sub_test_6() { let expected = r##"

    This ~~is stricken but this is not~~

    "##; - test_markdown_html(original, expected, false, false, false, true); + test_markdown_html(original, expected, false, false, false, true, false); } diff --git a/pulldown-cmark/tests/suite/table.rs b/pulldown-cmark/tests/suite/table.rs index 97d7b06d..aa46bca7 100644 --- a/pulldown-cmark/tests/suite/table.rs +++ b/pulldown-cmark/tests/suite/table.rs @@ -11,7 +11,7 @@ fn table_test_1() { let expected = r##"

    Test header

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -23,7 +23,7 @@ fn table_test_2() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -44,7 +44,7 @@ fn table_test_3() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -71,7 +71,7 @@ fn table_test_4() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -87,7 +87,7 @@ fn table_test_5() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -103,7 +103,7 @@ fn table_test_6() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -119,7 +119,7 @@ fn table_test_7() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -135,7 +135,7 @@ fn table_test_8() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -161,7 +161,7 @@ fn table_test_9() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -173,7 +173,7 @@ fn table_test_10() { |ぃ|い|

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -187,7 +187,7 @@ fn table_test_11() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -201,7 +201,7 @@ fn table_test_12() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -302,7 +302,7 @@ b

    b

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -316,7 +316,7 @@ fn table_test_14() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -332,7 +332,7 @@ fn table_test_15() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -348,7 +348,7 @@ fn table_test_16() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -398,7 +398,7 @@ fn table_test_17() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -436,7 +436,7 @@ fn table_test_18() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -466,7 +466,7 @@ fn table_test_19() { | Not | Enough |

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -480,7 +480,7 @@ fn table_test_20() {

    |

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -494,7 +494,7 @@ fn table_test_21() { | Table | Body |

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -516,7 +516,7 @@ fn table_test_22() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -542,7 +542,7 @@ fn table_test_23() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -564,7 +564,7 @@ A: Interrupting —?

    "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -578,7 +578,7 @@ fn table_test_25() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -592,7 +592,7 @@ fn table_test_26() { "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -610,7 +610,7 @@ moo | moo "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } #[test] @@ -628,5 +628,5 @@ moo | moo "##; - test_markdown_html(original, expected, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/wikilinks.rs b/pulldown-cmark/tests/suite/wikilinks.rs new file mode 100644 index 00000000..0b8f9609 --- /dev/null +++ b/pulldown-cmark/tests/suite/wikilinks.rs @@ -0,0 +1,78 @@ +// This file is auto-generated by the build script +// Please, do not modify it manually + +use super::test_markdown_html; + +#[test] +fn wikilinks_test_1() { + let original = r##"This is a [[WikiLink]]. +"##; + let expected = r##"

    This is a WikiLink.

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} + +#[test] +fn wikilinks_test_2() { + let original = r##"This is [[Ambiguous]]. + +[Ambiguous]: https://example.com/ +"##; + let expected = r##"

    This is Ambiguous.

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} + +#[test] +fn wikilinks_test_3() { + let original = r##"This is [also [[Ambiguous]]](https://example.com/). +"##; + let expected = r##"

    This is [also Ambiguous](https://example.com/).

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} + +#[test] +fn wikilinks_test_4() { + let original = r##"This is [[WikiLink|a pothole]]. +"##; + let expected = r##"

    This is a pothole.

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} + +#[test] +fn wikilinks_test_5() { + let original = r##"This is [[WikiLink|a **strong** pothole]]. +"##; + let expected = r##"

    This is a strong pothole.

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} + +#[test] +fn wikilinks_test_6() { + let original = r##"This is a cute dog, linked to the page "/WikiLink/" + +[[WikiLink|![dog](dog.png)]] +"##; + let expected = r##"

    This is a cute dog, linked to the page "/WikiLink/"

    dog

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} + +#[test] +fn wikilinks_test_7() { + let original = r##"The url of [[This Link]] becomes "/This_Link/" +"##; + let expected = r##"

    The url of This Link becomes "/This_Link/"

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} From be5615523b56d546e3fc10632e2d0c70b32b60a8 Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Fri, 13 Dec 2024 16:09:22 -0800 Subject: [PATCH 072/180] fix overscans on wikilink pipes --- pulldown-cmark/src/parse.rs | 5 +++-- pulldown-cmark/src/scanners.rs | 8 ++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index a0fb2d22..0643d797 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -651,8 +651,9 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { let start_ix = self.tree[body_node].item.start; let end_ix = self.tree[cur_ix].item.start; let wikilink = match scan_wikilink_pipe( - block_text, start_ix, // bounded by closing tag - end_ix, + block_text, + start_ix, // bounded by closing tag + end_ix - start_ix, ) { Some((rest, wikiname)) => { // [[WikiName|rest]] diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index 3b61c606..a5d473a0 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -933,17 +933,13 @@ pub(crate) fn scan_entity(bytes: &[u8]) -> (usize, Option>) { (0, None) } -pub(crate) fn scan_wikilink_pipe( - data: &str, - start_ix: usize, - max_ix: usize, -) -> Option<(usize, &str)> { +pub(crate) fn scan_wikilink_pipe(data: &str, start_ix: usize, len: usize) -> Option<(usize, &str)> { let bytes = &data.as_bytes()[start_ix..]; // skip any possibly empty wikilinks // [[|empty wikilink]] let mut i = 1; - while i < bytes.len() && i < max_ix { + while i < bytes.len() && i < len { if bytes[i] == b'|' { return Some((i + 1, &data[start_ix..start_ix + i])); } From 73e4772e8f2a80b5475529d2c88b1a2d6f64a310 Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Fri, 13 Dec 2024 23:19:20 -0800 Subject: [PATCH 073/180] impl wikilink qualifiers This adds a new syntax to WikiLinks; when a link is typed like `[[Nested/WikiLink]]`, only the "WikiLink" part of the url gets emitted. See specs/wikilinks.txt --- pulldown-cmark/specs/wikilinks.txt | 17 +++++++++++++++++ pulldown-cmark/src/parse.rs | 17 +++++++++++++++++ pulldown-cmark/tests/suite/wikilinks.rs | 20 ++++++++++++++++++++ 3 files changed, 54 insertions(+) diff --git a/pulldown-cmark/specs/wikilinks.txt b/pulldown-cmark/specs/wikilinks.txt index cd88a7d1..02ec588e 100644 --- a/pulldown-cmark/specs/wikilinks.txt +++ b/pulldown-cmark/specs/wikilinks.txt @@ -67,3 +67,20 @@ The url of [[This Link]] becomes "/This_Link/" .

    The url of This Link becomes "/This_Link/"

    ```````````````````````````````` + +Paths can be qualified in wikilinks while only showing the title of the page. +This is useful for wikis that support a "directory-like" system. + +```````````````````````````````` example_wikilinks +This is a [[WikiLink/In/A/Directory]]. +. +

    This is a Directory.

    +```````````````````````````````` + +Of course, the pipe operator can still be used: + +```````````````````````````````` example_wikilinks +This is a [[WikiLink/In/A/Directory|WikiLink]]. +. +

    This is a WikiLink.

    +```````````````````````````````` diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 0643d797..24c82602 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -670,6 +670,23 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { None => { // [[WikiName]] let wikiname = &block_text[start_ix..end_ix]; + // or [[Nested/WikiName]] + let display_ix = wikiname + .as_bytes() + .iter() + .rposition(|b| *b == b'/') + .map(|ix| ix + 1) + .unwrap_or(0) + + start_ix; + // TODO: wikitext should not be styled, might + // need a more experienced contributor's help + let body_node = self.tree.create_node(Item { + start: display_ix, + end: end_ix, + body: ItemBody::Text { + backslash_escaped: false, + }, + }); Some((body_node, wikiname)) } }; diff --git a/pulldown-cmark/tests/suite/wikilinks.rs b/pulldown-cmark/tests/suite/wikilinks.rs index 0b8f9609..c4c11ccd 100644 --- a/pulldown-cmark/tests/suite/wikilinks.rs +++ b/pulldown-cmark/tests/suite/wikilinks.rs @@ -76,3 +76,23 @@ fn wikilinks_test_7() { test_markdown_html(original, expected, false, false, false, false, true); } + +#[test] +fn wikilinks_test_8() { + let original = r##"This is a [[WikiLink/In/A/Directory]]. +"##; + let expected = r##"

    This is a Directory.

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} + +#[test] +fn wikilinks_test_9() { + let original = r##"This is a [[WikiLink/In/A/Directory|WikiLink]]. +"##; + let expected = r##"

    This is a WikiLink.

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} From 675acd25a2052c40717476b5f84f5efe60a10d5d Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Thu, 19 Dec 2024 20:59:16 +0200 Subject: [PATCH 074/180] Make subscript CLI flag -B -D conflicts with definition lists --- pulldown-cmark/src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pulldown-cmark/src/main.rs b/pulldown-cmark/src/main.rs index d93895fe..68756095 100644 --- a/pulldown-cmark/src/main.rs +++ b/pulldown-cmark/src/main.rs @@ -71,6 +71,7 @@ pub fn main() -> std::io::Result<()> { opts.optflag("h", "help", "this help message"); opts.optflag("d", "dry-run", "dry run, produce no output"); opts.optflag("e", "events", "print event sequence instead of rendering"); + // Check for conflicting short flags when adding a new one! opts.optflag("T", "enable-tables", "enable GitHub-style tables"); opts.optflag("m", "enable-math", "enable LaTeX-style math"); opts.optflag("F", "enable-footnotes", "enable GitHub-style footnotes"); @@ -85,7 +86,7 @@ pub fn main() -> std::io::Result<()> { "enable GitHub-style strikethrough", ); opts.optflag("U", "enable-superscript", "enable superscript"); - opts.optflag("D", "enable-subscript", "enable subscript"); + opts.optflag("B", "enable-subscript", "enable subscript"); opts.optflag("L", "enable-tasklists", "enable GitHub-style task lists"); opts.optflag("P", "enable-smart-punctuation", "enable smart punctuation"); opts.optflag( From 2a32e9c31a460eb606affee078af01059769d4f7 Mon Sep 17 00:00:00 2001 From: tjk Date: Mon, 2 Dec 2024 14:24:49 -0600 Subject: [PATCH 075/180] Add basic skeleton for developer docs Create a reasonable skeleton for important topics to cover and write a bit about the various subjects --- guide/src/SUMMARY.md | 7 + guide/src/dev/block-parsing.md | 168 ++++++++++++++++++ guide/src/dev/extensions.md | 269 +++++++++++++++++++++++++++++ guide/src/dev/html-generation.md | 177 +++++++++++++++++++ guide/src/dev/index.md | 62 +++++++ guide/src/dev/inline-processing.md | 149 ++++++++++++++++ guide/src/dev/performance.md | 114 ++++++++++++ guide/src/dev/string-handling.md | 129 ++++++++++++++ 8 files changed, 1075 insertions(+) create mode 100644 guide/src/dev/block-parsing.md create mode 100644 guide/src/dev/extensions.md create mode 100644 guide/src/dev/html-generation.md create mode 100644 guide/src/dev/index.md create mode 100644 guide/src/dev/inline-processing.md create mode 100644 guide/src/dev/performance.md create mode 100644 guide/src/dev/string-handling.md diff --git a/guide/src/SUMMARY.md b/guide/src/SUMMARY.md index 5cc94ea9..0e2fd48b 100644 --- a/guide/src/SUMMARY.md +++ b/guide/src/SUMMARY.md @@ -2,6 +2,13 @@ [Guide](index.md) - [Cheat sheet](cheat-sheet.md) +- [Developer guide](dev/index.md) + - [Block Structure Parsing](dev/block-parsing.md) + - [Inline Processing](dev/inline-processing.md) + - [String Handling](dev/string-handling.md) + - [HTML Generation](dev/html-generation.md) + - [Performance Optimizations](dev/performance.md) + - [Adding Extensions](dev/extensions.md) - [Code examples](examples/index.md) - [broken-link-callbacks.rs](examples/broken-link-callbacks.md) - [event-filter.rs](examples/event-filter.md) diff --git a/guide/src/dev/block-parsing.md b/guide/src/dev/block-parsing.md new file mode 100644 index 00000000..5a8d5ae1 --- /dev/null +++ b/guide/src/dev/block-parsing.md @@ -0,0 +1,168 @@ +# Block Structure Parsing + +The first pass of pulldown-cmark's parsing process handles block-level elements and constructs the basic document structure. + +It roughly corresponds to Phase 1 of the CommonMark spec appendix ["A Parsing Strategy"](https://spec.commonmark.org/0.31.2/#appendix-a-parsing-strategy). +This chapter explains how the block parsing works in pulldown-cmark. + +## Overview + +Block parsing is implemented in `firstpass.rs` and has two main responsibilities: + +1. Identifying block-level elements like paragraphs, lists, and code blocks +2. Building a tree structure representing the nesting of these blocks + +The block parser operates line-by-line, maintaining a stack of currently open blocks (called the "spine") and handling both container blocks (like blockquotes) and leaf blocks (like paragraphs). + +## Block Types + +The main block types handled by the first pass are: + +- Container blocks: + - Block quotes + - Lists (ordered and unordered) + - List items + - Footnote definitions + +- Leaf blocks: + - Paragraphs + - Headings (ATX and Setext style) + - Code blocks (fenced and indented) + - HTML blocks + - Thematic breaks (horizontal rules) + - Tables (with GFM extension) + +## The Parsing Process + +The block parsing process works like this: + +1. Input text is processed line by line + +2. For each line: + - Check if it continues any blocks from the current spine + - Scan for the start of any new blocks + - Handle transitions between blocks + - Track indentation and container prefixes + +3. Build tree nodes for each block encountered + +4. Handle tight/loose list detection + +Here's a simplified example of how a nested list is parsed: + +```markdown +- First item + - Nested item + with continuation +- Second item +``` + +The parser: +1. Recognizes the first `-` as starting a list and list item +2. Sees the next `-` as starting a nested list +3. Identifies the indented line as continuing the nested item +4. Recognizes the unindented `-` as closing the nested list + +## Tree Construction + +The block structure is stored in a `Tree` where each node contains: + +```rust +struct Item { + start: usize, // Start byte offset + end: usize, // End byte offset + body: ItemBody, // Type and attributes +} + +struct Node { + child: Option, // First child node + next: Option, // Next sibling + item: T, // Node data (T = Item in our tree) +} +``` + +The tree is built incrementally as blocks are parsed. Key operations: + +- `push()`: Move down into a new block's children +- `pop()`: Move back up to the parent block +- `append()`: Add a new sibling block +- `truncate_siblings()`: End open blocks at a certain point + +## Container Block Handling + +Container blocks like blockquotes and lists require special handling: + +1. Track container prefixes (>, -, 1., etc) +2. Calculate correct indentation levels +3. Handle lazy continuation lines +4. Determine tight/loose status for lists + +The `LineStart` struct helps manage this by: +- Tracking indentation and remaining space +- Scanning container markers +- Handling tab stops correctly + +## Leaf Block Processing + +Leaf blocks are handled by specific scanner functions that: + +1. Identify the block type +2. Calculate its bounds +3. Handle internal structure like table columns +4. Manage transitions between blocks + +For example, table parsing: +```rust +pub(crate) fn scan_table_head(data: &[u8]) -> (usize, Vec) { + // Check initial conditions + let (mut i, spaces) = calc_indent(data, 4); + if spaces > 3 || i == data.len() { + return (0, vec![]); + } + + // Parse cells and alignments + let mut cols = vec![]; + let mut active_col = Alignment::None; + // ... + + // Return parsed structure + (i, cols) +} +``` + +## Error Recovery + +The parser is designed to be robust and recover from invalid syntax: + +- Malformed containers fall back to paragraphs +- Invalid indentation is normalized +- Unclosed blocks are implicitly closed +- HTML parsing has fallback modes + +This ensures it can handle real-world Markdown without failing. + +## Interfacing with Inline Parsing + +The block parser prepares for inline parsing by: + +1. Identifying inline-containing blocks +2. Marking potential inline boundaries (e.g. `MaybeLinkOpen`) +3. Providing context (like table cells) +4. Tracking source positions + +The tree structure is then used by the inline parser to process inline elements within the appropriate blocks. + +## Implementation Notes + +Some key implementation details: + +- Line scanning is optimized using SIMD on x86_64 +- The tree structure uses indexed nodes to avoid lifetimes +- Container context is maintained in a stack-like structure +- Source positions are tracked for use by the inline parser and [`OffsetIter`](https://docs.rs/pulldown-cmark/latest/pulldown_cmark/struct.OffsetIter.html) + +The block parser aims to be: +- Fast for common cases +- Memory efficient +- Robust against bad input +- Compliant with CommonMark diff --git a/guide/src/dev/extensions.md b/guide/src/dev/extensions.md new file mode 100644 index 00000000..6557df51 --- /dev/null +++ b/guide/src/dev/extensions.md @@ -0,0 +1,269 @@ +# Adding Extensions + +This guide explains how to add new extensions to pulldown-cmark. Extensions allow you to parse additional Markdown syntax beyond the CommonMark specification. + +If you are looking to get your extension merged upstream, it's a good idea to discuss it with the maintainers before getting to work. + +## Overview + +Adding an extension typically requires: + +1. Adding a feature flag in the `Options` bitflags +2. Adding any new data structures needed to represent the extension's AST nodes +3. Implementing block parsing in `firstpass.rs` if the extension adds block-level elements +4. Implementing inline parsing in `parse.rs` if the extension adds inline elements +5. Adding HTML rendering support in `html.rs` +6. Adding tests to verify the extension works correctly + +Let's walk through each of these steps in detail. + +## Adding the Feature Flag + +Extensions are controlled via the `Options` bitflags defined in `lib.rs`. Add a new constant using the next available bit: + +```rust +bitflags::bitflags! { + pub struct Options: u32 { + // Existing options... + const ENABLE_MY_EXTENSION = 1 << N; // N is next available bit + } +} +``` + +This allows users to enable your extension with: + +```rust +let mut options = Options::empty(); +options.insert(Options::ENABLE_MY_EXTENSION); +``` + +## Adding AST Data Structures + +Extensions often need new AST node types to represent their syntax. These are defined in several places: + +- `Tag` enum in `lib.rs` for container elements +- `TagEnd` enum in `lib.rs` for end tags +- `Event` enum in `lib.rs` for new event types +- `ItemBody` enum in `parse.rs` for internal AST nodes + +For example, the tables extension defines: + +```rust +// In lib.rs +pub enum Tag<'a> { + // ... + Table(Vec), + TableHead, + TableRow, + TableCell, +} + +// In parse.rs +pub(crate) enum ItemBody { + // ... + Table(AlignmentIndex), + TableHead, + TableRow, + TableCell, +} +``` + +Follow existing patterns for naming and make sure to implement all the necessary traits (`Debug`, `Clone`, etc.). + +## Implementing Block Parsing + +If your extension adds block-level elements (like tables, footnotes, etc.), you'll need to: + +1. Add scanning functions in `scanners.rs` to detect your syntax +2. Add parsing logic in `firstpass.rs` to build the block structure +3. Update the `scan_containers()` function if your blocks can be nested + +For example, the tables extension adds: + +```rust +// In scanners.rs +pub(crate) fn scan_table_head(data: &[u8]) -> (usize, Vec) { + // Scan table header row syntax... +} + +// In firstpass.rs +impl<'a> FirstPass<'a, 'b> { + fn parse_table(&mut self, ...) -> Option { + // Parse table structure... + } +} +``` + +Follow these guidelines when implementing block parsing: + +- Use the `scan_` prefix for low-level scanning functions +- Make scanning functions return the number of bytes consumed +- Handle edge cases like empty lines and indentation +- Properly integrate with the container block structure +- Follow the parsing strategies used by existing extensions + +## Implementing Inline Parsing + +If your extension adds inline elements (like strikethrough, math, etc.), you'll need to: + +1. Add marker detection in `parse_line()` in `firstpass.rs` +2. Add opener/closer matching logic in `handle_inline()` +3. Add conversion from internal AST to events + +For example, the strikethrough extension adds: + +```rust +// In firstpass.rs +impl<'a, 'b> FirstPass<'a, 'b> { + fn parse_line(&mut self, ..) -> (usize, Option) { + match byte { + b'~' => { + // Handle tilde markers... + } + } + } +} +``` + +Inline parsing tips: + +- Use the `MaybeX` pattern for markers that need matching +- Handle backslash escaping correctly +- Support nested inline elements +- Follow CommonMark rules for [flanking](https://spec.commonmark.org/0.31.2/#delimiter-run) conditions +- Reuse existing inline parsing infrastructure + +## Adding HTML Rendering + +HTML rendering is handled in `html.rs`. You'll need to: + +1. Add HTML tag generation for your new elements +2. Update the `body_to_tag_end()` and `item_to_event()` functions +3. Handle any special rendering requirements + +For example: + +```rust +// In html.rs +impl<'a, I, W> HtmlWriter<'a, I, W> { + fn start_tag(&mut self, tag: Tag<'a>) -> Result<(), W::Error> { + match tag { + Tag::MyExtension => { + self.write("") + } + // ... + } + } +} +``` + +HTML rendering tips: + +- Follow HTML5 standards +- Handle escaping properly +- Consider accessibility +- Test in different contexts + +## Testing + +Add tests to verify your extension works correctly. pulldown-cmark is principally tested with spec documents, which are Markdown files containing test cases. Each extension should have a file under `specs/` explaining how the feature works along with test cases. Have a look at the existing specs for inspiration. +Other kinds of testing you should consider: + +1. Unit tests alongside implementation +2. Integration tests in `tests/` +3. round-trip tests +4. Edge case tests +5. Interaction tests with other extensions + +For example: + +```rust +#[test] +fn test_my_extension() { + let input = "Test my extension syntax"; + let mut options = Options::empty(); + options.insert(Options::ENABLE_MY_EXTENSION); + let parser = Parser::new_ext(input, options); + // Test parsing result... +} +``` + +Testing tips: + +- Test both positive and negative cases +- Test interactions with other syntax +- Test error conditions +- Test HTML output +- Test with different options enabled +- Run the different fuzzers to find crashes (`fuzz/` parse target) and performance issues (`dos-fuzzer/`) + +## Example: Adding Subscript Extension + +Here's a complete example of adding a hypothetical subscript extension that uses `~text~` for subscript: + +```rust +// In lib.rs +bitflags::bitflags! { + pub struct Options: u32 { + const ENABLE_SUBSCRIPT = 1 << 15; + } +} + +pub enum Tag<'a> { + Subscript, +} + +// In parse.rs +pub(crate) enum ItemBody { + MaybeSubscript(usize), // For opener/closer matching + Subscript, +} + +impl<'a, F> Parser<'a, F> { + fn parse_line(&mut self, ..) -> (usize, Option) { + match byte { + b'~' => { + // Handle subscript markers... + } + } + } +} + +// In html.rs +impl<'a, I, W> HtmlWriter<'a, I, W> { + fn start_tag(&mut self, tag: Tag<'a>) -> Result<(), W::Error> { + match tag { + Tag::Subscript => self.write(""), + } + } +} +``` + +## Tips and Best Practices + +- Study existing extensions for patterns to follow +- Keep parsing efficient +- Handle edge cases gracefully +- Document your extension thoroughly +- Consider adding feature flags for subfeatures +- Follow CommonMark principles where possible +- Test extensively +- Consider compatibility with other extensions + +## Common Pitfalls + +- Not handling nested elements correctly +- Improper escaping in HTML output +- Not following CommonMark precedence rules +- Inefficient parsing of large documents +- Poor error recovery +- Not handling edge cases +- Breaking existing syntax +- Not documenting limitations + +## Further Reading + +- [CommonMark Spec](https://spec.commonmark.org/) +- [GitHub Flavored Markdown Spec](https://github.github.com/gfm/) +- [Existing pulldown-cmark extension specs](https://pulldown-cmark.github.io/pulldown-cmark/specs.html) +- [HTML5 Spec](https://html.spec.whatwg.org/) diff --git a/guide/src/dev/html-generation.md b/guide/src/dev/html-generation.md new file mode 100644 index 00000000..d703980b --- /dev/null +++ b/guide/src/dev/html-generation.md @@ -0,0 +1,177 @@ +# HTML Generation + +This chapter explains how pulldown-cmark generates HTML output from Markdown events. + +## Overview + +HTML generation is implemented in the `html` module and consists of two main components: + +1. The `HtmlWriter` struct which manages state and writes HTML tags +2. Helper functions for converting events to HTML tags and handling special cases + +The HTML generation process works by: +1. Taking an iterator of Markdown events +2. Converting each event into corresponding HTML tags +3. Managing state for special cases like tables and tight lists +4. Writing the HTML tags to the provided output + +## The HtmlWriter + +The core type responsible for HTML generation is `HtmlWriter`: + +```rust +struct HtmlWriter<'a, I, W> { + iter: I, // Iterator supplying events + writer: W, // Writer to write to + end_newline: bool, // Whether last write ended with newline + in_non_writing_block: bool, // In metadata block (no output) + table_state: TableState, // Current state for table processing + table_alignments: Vec, // Column alignments for current table + table_cell_index: usize, // Current cell index in table row + numbers: HashMap, usize>, // For footnote numbering +} +``` + +The writer keeps track of: + +- The current table state (head vs body) +- Table column alignments +- Current cell index +- Footnote numbering +- Whether we're in a non-writing block like metadata +- Whether the last write ended with a newline + +## Event Processing + +The main event processing loop lives in `HtmlWriter::run()`. For each event: + +1. The event is matched and dispatched to the appropriate handler +2. HTML tags are written based on the event type +3. State is updated as needed + +Key event handling patterns: + +### Block Elements + +Block elements like paragraphs, headings, lists etc. are wrapped in HTML tags: + +```rust +match event { + Start(Tag::Paragraph) => write("

    "), + End(EndTag::Paragraph) => write("

    \n"), + // etc +} +``` + +### Inline Elements + +Inline elements like emphasis and links are handled similarly but without newlines: + +```rust +match event { + Start(Tag::Emphasis) => write(""), + End(EndTag::Emphasis) => write(""), + // etc +} +``` + +### Text Content + +Text content is HTML escaped and written directly: + +```rust +match event { + Text(text) => escape_html_body_text(&mut writer, &text), + // etc +} +``` + +### Complex Elements + +More complex elements like tables require managing state: + +```rust +match event { + Start(Tag::Table(alignments)) => { + self.table_alignments = alignments; + self.write("")?; + } + // etc +} +``` + +## HTML Safety + +The functions `escape_html()` and ``escape_href()`` are used throughout the library for escaping special characters. The escaping functions live in the `pulldown-cmark-escape` crate. + +## Writer Interface + +The HTML writer is generic over the writer type `W`, allowing output to: + +- Strings via `fmt::Write` +- Files/IO via `io::Write` + +This generic design lets users choose the most efficient output method for their use case. For example: +- Using `String` is convenient for in-memory processing and testing +- Using `BufWriter` is efficient for writing directly to disk +- Using a network socket allows streaming HTML over a connection +- Using a custom writer enables special handling like compression or logging + +The `StrWrite` trait provides a common interface to abstract over these different writers: + +```rust +pub trait StrWrite { + type Error; + fn write_str(&mut self, s: &str) -> Result<(), Self::Error>; +} +``` + +This abstraction over the writer type means the HTML generation code can focus on correct tag generation and structure without worrying about the specific output destination. It also allows users to easily integrate pulldown-cmark's HTML output into their existing I/O pipelines. + +## Public API + +The main public API consists of: + +```rust +// Write HTML to a String +pub fn push_html<'a, I>(s: &mut String, iter: I) +where I: Iterator> + +// Write HTML to an IO writer +pub fn write_html_io<'a, I, W>(writer: W, iter: I) -> io::Result<()> +where I: Iterator>, + W: io::Write + +// Write HTML to a fmt writer +pub fn write_html_fmt<'a, I, W>(writer: W, iter: I) -> fmt::Result +where I: Iterator>, + W: fmt::Write +``` + +## Performance Considerations + +HTML generation aims to be efficient by: + +1. Minimizing string allocations +2. Using buffered writers +3. Avoiding recursion in the core loop + +Note: + +```rust +// Using unbuffered writers (like Files) will be slow +// Wrap them in BufWriter for better performance +let file = BufWriter::new(File::create("output.html")?); +write_html_io(file, parser); +``` + +This ensures good performance even with large documents. + +## Customization + +The HTML output can be customized by: + +1. Using a custom writer implementation +2. Preprocessing the event stream +3. Post-processing the HTML output +4. Using the parser options to enable/disable features diff --git a/guide/src/dev/index.md b/guide/src/dev/index.md new file mode 100644 index 00000000..4c853049 --- /dev/null +++ b/guide/src/dev/index.md @@ -0,0 +1,62 @@ +# Developer Guide + +pulldown-cmark uses a two-pass parsing strategy with a pull parser architecture to efficiently parse Markdown into HTML. This guide explains the internal workings of the library for developers who want to contribute or better understand how it works. + +## High-Level Architecture + +The parser operates in two main passes: + +1. **First Pass (Block Structure)**: The first pass scans the document and builds a tree structure representing block-level elements like paragraphs, lists, code blocks, etc. This establishes the hierarchical structure of the document. + +2. **Second Pass (Inline Processing)**: The second pass processes inline elements like emphasis, links and code spans within the blocks identified by the first pass. This is done in a streaming fashion as events are requested. + +The library uses a pull parser design, which means: + +- Instead of pushing events to a callback or building a complete AST, it provides an iterator interface that lets consumers pull events as needed +- It enables flexible transformation of the event stream before rendering + +Key components: + +- `Parser`: The main entry point that implements the Iterator trait for Events +- `Tree`: A Vec-based data structure that holds the block structure +- `Event`: An enum representing the different Markdown elements +- `HtmlWriter`: Renders the event stream as HTML + +## Performance Characteristics + +The parser is designed for high performance: + +- Performance is intended to be linear with respect to the size of the input text +- String handling uses copy-on-write semantics to avoid unnecessary allocations +- SIMD optimizations are available for scanning text on x86_64 + +## Extending the Parser + +The parser can be extended in several ways: + +- New syntax extensions can be added by implementing new scan functions +- The event stream can be transformed using Iterator adaptors +- Custom renderers can be built by consuming events +- The HTML renderer can be customized through options + +## Directory Structure + +``` +src/ + firstpass.rs - First pass block structure parsing + scanners.rs - Low-level text scanning functions + parse.rs - Main parser implementation + html.rs - HTML renderer + tree.rs - Tree data structure + entities.rs - HTML entity handling + strings.rs - String types and utilities +``` + +Subsequent chapters cover each of these components in detail: + +1. [Block Structure Parsing](./dev/block-parsing.md) +2. [Inline Processing](./dev/inline-processing.md) +3. [String Handling](./dev/string-handling.md) +4. [HTML Generation](./dev/html-generation.md) +5. [Performance Optimizations](./dev/performance.md) +6. [Adding Extensions](./dev/extensions.md) diff --git a/guide/src/dev/inline-processing.md b/guide/src/dev/inline-processing.md new file mode 100644 index 00000000..e12f07ff --- /dev/null +++ b/guide/src/dev/inline-processing.md @@ -0,0 +1,149 @@ +# Inline Processing + +The second pass of pulldown-cmark's parsing process handles inline elements like emphasis, links, and code spans. + +## Overview + +Inline processing happens during event iteration rather than as a separate full-document pass. When the parser encounters a block that can contain inlines, it processes the inline elements on demand. + +The main inline elements handled are: + +- Emphasis and strong emphasis (* and _) +- Code spans (`) +- Links and images +- HTML tags and entities +- Autolinks +- Extension elements like strikethrough and math + +## Processing Model + +The inline processor: + +1. Scans text for special characters +2. Identifies potential inline markers +3. Resolves matched pairs (like * for emphasis) +4. Handles nested elements +5. Processes escapes and entities + +## Delimiter Handling + +Emphasis-type elements use a sophisticated delimiter handling system: + +1. Identify delimiter runs (consecutive `*`, `_`, etc) +2. Determine if they can open and/or close +3. Match pairs according to CommonMark rules +4. Handle nested cases correctly + + +The `InlineStack` struct manages this: + +```rust +struct InlineStack { + stack: Vec, + lower_bounds: [usize; 9], +} + +struct InlineEl { + start: TreeIndex, + count: usize, // Number of delimiters + run_length: usize, // Full run length + c: u8, // Delimiter character + both: bool, // Can both open and close +} +``` + +## Link Processing + +Link processing involves: + +1. Finding link text in brackets +2. Handling different link types: + - Inline `[text](url)` + - Reference `[text][ref]` + - Collapsed `[ref][]` + - Shortcut `[ref]` + +3. Resolving references in link definitions +4. Processing link destinations and titles + +The link processor maintains a stack to handle nested links and images: + +```rust +struct LinkStackEl { + node: TreeIndex, + ty: LinkStackTy, +} + +enum LinkStackTy { + Link, + Image, + Disabled, // For nested links +} +``` + +## Code Spans + +Code span processing has special rules: + +1. Match backtick sequences of equal length +2. Handle backslash escapes +3. Strip leading/trailing spaces according to spec +4. Prevent misinterpreting internal backticks + +## HTML Processing + +HTML blocks have already been recognized by the block parser. What remains is inline HTML tags between normal text. Handling this involves: + +1. Identifying HTML constructs: + - Tags + - Comments + - CDATA sections + - Processing instructions + +2. Validating structure +3. Preserving content exactly +4. Handling entities + +The HTML processor uses a state machine to track context: + +```rust +struct HtmlScanGuard { + cdata: usize, + processing: usize, + declaration: usize, + comment: usize, +} +``` + +## String Handling + +Inline processing needs efficient string handling: + +1. Copy-on-write strings to avoid allocation +2. Smart handling of escaped characters +3. Entity resolution +4. UTF-8 awareness + +The `CowStr` type provides this and is documented in detail [here](./string-handling.md). + +## Event Generation + +As inline elements are processed, they generate events: + +1. Start/end events for container elements +2. Text events for content +3. Specialized events for atomic elements +4. Source position tracking + +Events are yielded in document order: + +```rust +enum Event<'a> { + Start(Tag<'a>), + End(TagEnd), + Text(CowStr<'a>), + Code(CowStr<'a>), + Html(CowStr<'a>), + // ... +} +``` diff --git a/guide/src/dev/performance.md b/guide/src/dev/performance.md new file mode 100644 index 00000000..b17950c0 --- /dev/null +++ b/guide/src/dev/performance.md @@ -0,0 +1,114 @@ +# Performance Optimizations + +This chapter covers the key performance optimizations implemented in pulldown-cmark. The library uses several techniques to achieve fast Markdown parsing while maintaining standards compliance and a clean architecture. + +## SIMD-Accelerated Character Scanning + +One of the most performance-critical operations in Markdown parsing is scanning text for special characters that may indicate inline markup. pulldown-cmark uses SIMD (Single Instruction Multiple Data) instructions on x86_64 platforms to accelerate this scanning. + +The SIMD optimization is implemented in `scanners.rs` and operates by: + +1. Creating a lookup table of special characters (like `*`, `_`, etc.) +2. Loading 16 bytes at a time into a SIMD register +3. Performing parallel lookups to identify special characters +4. Generating a bitmask indicating which bytes matched + +```rust +// Example from firstpass.rs showing the core scanning logic +#[target_feature(enable = "ssse3")] +unsafe fn compute_mask(lut: &[u8; 16], bytes: &[u8], ix: usize) -> i32 { + let bitmap = _mm_loadu_si128(lut.as_ptr() as *const __m128i); + let input = _mm_loadu_si128(bytes.as_ptr().add(ix) as *const __m128i); + let bitset = _mm_shuffle_epi8(bitmap, input); + let higher_nibbles = _mm_and_si128(_mm_srli_epi16(input, 4), _mm_set1_epi8(0x0f)); + let bitmask = _mm_shuffle_epi8(bitmask_lookup, higher_nibbles); + let tmp = _mm_and_si128(bitset, bitmask); + let result = _mm_cmpeq_epi8(tmp, bitmask); + _mm_movemask_epi8(result) +} +``` + +This SIMD optimization can provide significant speedups when processing large documents, since character scanning is such a common operation. The code falls back to scalar processing when SIMD is not available. + +## Memory-Efficient String Storage + +The library uses a custom string type `CowStr` that can represent strings. Refer to the [string handling](./string-handling.md) documentation for more details on the performance optimizations inherent to this type. + +## Tree Structure Optimization + +The AST (Abstract Syntax Tree) is stored in a vec-based tree structure that provides: + +1. Fast node creation during parsing +2. Efficient tree traversal +3. Memory locality from vector storage + +```rust +pub(crate) struct Tree { + nodes: Vec>, + spine: Vec, + cur: Option, +} + +pub(crate) struct Node { + pub child: Option, + pub next: Option, + pub item: T, +} +``` + +Key optimizations in the tree structure include: + +- Using indices instead of pointers for node references +- Maintaining a "spine" for fast access to ancestor nodes +- Storing nodes contiguously in a vector for better cache usage +- Using non-zero indices to save space in option types + +## Protection Against Pathological Input + +It is important that the parser performance remain linear with respect to the input length, otherwise the parser would find itself vulnerable to potential DOS attacks. This may not be important for all consumers, but for anyone depending on the library to handle user generated content this is critical. + +Several protections are in place to prevent quadratic time or memory usage on malicious input: + +1. Link nesting depth is limited: +```rust +pub(crate) const LINK_MAX_NESTED_PARENS: usize = 32; +``` + +2. Table column expansion is bounded: +```rust +// Limit to prevent quadratic growth from empty cells +const MAX_AUTOCOMPLETED_CELLS: usize = 1 << 18; +``` + +3. Link reference expansion tracking: +```rust +// Track expansion to prevent quadratic growth from reference definitions +let mut link_ref_expansion_limit: usize = text.len().max(100_000); +``` + + +## Key Performance Considerations + +When using the library, keep in mind: + +1. SIMD optimizations require the `simd` feature and x86_64 platform +2. Large documents benefit most from SIMD scanning +4. The parser is designed for streaming, allowing incremental processing +5. Pathological input protection may limit processing of extremely nested or repetitive content + +## Benchmarking + +The library includes benchmarks to measure performance of key operations: + +- String handling with different storage strategies +- Tree operations +- Full document parsing +- Pathological input cases + +When making changes that could affect performance, run the benchmarks to ensure optimizations are effective: + +```bash +cargo bench +``` + +Note that some optimizations (like SIMD) are platform-specific, so testing on multiple platforms may be necessary. diff --git a/guide/src/dev/string-handling.md b/guide/src/dev/string-handling.md new file mode 100644 index 00000000..1fea7cde --- /dev/null +++ b/guide/src/dev/string-handling.md @@ -0,0 +1,129 @@ +# String Handling + +pulldown-cmark uses a specialized string type system optimized for the specific needs of parsing and representing Markdown content. This chapter explains the key components and design decisions of this system. + +## Overview + +The library uses two main custom string types: + +- `CowStr`: A three-word copy-on-write string type that can be owned, borrowed, or inlined +- `InlineStr`: A small string optimized for very short content that can be stored inline + +These types are designed to balance several requirements: + +- Efficient memory usage for the many small string fragments in Markdown +- Zero-copy operation where possible by borrowing from input +- Good performance for string operations needed during parsing +- Safety and correct handling of Unicode + +## CowStr Type + +The `CowStr` enum is the primary string type used throughout the library. It has three variants: + +```rust +pub enum CowStr<'a> { + Boxed(Box), + Borrowed(&'a str), + Inlined(InlineStr), +} +``` + +Each variant serves a specific purpose: + +- `Borrowed`: References strings from the input text with zero copying +- `Inlined`: Stores very short strings (up to ~22 bytes on 64-bit systems) directly in the enum +- `Boxed`: Owns longer strings that need to be heap allocated + +The key feature is that `CowStr` is exactly three words in size regardless of which variant is used. This fixed size makes it efficient to store and pass around. + +### Example Usage + +```rust +// Borrow from input when possible +let borrowed: CowStr = input[0..15].into(); + +// Single chars are inlined +let inline: CowStr = 'x'.into(); + +// Longer strings are boxed +let boxed: CowStr = "a rather long string...".to_string().into(); +``` + +## InlineStr Type + +`InlineStr` is a small string type that can store short strings inline without heap allocation. It consists of: + +- A fixed-size byte array sized to three machine words minus 2 bytes +- A length field using the remaining byte + +```rust +pub struct InlineStr { + inner: [u8; MAX_INLINE_STR_LEN], + len: u8, +} +``` + +The size is chosen to allow `InlineStr` to be stored directly in `CowStr` without increasing its overall size. On 64-bit systems this allows for strings up to 22 bytes. + +```rust +const MAX_INLINE_STR_LEN: usize = 3 * std::mem::size_of::() - 2; +``` + +Key characteristics: + +- Fixed size with no heap allocation +- UTF-8 encoded +- Length limited by available space +- Copy-able since it's a fixed-size type + +## Converting Between Types + +The library provides conversions between various string types: + +```rust +// From str +let cow: CowStr = "text".into(); + +// From String +let cow: CowStr = string.into(); + +// From char +let cow: CowStr = 'x'.into(); + +// From std::borrow::Cow +let cow: CowStr = std_cow.into(); +``` + +It also provides methods to convert into owned types: + +```rust +let string: String = cow_str.into_string(); +let static_cow: CowStr<'static> = cow_str.into_static(); +``` + +## Performance Considerations + +The string system is designed for the performance characteristics needed by a Markdown parser: + +- Minimal copying of input text +- Efficient handling of many small string fragments +- Fast comparisons for link matching + +## Unicode Handling + +As with Rust built-in strings, these types maintain proper UTF-8 encoding: + +- Input validation occurs when creating `InlineStr` +- String operations preserve valid UTF-8 +- Character boundaries are respected when manipulating strings + +## Implementation Details + +When implementing new features that handle strings, follow these guidelines: + +1. Use `CowStr` as the primary string type +2. Borrow from input when possible using `Borrowed` variant +3. Use `InlineStr` for short string literals +4. Convert to `String` only when necessary for buffering +5. Be aware of UTF-8 encoding requirements +6. Consider memory usage patterns when choosing string operations From 097503065af07b2280b32e1fc64f30a432839888 Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Sat, 28 Dec 2024 11:19:31 -0800 Subject: [PATCH 076/180] remove half implemented fix This originally served as a fix to wikilinks with brackets rendering correctly, so that [[Bracket ] here]] and [[Bracket [ here]] render properly. But this removes this functionality because it is only half implemented. --- pulldown-cmark/src/parse.rs | 182 ++++++++++++++++-------------------- 1 file changed, 80 insertions(+), 102 deletions(-) diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 24c82602..28ff3089 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -622,97 +622,91 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { self.tree[cur_ix].item.body = ItemBody::Text { backslash_escaped: false, }; - let wikilink = if double { - // wikilinks take precedence over normal links - // TODO: it may be better to peek for a doubled - // linkopen instead of manipulating the stack like this - self.link_stack.pop_doubled_link() - } else { - None - }; - if let Some(el) = wikilink { - // if this really is doubled, the item below the - // doubled link should have the true start of the link - // we are making lots of assumptions that the first - // pass should protect - let Some(outer_el) = self.link_stack.pop() else { - continue; - }; - let Some(body_node) = self.tree[el.node].next else { - continue; - }; - let Some(next_node) = self.tree[cur_ix].next.map(|n| self.tree[n].next) - else { + if let Some(tos) = self.link_stack.pop() { + if tos.ty == LinkStackTy::Disabled { continue; - }; - if let Some(prev_ix) = prev { - self.tree[prev_ix].next = None; } - let start_ix = self.tree[body_node].item.start; - let end_ix = self.tree[cur_ix].item.start; - let wikilink = match scan_wikilink_pipe( - block_text, - start_ix, // bounded by closing tag - end_ix - start_ix, - ) { - Some((rest, wikiname)) => { - // [[WikiName|rest]] - let body_node = scan_nodes_to_ix(&self.tree, Some(body_node), rest); - if let Some(body_node) = body_node { - // break node so passes can actually format - // the display text - self.tree[body_node].item.start = start_ix + rest; + if tos.ty == LinkStackTy::Link(true) { + // if this really is doubled, the item below the + // doubled link should have the true start of the link + // we are making lots of assumptions that the first + // pass should protect + let Some(outer_el) = self.link_stack.pop() else { + continue; + }; + let Some(body_node) = self.tree[tos.node].next else { + continue; + }; + let Some(next_node) = self.tree[cur_ix].next.map(|n| self.tree[n].next) + else { + continue; + }; + if let Some(prev_ix) = prev { + self.tree[prev_ix].next = None; + } + let start_ix = self.tree[body_node].item.start; + let end_ix = self.tree[cur_ix].item.start; + let wikilink = match scan_wikilink_pipe( + block_text, + start_ix, // bounded by closing tag + end_ix - start_ix, + ) { + Some((rest, wikiname)) => { + // [[WikiName|rest]] + let body_node = + scan_nodes_to_ix(&self.tree, Some(body_node), rest); + if let Some(body_node) = body_node { + // break node so passes can actually format + // the display text + self.tree[body_node].item.start = start_ix + rest; + Some((body_node, wikiname)) + } else { + None + } + } + None => { + // [[WikiName]] + let wikiname = &block_text[start_ix..end_ix]; + // or [[Nested/WikiName]] + let display_ix = wikiname + .as_bytes() + .iter() + .rposition(|b| *b == b'/') + .map(|ix| ix + 1) + .unwrap_or(0) + + start_ix; + // TODO: wikitext should not be styled, might + // need a more experienced contributor's help + let body_node = self.tree.create_node(Item { + start: display_ix, + end: end_ix, + body: ItemBody::Text { + backslash_escaped: false, + }, + }); Some((body_node, wikiname)) - } else { - None } + }; + // exists only to panic guard against edge cases, this + // should run 99.9% of the time + if let Some((body_node, wikiname)) = wikilink { + let link_ix = self.allocs.allocate_link( + LinkType::WikiLink, + format_wikilink(wikiname), + "".into(), + "".into(), + ); + self.tree[outer_el.node].item.body = ItemBody::Link(link_ix); + self.tree[outer_el.node].child = Some(body_node); + self.tree[outer_el.node].next = next_node; + self.tree[outer_el.node].item.end = end_ix + 1; + self.link_stack.disable_all_links(); } - None => { - // [[WikiName]] - let wikiname = &block_text[start_ix..end_ix]; - // or [[Nested/WikiName]] - let display_ix = wikiname - .as_bytes() - .iter() - .rposition(|b| *b == b'/') - .map(|ix| ix + 1) - .unwrap_or(0) - + start_ix; - // TODO: wikitext should not be styled, might - // need a more experienced contributor's help - let body_node = self.tree.create_node(Item { - start: display_ix, - end: end_ix, - body: ItemBody::Text { - backslash_escaped: false, - }, - }); - Some((body_node, wikiname)) - } - }; - // exists only to panic guard against edge cases, this - // should run 99.9% of the time - if let Some((body_node, wikiname)) = wikilink { - let link_ix = self.allocs.allocate_link( - LinkType::WikiLink, - format_wikilink(wikiname), - "".into(), - "".into(), - ); - self.tree[outer_el.node].item.body = ItemBody::Link(link_ix); - self.tree[outer_el.node].child = Some(body_node); - self.tree[outer_el.node].next = next_node; - self.tree[outer_el.node].item.end = end_ix + 1; - self.link_stack.disable_all_links(); - } - // at this point, regardless of whether we were - // successful the stack has been trashed, so use this - // to bring the pass back in a valid state - prev = Some(outer_el.node); - cur = next_node; - continue; - } else if let Some(tos) = self.link_stack.pop() { - if tos.ty == LinkStackTy::Disabled { + // at this point, regardless of whether we were + // successful the stack has been trashed, so use this + // to bring the pass back in a valid state + prev = Some(outer_el.node); + cur = next_node; continue; } let next = self.tree[cur_ix].next; @@ -1755,22 +1749,6 @@ impl LinkStack { el } - /// Consumes the link stack until a doubled link is found. Should only be - /// called when a closing wikilink tag is ABSOLUTELY there, since this - /// messes with the link stack in a way that's only valid after completing - /// the closing tag of a wikilink. - fn pop_doubled_link(&mut self) -> Option { - if let Some(ix) = self - .inner - .iter() - .rposition(|el| el.ty == LinkStackTy::Link(true)) - { - self.inner.drain(ix..).next() - } else { - None - } - } - fn clear(&mut self) { self.inner.clear(); self.disabled_ix = 0; From 19c4000995247158ad353d651ba21f51f7e2910a Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Mon, 30 Dec 2024 19:07:35 -0800 Subject: [PATCH 077/180] update spec + tests --- pulldown-cmark/specs/wikilinks.txt | 58 +++++++++++++++----- pulldown-cmark/tests/suite/wikilinks.rs | 71 +++++++++++++++++++------ 2 files changed, 98 insertions(+), 31 deletions(-) diff --git a/pulldown-cmark/specs/wikilinks.txt b/pulldown-cmark/specs/wikilinks.txt index 02ec588e..241f834f 100644 --- a/pulldown-cmark/specs/wikilinks.txt +++ b/pulldown-cmark/specs/wikilinks.txt @@ -11,7 +11,7 @@ syntatic sugar. Define wikilinks with double brackets: ```````````````````````````````` example_wikilinks This is a [[WikiLink]]. . -

    This is a WikiLink.

    +

    This is a WikiLink.

    ```````````````````````````````` Wikilinks take precedence over reference links: @@ -21,7 +21,22 @@ This is [[Ambiguous]]. [Ambiguous]: https://example.com/ . -

    This is Ambiguous.

    +

    This is Ambiguous.

    +```````````````````````````````` + +However, they should not otherwise interfere with normal Markdown links: + +```````````````````````````````` example_wikilinks +[[squid] calamari is considered a delicacy](https://en.wikipedia.org/wiki/Squid) + +[calamari [squid]](https://en.wikipedia.org/wiki/Squid) +. +

    +[squid] calamari is considered a delicacy +

    +

    +calamari [squid] +

    ```````````````````````````````` They also take precedence over inline links: @@ -29,7 +44,7 @@ They also take precedence over inline links: ```````````````````````````````` example_wikilinks This is [also [[Ambiguous]]](https://example.com/). . -

    This is [also Ambiguous](https://example.com/).

    +

    This is [also Ambiguous](https://example.com/).

    ```````````````````````````````` Wikilinks can have different display text, called piping: @@ -37,7 +52,7 @@ Wikilinks can have different display text, called piping: ```````````````````````````````` example_wikilinks This is [[WikiLink|a pothole]]. . -

    This is a pothole.

    +

    This is a pothole.

    ```````````````````````````````` Using this syntax, it is possible to show more Markdown in the text: @@ -45,27 +60,33 @@ Using this syntax, it is possible to show more Markdown in the text: ```````````````````````````````` example_wikilinks This is [[WikiLink|a **strong** pothole]]. . -

    This is a strong pothole.

    +

    This is a strong pothole.

    ```````````````````````````````` Or images: ```````````````````````````````` example_wikilinks -This is a cute dog, linked to the page "/WikiLink/" +This is a cute dog, linked to the page "WikiLink" [[WikiLink|![dog](dog.png)]] . -

    This is a cute dog, linked to the page "/WikiLink/"

    dog

    +

    This is a cute dog, linked to the page "WikiLink"

    dog

    +```````````````````````````````` + +With nested wikilinks, the deepest one takes precedence: + +```````````````````````````````` example_wikilinks +[[WikiLink|[[Fish]]]] +. +

    [[WikiLink|Fish]]

    ```````````````````````````````` -The content of a wikilink *becomes* the link, modified with some basic rules: -* The `/`` character is appended to the front and back of the link. -* Any whitespace characters are replaced with `_`. +Links inside wikilinks will not render: ```````````````````````````````` example_wikilinks -The url of [[This Link]] becomes "/This_Link/" +[[WikiLink|[cat](cat.html)]] . -

    The url of This Link becomes "/This_Link/"

    +

    [cat](cat.html)

    ```````````````````````````````` Paths can be qualified in wikilinks while only showing the title of the page. @@ -74,7 +95,16 @@ This is useful for wikis that support a "directory-like" system. ```````````````````````````````` example_wikilinks This is a [[WikiLink/In/A/Directory]]. . -

    This is a Directory.

    +

    This is a Directory.

    +```````````````````````````````` + +This functionality will also trim any URL fragments (#Heading) in the display +text. + +```````````````````````````````` example_wikilinks +This is a [[Wonderful/WikiLink#Secret]]. +. +

    This is a WikiLink.

    ```````````````````````````````` Of course, the pipe operator can still be used: @@ -82,5 +112,5 @@ Of course, the pipe operator can still be used: ```````````````````````````````` example_wikilinks This is a [[WikiLink/In/A/Directory|WikiLink]]. . -

    This is a WikiLink.

    +

    This is a WikiLink.

    ```````````````````````````````` diff --git a/pulldown-cmark/tests/suite/wikilinks.rs b/pulldown-cmark/tests/suite/wikilinks.rs index c4c11ccd..9d20935d 100644 --- a/pulldown-cmark/tests/suite/wikilinks.rs +++ b/pulldown-cmark/tests/suite/wikilinks.rs @@ -7,7 +7,7 @@ use super::test_markdown_html; fn wikilinks_test_1() { let original = r##"This is a [[WikiLink]]. "##; - let expected = r##"

    This is a WikiLink.

    + let expected = r##"

    This is a WikiLink.

    "##; test_markdown_html(original, expected, false, false, false, false, true); @@ -19,7 +19,7 @@ fn wikilinks_test_2() { [Ambiguous]: https://example.com/ "##; - let expected = r##"

    This is Ambiguous.

    + let expected = r##"

    This is Ambiguous.

    "##; test_markdown_html(original, expected, false, false, false, false, true); @@ -27,9 +27,16 @@ fn wikilinks_test_2() { #[test] fn wikilinks_test_3() { - let original = r##"This is [also [[Ambiguous]]](https://example.com/). + let original = r##"[[squid] calamari is considered a delicacy](https://en.wikipedia.org/wiki/Squid) + +[calamari [squid]](https://en.wikipedia.org/wiki/Squid) "##; - let expected = r##"

    This is [also Ambiguous](https://example.com/).

    + let expected = r##"

    +[squid] calamari is considered a delicacy +

    +

    +calamari [squid] +

    "##; test_markdown_html(original, expected, false, false, false, false, true); @@ -37,9 +44,9 @@ fn wikilinks_test_3() { #[test] fn wikilinks_test_4() { - let original = r##"This is [[WikiLink|a pothole]]. + let original = r##"This is [also [[Ambiguous]]](https://example.com/). "##; - let expected = r##"

    This is a pothole.

    + let expected = r##"

    This is [also Ambiguous](https://example.com/).

    "##; test_markdown_html(original, expected, false, false, false, false, true); @@ -47,9 +54,9 @@ fn wikilinks_test_4() { #[test] fn wikilinks_test_5() { - let original = r##"This is [[WikiLink|a **strong** pothole]]. + let original = r##"This is [[WikiLink|a pothole]]. "##; - let expected = r##"

    This is a strong pothole.

    + let expected = r##"

    This is a pothole.

    "##; test_markdown_html(original, expected, false, false, false, false, true); @@ -57,11 +64,9 @@ fn wikilinks_test_5() { #[test] fn wikilinks_test_6() { - let original = r##"This is a cute dog, linked to the page "/WikiLink/" - -[[WikiLink|![dog](dog.png)]] + let original = r##"This is [[WikiLink|a **strong** pothole]]. "##; - let expected = r##"

    This is a cute dog, linked to the page "/WikiLink/"

    dog

    + let expected = r##"

    This is a strong pothole.

    "##; test_markdown_html(original, expected, false, false, false, false, true); @@ -69,9 +74,11 @@ fn wikilinks_test_6() { #[test] fn wikilinks_test_7() { - let original = r##"The url of [[This Link]] becomes "/This_Link/" + let original = r##"This is a cute dog, linked to the page "WikiLink" + +[[WikiLink|![dog](dog.png)]] "##; - let expected = r##"

    The url of This Link becomes "/This_Link/"

    + let expected = r##"

    This is a cute dog, linked to the page "WikiLink"

    dog

    "##; test_markdown_html(original, expected, false, false, false, false, true); @@ -79,9 +86,9 @@ fn wikilinks_test_7() { #[test] fn wikilinks_test_8() { - let original = r##"This is a [[WikiLink/In/A/Directory]]. + let original = r##"[[WikiLink|[[Fish]]]] "##; - let expected = r##"

    This is a Directory.

    + let expected = r##"

    [[WikiLink|Fish]]

    "##; test_markdown_html(original, expected, false, false, false, false, true); @@ -89,9 +96,39 @@ fn wikilinks_test_8() { #[test] fn wikilinks_test_9() { + let original = r##"[[WikiLink|[cat](cat.html)]] +"##; + let expected = r##"

    [cat](cat.html)

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} + +#[test] +fn wikilinks_test_10() { + let original = r##"This is a [[WikiLink/In/A/Directory]]. +"##; + let expected = r##"

    This is a Directory.

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} + +#[test] +fn wikilinks_test_11() { + let original = r##"This is a [[Wonderful/WikiLink#Secret]]. +"##; + let expected = r##"

    This is a WikiLink.

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} + +#[test] +fn wikilinks_test_12() { let original = r##"This is a [[WikiLink/In/A/Directory|WikiLink]]. "##; - let expected = r##"

    This is a WikiLink.

    + let expected = r##"

    This is a WikiLink.

    "##; test_markdown_html(original, expected, false, false, false, false, true); From 13a18135a1f22d2576f6ec16a4fbb9f521a14380 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Mon, 30 Dec 2024 20:05:01 -0700 Subject: [PATCH 078/180] Use slice patterns for `unescape` This cleans up the code a bit. --- pulldown-cmark/src/scanners.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index b2fc4c39..d6ef69a3 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -1150,28 +1150,23 @@ pub(crate) fn unescape<'a, I: Into>>(input: I, is_in_table: bool) -> let mut i = 0; let bytes = input.as_bytes(); while i < bytes.len() { - match bytes[i] { + match bytes[i..] { // Tables are special, because they're parsed as-if the tables // were parsed in a discrete pass, changing `\|` to `|`, and then // passing the changed string to the inline parser. - b'\\' - if is_in_table - && i + 2 < bytes.len() - && bytes[i + 1] == b'\\' - && bytes[i + 2] == b'|' => - { + [b'\\', b'\\', b'|', ..] if is_in_table => { // even number of `\`s before pipe // odd number is handled in the normal way below result.push_str(&input[mark..i]); mark = i + 2; i += 3; } - b'\\' if i + 1 < bytes.len() && is_ascii_punctuation(bytes[i + 1]) => { + [b'\\', cx, ..] if is_ascii_punctuation(cx) => { result.push_str(&input[mark..i]); mark = i + 1; i += 2; } - b'&' => match scan_entity(&bytes[i..]) { + [b'&', ..] => match scan_entity(&bytes[i..]) { (n, Some(value)) => { result.push_str(&input[mark..i]); result.push_str(&value); @@ -1180,7 +1175,7 @@ pub(crate) fn unescape<'a, I: Into>>(input: I, is_in_table: bool) -> } _ => i += 1, }, - b'\r' => { + [b'\r', ..] => { result.push_str(&input[mark..i]); i += 1; mark = i; From 1311ba8a457b9ab72dd0acdce3b1352a7d03b188 Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Mon, 30 Dec 2024 20:42:20 -0800 Subject: [PATCH 079/180] impl new wikilink pass --- pulldown-cmark/src/firstpass.rs | 75 ++++++-- pulldown-cmark/src/parse.rs | 330 +++++++++++++++++++++----------- 2 files changed, 270 insertions(+), 135 deletions(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 0e38bc32..da90060a 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -1056,7 +1056,20 @@ impl<'a, 'b> FirstPass<'a, 'b> { LoopInstruction::ContinueAndSkip(0) } b'!' => { - if ix + 1 < bytes_len && bytes[ix + 1] == b'[' { + if self.options.contains(Options::ENABLE_WIKILINKS) + && ix + 2 < bytes_len + && &bytes[ix..ix + 2] == b"[[" + { + self.tree.append_text(begin_text, ix, backslash_escaped); + backslash_escaped = false; + self.tree.append(Item { + start: ix, + end: ix + 3, + body: ItemBody::MaybeWikiLinkImage, + }); + begin_text = ix + 3; + LoopInstruction::ContinueAndSkip(2) + } else if ix + 1 < bytes_len && bytes[ix + 1] == b'[' { self.tree.append_text(begin_text, ix, backslash_escaped); backslash_escaped = false; self.tree.append(Item { @@ -1071,32 +1084,52 @@ impl<'a, 'b> FirstPass<'a, 'b> { } } b'[' => { - let double = ix > 0 - && bytes[ix - 1] == b'[' - && self.options.contains(Options::ENABLE_WIKILINKS); self.tree.append_text(begin_text, ix, backslash_escaped); backslash_escaped = false; - self.tree.append(Item { - start: ix, - end: ix + 1, - body: ItemBody::MaybeLinkOpen(double), - }); - begin_text = ix + 1; - LoopInstruction::ContinueAndSkip(0) + if self.options.contains(Options::ENABLE_WIKILINKS) + && ix + 1 < bytes_len + && bytes[ix + 1] == b'[' + { + self.tree.append(Item { + start: ix, + end: ix + 2, + body: ItemBody::MaybeWikiLinkOpen, + }); + begin_text = ix + 2; + LoopInstruction::ContinueAndSkip(1) + } else { + self.tree.append(Item { + start: ix, + end: ix + 1, + body: ItemBody::MaybeLinkOpen, + }); + begin_text = ix + 1; + LoopInstruction::ContinueAndSkip(0) + } } b']' => { - let double = ix + 1 < bytes_len - && bytes[ix + 1] == b']' - && self.options.contains(Options::ENABLE_WIKILINKS); self.tree.append_text(begin_text, ix, backslash_escaped); backslash_escaped = false; - self.tree.append(Item { - start: ix, - end: ix + 1, - body: ItemBody::MaybeLinkClose(double, true), - }); - begin_text = ix + 1; - LoopInstruction::ContinueAndSkip(0) + if self.options.contains(Options::ENABLE_WIKILINKS) + && ix + 1 < bytes_len + && bytes[ix + 1] == b']' + { + self.tree.append(Item { + start: ix, + end: ix + 2, + body: ItemBody::MaybeWikiLinkClose, + }); + begin_text = ix + 2; + LoopInstruction::ContinueAndSkip(1) + } else { + self.tree.append(Item { + start: ix, + end: ix + 1, + body: ItemBody::MaybeLinkClose(true), + }); + begin_text = ix + 1; + LoopInstruction::ContinueAndSkip(0) + } } b'&' => match scan_entity(&bytes[ix..]) { (n, Some(value)) => { diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 28ff3089..81dc4735 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -22,7 +22,7 @@ use std::cmp::{max, min}; use std::collections::{HashMap, VecDeque}; -use std::iter::{once, FusedIterator}; +use std::iter::FusedIterator; use std::num::NonZeroUsize; use std::ops::{Index, Range}; @@ -64,11 +64,13 @@ pub(crate) enum ItemBody { MaybeSmartQuote(u8, bool, bool), MaybeCode(usize, bool), // number of backticks, preceded by backslash MaybeHtml, - // bool `double` indicating this could be a wikilink - MaybeLinkOpen(bool), - // double, bool indicates whether or not the preceding section could be a reference - MaybeLinkClose(bool, bool), + MaybeLinkOpen, + // bool indicates whether or not the preceding section could be a reference + MaybeLinkClose(bool), MaybeImage, + MaybeWikiLinkOpen, + MaybeWikiLinkClose, + MaybeWikiLinkImage, // These are inline items after resolution. Emphasis, @@ -138,9 +140,12 @@ impl ItemBody { | MaybeSmartQuote(..) | MaybeCode(..) | MaybeHtml - | MaybeLinkOpen(..) + | MaybeLinkOpen | MaybeLinkClose(..) | MaybeImage + | MaybeWikiLinkOpen + | MaybeWikiLinkClose + | MaybeWikiLinkImage ) } fn is_inline(&self) -> bool { @@ -152,9 +157,12 @@ impl ItemBody { | MaybeSmartQuote(..) | MaybeCode(..) | MaybeHtml - | MaybeLinkOpen(..) + | MaybeLinkOpen | MaybeLinkClose(..) | MaybeImage + | MaybeWikiLinkOpen + | MaybeWikiLinkClose + | MaybeWikiLinkImage | Emphasis | Strong | Strikethrough @@ -375,10 +383,191 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { /// /// Note: there's some potential for optimization here, but that's future work. fn handle_inline(&mut self) { + // options that require an extra pass + if self.options.contains(Options::ENABLE_WIKILINKS) { + self.handle_inline_pass2(); + } self.handle_inline_pass1(); self.handle_emphasis_and_hard_break(); } + /// Handles wikilinks. + /// + /// Because wikilinks have syntax that interferes with normal Markdown + /// links, they must be processed before links are. + fn handle_inline_pass2(&mut self) { + let mut cur = self.tree.cur(); + let mut prev = None; + + let block_end = self.tree[self.tree.peek_up().unwrap()].item.end; + let block_text = &self.text[..block_end]; + + while let Some(cur_ix) = cur { + match self.tree[cur_ix].item.body { + ItemBody::MaybeLinkOpen => { + self.link_stack.push(LinkStackEl { + node: cur_ix, + ty: LinkStackTy::Link, + wikilink: false, + }); + } + ItemBody::MaybeImage => { + self.link_stack.push(LinkStackEl { + node: cur_ix, + ty: LinkStackTy::Image, + wikilink: false, + }); + } + ItemBody::MaybeWikiLinkOpen => { + self.link_stack.push(LinkStackEl { + node: cur_ix, + ty: LinkStackTy::Link, + wikilink: true, + }); + } + ItemBody::MaybeWikiLinkImage => { + self.link_stack.push(LinkStackEl { + node: cur_ix, + ty: LinkStackTy::Image, + wikilink: true, + }); + } + ItemBody::MaybeWikiLinkClose => { + let next_ix = self.break_maybe_wikilink(cur_ix); + // find next wikilink + let mut tos = None; + while let Some(next_tos) = self.link_stack.pop() { + if next_tos.ty == LinkStackTy::Disabled { + // Link is totally disabled, so untokenize it for next pass + self.tree[next_tos.node].item.body = ItemBody::Text { + backslash_escaped: false, + }; + } else if next_tos.wikilink { + tos = Some(next_tos); + break; + } + } + if let Some(tos) = tos { + let inner_node = self.break_maybe_wikilink(tos.node); + let Some(body_node) = self.tree[inner_node].next else { + // skip if no next node exists, like at end of + // input + cur = self.tree[cur_ix].next; + continue; + }; + let start_ix = self.tree[body_node].item.start; + let end_ix = self.tree[cur_ix].item.start; + let wikilink = match scan_wikilink_pipe( + block_text, + start_ix, // bounded by closing tag + end_ix - start_ix, + ) { + Some((rest, wikiname)) => { + // [[WikiName|rest]] + let body_node = scan_nodes_to_ix(&self.tree, Some(body_node), rest); + if let Some(body_node) = body_node { + // break node so passes can actually format + // the display text + self.tree[body_node].item.start = start_ix + rest; + Some((body_node, wikiname)) + } else { + None + } + } + None => { + // [[WikiName]] + let wikiname = &block_text[start_ix..end_ix]; + // or [[Nested/WikiName]] + let display_ix = wikiname + .as_bytes() + .iter() + .rposition(|b| *b == b'/') + .map(|ix| ix + 1) + .unwrap_or(0) + + start_ix; + let display_end_ix = wikiname + .as_bytes() + .iter() + .position(|b| *b == b'#') + .unwrap_or(wikiname.len()) + + start_ix; + // TODO: wikitext should not be styled, might + // need a more experienced contributor's help + let body_node = self.tree.create_node(Item { + start: display_ix, + end: display_end_ix, + body: ItemBody::Text { + backslash_escaped: false, + }, + }); + Some((body_node, wikiname)) + } + }; + + if let Some((body_node, wikiname)) = wikilink { + let link_ix = self.allocs.allocate_link( + LinkType::WikiLink, + wikiname.into(), + "".into(), + "".into(), + ); + if let Some(prev_ix) = prev { + self.tree[prev_ix].next = None; + } + self.tree[tos.node].item.body = ItemBody::Link(link_ix); + self.tree[tos.node].child = Some(body_node); + self.tree[tos.node].next = self.tree[next_ix].next; + self.tree[tos.node].item.end = end_ix + 1; + self.link_stack.disable_all_links(); + } + } + } + _ => (), + } + + prev = cur; + cur = self.tree[cur_ix].next; + } + + while let Some(tos) = self.link_stack.pop() { + if tos.ty == LinkStackTy::Disabled { + // Link is totally disabled, so untokenize it for next pass + self.tree[tos.node].item.body = ItemBody::Text { + backslash_escaped: false, + }; + } else if tos.wikilink { + // break wikilink into tokens + self.break_maybe_wikilink(tos.node); + } + } + } + + /// Breaks a wikilink token into parts so inline_pass1 can pick up on + /// unresolved tokens. + fn break_maybe_wikilink(&mut self, node: TreeIndex) -> TreeIndex { + self.tree[node].item.end -= 1; + let next_ix = self.tree.create_node(Item { + start: self.tree[node].item.end, + end: self.tree[node].item.end + 1, + body: match self.tree[node].item.body { + ItemBody::MaybeWikiLinkOpen | ItemBody::MaybeWikiLinkImage => { + ItemBody::MaybeLinkOpen + } + ItemBody::MaybeWikiLinkClose => ItemBody::MaybeLinkClose(true), + _ => unreachable!(), + }, + }); + self.tree[node].item.body = match self.tree[node].item.body { + ItemBody::MaybeWikiLinkOpen => ItemBody::MaybeLinkOpen, + ItemBody::MaybeWikiLinkImage => ItemBody::MaybeImage, + ItemBody::MaybeWikiLinkClose => ItemBody::MaybeLinkClose(true), + _ => unreachable!(), + }; + self.tree[next_ix].next = self.tree[node].next; + self.tree[node].next = Some(next_ix); + next_ix + } + /// Handle inline HTML, code spans, and links. /// /// This function handles both inline HTML and code spans, because they have @@ -600,13 +789,14 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { } } } - ItemBody::MaybeLinkOpen(double) => { + ItemBody::MaybeLinkOpen => { self.tree[cur_ix].item.body = ItemBody::Text { backslash_escaped: false, }; self.link_stack.push(LinkStackEl { node: cur_ix, - ty: LinkStackTy::Link(double), + ty: LinkStackTy::Link, + wikilink: false, }); } ItemBody::MaybeImage => { @@ -616,97 +806,25 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { self.link_stack.push(LinkStackEl { node: cur_ix, ty: LinkStackTy::Image, + wikilink: false, }); } - ItemBody::MaybeLinkClose(double, could_be_ref) => { + ItemBody::MaybeLinkClose(could_be_ref) => { self.tree[cur_ix].item.body = ItemBody::Text { backslash_escaped: false, }; if let Some(tos) = self.link_stack.pop() { - if tos.ty == LinkStackTy::Disabled { + // skip rendering if already in a link, unless its an + // image + if tos.ty != LinkStackTy::Image + && matches!( + self.tree[self.tree.peek_up().unwrap()].item.body, + ItemBody::Link(..) + ) + { continue; } - if tos.ty == LinkStackTy::Link(true) { - // if this really is doubled, the item below the - // doubled link should have the true start of the link - // we are making lots of assumptions that the first - // pass should protect - let Some(outer_el) = self.link_stack.pop() else { - continue; - }; - let Some(body_node) = self.tree[tos.node].next else { - continue; - }; - let Some(next_node) = self.tree[cur_ix].next.map(|n| self.tree[n].next) - else { - continue; - }; - if let Some(prev_ix) = prev { - self.tree[prev_ix].next = None; - } - let start_ix = self.tree[body_node].item.start; - let end_ix = self.tree[cur_ix].item.start; - let wikilink = match scan_wikilink_pipe( - block_text, - start_ix, // bounded by closing tag - end_ix - start_ix, - ) { - Some((rest, wikiname)) => { - // [[WikiName|rest]] - let body_node = - scan_nodes_to_ix(&self.tree, Some(body_node), rest); - if let Some(body_node) = body_node { - // break node so passes can actually format - // the display text - self.tree[body_node].item.start = start_ix + rest; - Some((body_node, wikiname)) - } else { - None - } - } - None => { - // [[WikiName]] - let wikiname = &block_text[start_ix..end_ix]; - // or [[Nested/WikiName]] - let display_ix = wikiname - .as_bytes() - .iter() - .rposition(|b| *b == b'/') - .map(|ix| ix + 1) - .unwrap_or(0) - + start_ix; - // TODO: wikitext should not be styled, might - // need a more experienced contributor's help - let body_node = self.tree.create_node(Item { - start: display_ix, - end: end_ix, - body: ItemBody::Text { - backslash_escaped: false, - }, - }); - Some((body_node, wikiname)) - } - }; - // exists only to panic guard against edge cases, this - // should run 99.9% of the time - if let Some((body_node, wikiname)) = wikilink { - let link_ix = self.allocs.allocate_link( - LinkType::WikiLink, - format_wikilink(wikiname), - "".into(), - "".into(), - ); - self.tree[outer_el.node].item.body = ItemBody::Link(link_ix); - self.tree[outer_el.node].child = Some(body_node); - self.tree[outer_el.node].next = next_node; - self.tree[outer_el.node].item.end = end_ix + 1; - self.link_stack.disable_all_links(); - } - // at this point, regardless of whether we were - // successful the stack has been trashed, so use this - // to bring the pass back in a valid state - prev = Some(outer_el.node); - cur = next_node; + if tos.ty == LinkStackTy::Disabled { continue; } let next = self.tree[cur_ix].next; @@ -735,7 +853,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { max(self.tree[next_node_ix].item.start, next_ix); } - if matches!(tos.ty, LinkStackTy::Link(..)) { + if tos.ty == LinkStackTy::Link { self.link_stack.disable_all_links(); } } else { @@ -758,7 +876,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { continue; }; self.tree[reference_close_node].item.body = - ItemBody::MaybeLinkClose(double, false); + ItemBody::MaybeLinkClose(false); let next_node = self.tree[reference_close_node].next; (next_node, LinkType::Reference) @@ -893,7 +1011,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { cur = Some(tos.node); cur_ix = tos.node; - if matches!(tos.ty, LinkStackTy::Link(..)) { + if tos.ty == LinkStackTy::Link { self.link_stack.disable_all_links(); } } @@ -1756,7 +1874,7 @@ impl LinkStack { fn disable_all_links(&mut self) { for el in &mut self.inner[self.disabled_ix..] { - if matches!(el.ty, LinkStackTy::Link(..)) { + if el.ty == LinkStackTy::Link { el.ty = LinkStackTy::Disabled; } } @@ -1768,12 +1886,12 @@ impl LinkStack { struct LinkStackEl { node: TreeIndex, ty: LinkStackTy, + wikilink: bool, } #[derive(PartialEq, Clone, Debug)] enum LinkStackTy { - // if this is doubled up, could be a wikilink - Link(bool), + Link, Image, Disabled, } @@ -2176,22 +2294,6 @@ impl<'a, F: BrokenLinkCallback<'a>> Iterator for OffsetIter<'a, F> { } } -fn format_wikilink<'a>(text: &'a str) -> CowStr<'a> { - // this does not check if the link already has the special control - // characters, as in the "href" of [[/Wiki_Link/]] becomes "//Wiki_Link//" - // no support planned because it defeats a core design decision of - // wikilinks - once('/') - .chain( - text.chars() - .map(|b| if b.is_ascii_whitespace() { '_' } else { b }), - ) - .chain(once('/')) - // written like this to enable iter optimization - .collect::() - .into() -} - fn body_to_tag_end(body: &ItemBody) -> TagEnd { match *body { ItemBody::Paragraph => TagEnd::Paragraph, From eaac818e6ad6cac0276f867f84658e41134d45b3 Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Tue, 31 Dec 2024 09:53:15 -0800 Subject: [PATCH 080/180] impl wikilink style image embeds There is some additional syntax that looks like [[dog.png|100]] to define extra properties on the resulting image tag, but the event emitter does not have support for these extra tags. May investigate later. --- pulldown-cmark/specs/wikilinks.txt | 26 ++++++++++++++++++++- pulldown-cmark/src/firstpass.rs | 2 +- pulldown-cmark/src/parse.rs | 8 ++++++- pulldown-cmark/tests/suite/wikilinks.rs | 30 ++++++++++++++++++++++++- 4 files changed, 62 insertions(+), 4 deletions(-) diff --git a/pulldown-cmark/specs/wikilinks.txt b/pulldown-cmark/specs/wikilinks.txt index 241f834f..085e3bf3 100644 --- a/pulldown-cmark/specs/wikilinks.txt +++ b/pulldown-cmark/specs/wikilinks.txt @@ -70,7 +70,10 @@ This is a cute dog, linked to the page "WikiLink" [[WikiLink|![dog](dog.png)]] . -

    This is a cute dog, linked to the page "WikiLink"

    dog

    +

    This is a cute dog, linked to the page "WikiLink"

    +

    +dog +

    ```````````````````````````````` With nested wikilinks, the deepest one takes precedence: @@ -114,3 +117,24 @@ This is a [[WikiLink/In/A/Directory|WikiLink]]. .

    This is a WikiLink.

    ```````````````````````````````` + +A similar looking syntax can be used to embed images: + +```````````````````````````````` example_wikilinks +This is a cute dog. + +![[dog.png]] +. +

    This is a cute dog.

    +

    +dog.png +

    +```````````````````````````````` + +In this syntax, the pipe operator serves as a way to define alt text. + +```````````````````````````````` example_wikilinks +![[dog.png|a cute dog]] +. +

    a cute dog

    +```````````````````````````````` diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index da90060a..8f7c9ae4 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -1058,7 +1058,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { b'!' => { if self.options.contains(Options::ENABLE_WIKILINKS) && ix + 2 < bytes_len - && &bytes[ix..ix + 2] == b"[[" + && &bytes[ix + 1..ix + 3] == b"[[" { self.tree.append_text(begin_text, ix, backslash_escaped); backslash_escaped = false; diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 81dc4735..bed77aab 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -435,6 +435,8 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { ItemBody::MaybeWikiLinkClose => { let next_ix = self.break_maybe_wikilink(cur_ix); // find next wikilink + // we still keep track of normal links so we can disable + // parsing later let mut tos = None; while let Some(next_tos) = self.link_stack.pop() { if next_tos.ty == LinkStackTy::Disabled { @@ -514,7 +516,11 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { if let Some(prev_ix) = prev { self.tree[prev_ix].next = None; } - self.tree[tos.node].item.body = ItemBody::Link(link_ix); + if tos.ty == LinkStackTy::Image { + self.tree[tos.node].item.body = ItemBody::Image(link_ix); + } else { + self.tree[tos.node].item.body = ItemBody::Link(link_ix); + } self.tree[tos.node].child = Some(body_node); self.tree[tos.node].next = self.tree[next_ix].next; self.tree[tos.node].item.end = end_ix + 1; diff --git a/pulldown-cmark/tests/suite/wikilinks.rs b/pulldown-cmark/tests/suite/wikilinks.rs index 9d20935d..c6223dc9 100644 --- a/pulldown-cmark/tests/suite/wikilinks.rs +++ b/pulldown-cmark/tests/suite/wikilinks.rs @@ -78,7 +78,10 @@ fn wikilinks_test_7() { [[WikiLink|![dog](dog.png)]] "##; - let expected = r##"

    This is a cute dog, linked to the page "WikiLink"

    dog

    + let expected = r##"

    This is a cute dog, linked to the page "WikiLink"

    +

    +dog +

    "##; test_markdown_html(original, expected, false, false, false, false, true); @@ -133,3 +136,28 @@ fn wikilinks_test_12() { test_markdown_html(original, expected, false, false, false, false, true); } + +#[test] +fn wikilinks_test_13() { + let original = r##"This is a cute dog. + +![[dog.png]] +"##; + let expected = r##"

    This is a cute dog.

    +

    +dog.png +

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} + +#[test] +fn wikilinks_test_14() { + let original = r##"![[dog.png|a cute dog]] +"##; + let expected = r##"

    a cute dog

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} From ad3670ae1074200f958ffc14cb6c6922ad452358 Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Tue, 31 Dec 2024 10:27:32 -0800 Subject: [PATCH 081/180] refactor parsing for less walkbacking --- pulldown-cmark/specs/wikilinks.txt | 8 + pulldown-cmark/src/firstpass.rs | 69 ++---- pulldown-cmark/src/parse.rs | 287 ++++++++++++------------ pulldown-cmark/src/scanners.rs | 4 +- pulldown-cmark/tests/suite/wikilinks.rs | 10 + 5 files changed, 174 insertions(+), 204 deletions(-) diff --git a/pulldown-cmark/specs/wikilinks.txt b/pulldown-cmark/specs/wikilinks.txt index 085e3bf3..cbbbed52 100644 --- a/pulldown-cmark/specs/wikilinks.txt +++ b/pulldown-cmark/specs/wikilinks.txt @@ -138,3 +138,11 @@ In this syntax, the pipe operator serves as a way to define alt text. .

    a cute dog

    ```````````````````````````````` + +Wikilinks can be empty, though this syntax is not particularly useful. + +```````````````````````````````` example_wikilinks +]] [[]] [[|]] [[ +. +

    ]] [[

    +```````````````````````````````` diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 8f7c9ae4..2d4b4946 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -1056,20 +1056,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { LoopInstruction::ContinueAndSkip(0) } b'!' => { - if self.options.contains(Options::ENABLE_WIKILINKS) - && ix + 2 < bytes_len - && &bytes[ix + 1..ix + 3] == b"[[" - { - self.tree.append_text(begin_text, ix, backslash_escaped); - backslash_escaped = false; - self.tree.append(Item { - start: ix, - end: ix + 3, - body: ItemBody::MaybeWikiLinkImage, - }); - begin_text = ix + 3; - LoopInstruction::ContinueAndSkip(2) - } else if ix + 1 < bytes_len && bytes[ix + 1] == b'[' { + if ix + 1 < bytes_len && bytes[ix + 1] == b'[' { self.tree.append_text(begin_text, ix, backslash_escaped); backslash_escaped = false; self.tree.append(Item { @@ -1086,50 +1073,24 @@ impl<'a, 'b> FirstPass<'a, 'b> { b'[' => { self.tree.append_text(begin_text, ix, backslash_escaped); backslash_escaped = false; - if self.options.contains(Options::ENABLE_WIKILINKS) - && ix + 1 < bytes_len - && bytes[ix + 1] == b'[' - { - self.tree.append(Item { - start: ix, - end: ix + 2, - body: ItemBody::MaybeWikiLinkOpen, - }); - begin_text = ix + 2; - LoopInstruction::ContinueAndSkip(1) - } else { - self.tree.append(Item { - start: ix, - end: ix + 1, - body: ItemBody::MaybeLinkOpen, - }); - begin_text = ix + 1; - LoopInstruction::ContinueAndSkip(0) - } + self.tree.append(Item { + start: ix, + end: ix + 1, + body: ItemBody::MaybeLinkOpen, + }); + begin_text = ix + 1; + LoopInstruction::ContinueAndSkip(0) } b']' => { self.tree.append_text(begin_text, ix, backslash_escaped); backslash_escaped = false; - if self.options.contains(Options::ENABLE_WIKILINKS) - && ix + 1 < bytes_len - && bytes[ix + 1] == b']' - { - self.tree.append(Item { - start: ix, - end: ix + 2, - body: ItemBody::MaybeWikiLinkClose, - }); - begin_text = ix + 2; - LoopInstruction::ContinueAndSkip(1) - } else { - self.tree.append(Item { - start: ix, - end: ix + 1, - body: ItemBody::MaybeLinkClose(true), - }); - begin_text = ix + 1; - LoopInstruction::ContinueAndSkip(0) - } + self.tree.append(Item { + start: ix, + end: ix + 1, + body: ItemBody::MaybeLinkClose(true), + }); + begin_text = ix + 1; + LoopInstruction::ContinueAndSkip(0) } b'&' => match scan_entity(&bytes[ix..]) { (n, Some(value)) => { diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index bed77aab..dbd450ee 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -68,9 +68,6 @@ pub(crate) enum ItemBody { // bool indicates whether or not the preceding section could be a reference MaybeLinkClose(bool), MaybeImage, - MaybeWikiLinkOpen, - MaybeWikiLinkClose, - MaybeWikiLinkImage, // These are inline items after resolution. Emphasis, @@ -143,9 +140,6 @@ impl ItemBody { | MaybeLinkOpen | MaybeLinkClose(..) | MaybeImage - | MaybeWikiLinkOpen - | MaybeWikiLinkClose - | MaybeWikiLinkImage ) } fn is_inline(&self) -> bool { @@ -160,9 +154,6 @@ impl ItemBody { | MaybeLinkOpen | MaybeLinkClose(..) | MaybeImage - | MaybeWikiLinkOpen - | MaybeWikiLinkClose - | MaybeWikiLinkImage | Emphasis | Strong | Strikethrough @@ -397,141 +388,147 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { /// links, they must be processed before links are. fn handle_inline_pass2(&mut self) { let mut cur = self.tree.cur(); - let mut prev = None; + let mut memory = NodeMemory::<2>::default(); let block_end = self.tree[self.tree.peek_up().unwrap()].item.end; let block_text = &self.text[..block_end]; while let Some(cur_ix) = cur { + let link_open_doubled = self.tree[cur_ix] + .next + .map(|ix| self.tree[ix].item.body == ItemBody::MaybeLinkOpen) + .unwrap_or(false); + // we peek next node to see if the tokens are doubled, ie a + // possible wikilink, + // it is disturbing this makes assumptions about the relational + // structure of tokens, though this is a relatively sane solution match self.tree[cur_ix].item.body { ItemBody::MaybeLinkOpen => { self.link_stack.push(LinkStackEl { node: cur_ix, ty: LinkStackTy::Link, - wikilink: false, + doubled: link_open_doubled, }); } ItemBody::MaybeImage => { self.link_stack.push(LinkStackEl { node: cur_ix, ty: LinkStackTy::Image, - wikilink: false, - }); - } - ItemBody::MaybeWikiLinkOpen => { - self.link_stack.push(LinkStackEl { - node: cur_ix, - ty: LinkStackTy::Link, - wikilink: true, - }); - } - ItemBody::MaybeWikiLinkImage => { - self.link_stack.push(LinkStackEl { - node: cur_ix, - ty: LinkStackTy::Image, - wikilink: true, + doubled: link_open_doubled, }); } - ItemBody::MaybeWikiLinkClose => { - let next_ix = self.break_maybe_wikilink(cur_ix); - // find next wikilink - // we still keep track of normal links so we can disable - // parsing later - let mut tos = None; - while let Some(next_tos) = self.link_stack.pop() { - if next_tos.ty == LinkStackTy::Disabled { - // Link is totally disabled, so untokenize it for next pass - self.tree[next_tos.node].item.body = ItemBody::Text { - backslash_escaped: false, - }; - } else if next_tos.wikilink { - tos = Some(next_tos); - break; + ItemBody::MaybeLinkClose(..) => { + let Some(prev_ix) = memory.peek(0) else { + // a properly formed wikilink must be made of two + // tokens + memory.push(cur_ix); + cur = self.tree[cur_ix].next; + continue; + }; + if matches!(self.tree[prev_ix].item.body, ItemBody::MaybeLinkClose(..)) { + // find next wikilink + // we still keep track of normal links so we can disable + // parsing later + let mut tos = None; + while let Some(next_tos) = self.link_stack.pop() { + if next_tos.ty == LinkStackTy::Disabled { + // Link is totally disabled, so untokenize it for next pass + self.tree[next_tos.node].item.body = ItemBody::Text { + backslash_escaped: false, + }; + } else if next_tos.doubled { + tos = Some(next_tos); + break; + } } - } - if let Some(tos) = tos { - let inner_node = self.break_maybe_wikilink(tos.node); - let Some(body_node) = self.tree[inner_node].next else { - // skip if no next node exists, like at end of - // input - cur = self.tree[cur_ix].next; - continue; - }; - let start_ix = self.tree[body_node].item.start; - let end_ix = self.tree[cur_ix].item.start; - let wikilink = match scan_wikilink_pipe( - block_text, - start_ix, // bounded by closing tag - end_ix - start_ix, - ) { - Some((rest, wikiname)) => { - // [[WikiName|rest]] - let body_node = scan_nodes_to_ix(&self.tree, Some(body_node), rest); - if let Some(body_node) = body_node { - // break node so passes can actually format - // the display text - self.tree[body_node].item.start = start_ix + rest; + if let Some(tos) = tos { + // fetches the beginning of the wikilink body + let Some(body_node) = + self.tree[tos.node].next.and_then(|ix| self.tree[ix].next) + else { + // skip if no next node exists, like at end of + // input + memory.push(cur_ix); + cur = self.tree[cur_ix].next; + continue; + }; + let start_ix = self.tree[body_node].item.start; + let end_ix = self.tree[prev_ix].item.start; + let wikilink = match scan_wikilink_pipe( + block_text, + start_ix, // bounded by closing tag + end_ix - start_ix, + ) { + Some((rest, wikiname)) => { + // [[WikiName|rest]] + let body_node = + scan_nodes_to_ix(&self.tree, Some(body_node), rest); + if let Some(body_node) = body_node { + // break node so passes can actually format + // the display text + self.tree[body_node].item.start = start_ix + rest; + Some((body_node, wikiname)) + } else { + None + } + } + None => { + // [[WikiName]] + let wikiname = &block_text[start_ix..end_ix]; + // or [[Nested/WikiName]] + let display_ix = wikiname + .as_bytes() + .iter() + .rposition(|b| *b == b'/') + .map(|ix| ix + 1) + .unwrap_or(0) + + start_ix; + let display_end_ix = wikiname + .as_bytes() + .iter() + .position(|b| *b == b'#') + .unwrap_or(wikiname.len()) + + start_ix; + // TODO: wikitext should not be styled, might + // need a more experienced contributor's help + let body_node = self.tree.create_node(Item { + start: display_ix, + end: display_end_ix, + body: ItemBody::Text { + backslash_escaped: false, + }, + }); Some((body_node, wikiname)) - } else { - None } - } - None => { - // [[WikiName]] - let wikiname = &block_text[start_ix..end_ix]; - // or [[Nested/WikiName]] - let display_ix = wikiname - .as_bytes() - .iter() - .rposition(|b| *b == b'/') - .map(|ix| ix + 1) - .unwrap_or(0) - + start_ix; - let display_end_ix = wikiname - .as_bytes() - .iter() - .position(|b| *b == b'#') - .unwrap_or(wikiname.len()) - + start_ix; - // TODO: wikitext should not be styled, might - // need a more experienced contributor's help - let body_node = self.tree.create_node(Item { - start: display_ix, - end: display_end_ix, - body: ItemBody::Text { - backslash_escaped: false, - }, - }); - Some((body_node, wikiname)) - } - }; + }; - if let Some((body_node, wikiname)) = wikilink { - let link_ix = self.allocs.allocate_link( - LinkType::WikiLink, - wikiname.into(), - "".into(), - "".into(), - ); - if let Some(prev_ix) = prev { - self.tree[prev_ix].next = None; - } - if tos.ty == LinkStackTy::Image { - self.tree[tos.node].item.body = ItemBody::Image(link_ix); - } else { - self.tree[tos.node].item.body = ItemBody::Link(link_ix); + if let Some((body_node, wikiname)) = wikilink { + let link_ix = self.allocs.allocate_link( + LinkType::WikiLink, + wikiname.into(), + "".into(), + "".into(), + ); + if let Some(end_ix) = memory.peek(1) { + self.tree[end_ix].next = None; + } + if tos.ty == LinkStackTy::Image { + self.tree[tos.node].item.body = ItemBody::Image(link_ix); + } else { + self.tree[tos.node].item.body = ItemBody::Link(link_ix); + } + self.tree[tos.node].child = Some(body_node); + self.tree[tos.node].next = self.tree[cur_ix].next; + self.tree[tos.node].item.end = end_ix + 1; + self.link_stack.disable_all_links(); } - self.tree[tos.node].child = Some(body_node); - self.tree[tos.node].next = self.tree[next_ix].next; - self.tree[tos.node].item.end = end_ix + 1; - self.link_stack.disable_all_links(); } } } _ => (), } - prev = cur; + memory.push(cur_ix); cur = self.tree[cur_ix].next; } @@ -541,39 +538,10 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { self.tree[tos.node].item.body = ItemBody::Text { backslash_escaped: false, }; - } else if tos.wikilink { - // break wikilink into tokens - self.break_maybe_wikilink(tos.node); } } } - /// Breaks a wikilink token into parts so inline_pass1 can pick up on - /// unresolved tokens. - fn break_maybe_wikilink(&mut self, node: TreeIndex) -> TreeIndex { - self.tree[node].item.end -= 1; - let next_ix = self.tree.create_node(Item { - start: self.tree[node].item.end, - end: self.tree[node].item.end + 1, - body: match self.tree[node].item.body { - ItemBody::MaybeWikiLinkOpen | ItemBody::MaybeWikiLinkImage => { - ItemBody::MaybeLinkOpen - } - ItemBody::MaybeWikiLinkClose => ItemBody::MaybeLinkClose(true), - _ => unreachable!(), - }, - }); - self.tree[node].item.body = match self.tree[node].item.body { - ItemBody::MaybeWikiLinkOpen => ItemBody::MaybeLinkOpen, - ItemBody::MaybeWikiLinkImage => ItemBody::MaybeImage, - ItemBody::MaybeWikiLinkClose => ItemBody::MaybeLinkClose(true), - _ => unreachable!(), - }; - self.tree[next_ix].next = self.tree[node].next; - self.tree[node].next = Some(next_ix); - next_ix - } - /// Handle inline HTML, code spans, and links. /// /// This function handles both inline HTML and code spans, because they have @@ -802,7 +770,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { self.link_stack.push(LinkStackEl { node: cur_ix, ty: LinkStackTy::Link, - wikilink: false, + doubled: false, }); } ItemBody::MaybeImage => { @@ -812,7 +780,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { self.link_stack.push(LinkStackEl { node: cur_ix, ty: LinkStackTy::Image, - wikilink: false, + doubled: false, }); } ItemBody::MaybeLinkClose(could_be_ref) => { @@ -1892,7 +1860,8 @@ impl LinkStack { struct LinkStackEl { node: TreeIndex, ty: LinkStackTy, - wikilink: bool, + // used to indicate wikilinks + doubled: bool, } #[derive(PartialEq, Clone, Debug)] @@ -2203,6 +2172,30 @@ pub(crate) struct HtmlScanGuard { pub comment: usize, } +/// Node memory for traversing a tree. +struct NodeMemory { + memory: [Option; N], +} + +impl NodeMemory { + /// Pushes a processed node to the memory. + pub fn push(&mut self, node: TreeIndex) { + self.memory.rotate_right(1); + self.memory[0] = Some(node); + } + + /// Peeks the nth last node processed, by a zero index. + pub fn peek(&self, idx: usize) -> Option { + self.memory.get(idx).and_then(|inner| *inner) + } +} + +impl Default for NodeMemory { + fn default() -> NodeMemory { + NodeMemory { memory: [None; N] } + } +} + /// Trait for broken link callbacks. /// /// See [Parser::new_with_broken_link_callback]. diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index a5d473a0..30366fa1 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -935,9 +935,7 @@ pub(crate) fn scan_entity(bytes: &[u8]) -> (usize, Option>) { pub(crate) fn scan_wikilink_pipe(data: &str, start_ix: usize, len: usize) -> Option<(usize, &str)> { let bytes = &data.as_bytes()[start_ix..]; - // skip any possibly empty wikilinks - // [[|empty wikilink]] - let mut i = 1; + let mut i = 0; while i < bytes.len() && i < len { if bytes[i] == b'|' { diff --git a/pulldown-cmark/tests/suite/wikilinks.rs b/pulldown-cmark/tests/suite/wikilinks.rs index c6223dc9..3091faaf 100644 --- a/pulldown-cmark/tests/suite/wikilinks.rs +++ b/pulldown-cmark/tests/suite/wikilinks.rs @@ -161,3 +161,13 @@ fn wikilinks_test_14() { test_markdown_html(original, expected, false, false, false, false, true); } + +#[test] +fn wikilinks_test_15() { + let original = r##"]] [[]] [[|]] [[ +"##; + let expected = r##"

    ]] [[

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} From fbaa1c3aa8ab9912428e3975484589b76e786d6f Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Tue, 31 Dec 2024 10:38:52 -0800 Subject: [PATCH 082/180] define behavior for empty wikilinks --- pulldown-cmark/specs/wikilinks.txt | 6 +++--- pulldown-cmark/src/parse.rs | 12 ++++++++++++ pulldown-cmark/tests/suite/wikilinks.rs | 4 ++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/pulldown-cmark/specs/wikilinks.txt b/pulldown-cmark/specs/wikilinks.txt index cbbbed52..2a6c1ca5 100644 --- a/pulldown-cmark/specs/wikilinks.txt +++ b/pulldown-cmark/specs/wikilinks.txt @@ -139,10 +139,10 @@ In this syntax, the pipe operator serves as a way to define alt text.

    a cute dog

    ```````````````````````````````` -Wikilinks can be empty, though this syntax is not particularly useful. +Wikilinks cannot be empty. They will render as-is. ```````````````````````````````` example_wikilinks -]] [[]] [[|]] [[ +]] [[]] [[|]] [[|Symbol]] [[ . -

    ]] [[

    +

    ]] [[]] [[|]] [[|Symbol]] [[

    ```````````````````````````````` diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index dbd450ee..3da7d137 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -460,6 +460,12 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { end_ix - start_ix, ) { Some((rest, wikiname)) => { + // bail early if the wikiname would be empty + if wikiname.is_empty() { + memory.push(cur_ix); + cur = self.tree[cur_ix].next; + continue; + } // [[WikiName|rest]] let body_node = scan_nodes_to_ix(&self.tree, Some(body_node), rest); @@ -489,6 +495,12 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { .position(|b| *b == b'#') .unwrap_or(wikiname.len()) + start_ix; + // bail early if the wikiname would be empty + if display_ix >= display_end_ix { + memory.push(cur_ix); + cur = self.tree[cur_ix].next; + continue; + } // TODO: wikitext should not be styled, might // need a more experienced contributor's help let body_node = self.tree.create_node(Item { diff --git a/pulldown-cmark/tests/suite/wikilinks.rs b/pulldown-cmark/tests/suite/wikilinks.rs index 3091faaf..dcea160d 100644 --- a/pulldown-cmark/tests/suite/wikilinks.rs +++ b/pulldown-cmark/tests/suite/wikilinks.rs @@ -164,9 +164,9 @@ fn wikilinks_test_14() { #[test] fn wikilinks_test_15() { - let original = r##"]] [[]] [[|]] [[ + let original = r##"]] [[]] [[|]] [[|Symbol]] [[ "##; - let expected = r##"

    ]] [[

    + let expected = r##"

    ]] [[]] [[|]] [[|Symbol]] [[

    "##; test_markdown_html(original, expected, false, false, false, false, true); From a141e065a8ab543e18ad47445e0b95a429886471 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Fri, 3 Jan 2025 12:44:33 -0700 Subject: [PATCH 083/180] Use slice patterns for `scan_eol` --- pulldown-cmark/src/scanners.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index d6ef69a3..65333610 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -491,12 +491,11 @@ fn scan_attr_value_chars(data: &[u8]) -> usize { } pub(crate) fn scan_eol(bytes: &[u8]) -> Option { - if bytes.is_empty() { - return Some(0); - } - match bytes[0] { - b'\n' => Some(1), - b'\r' => Some(if bytes.get(1) == Some(&b'\n') { 2 } else { 1 }), + match bytes { + &[] => Some(0), + &[b'\n', ..] => Some(1), + &[b'\r', b'\n', ..] => Some(2), + &[b'\r', ..] => Some(1), _ => None, } } From af39b5b80465d995ad6292a8fb691b3eeceb585a Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Sun, 5 Jan 2025 13:01:24 -0800 Subject: [PATCH 084/180] add tests for interactions with other syntax --- pulldown-cmark/specs/wikilinks.txt | 26 ++++++++++++++++ pulldown-cmark/tests/suite/wikilinks.rs | 40 +++++++++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/pulldown-cmark/specs/wikilinks.txt b/pulldown-cmark/specs/wikilinks.txt index 2a6c1ca5..f923bf92 100644 --- a/pulldown-cmark/specs/wikilinks.txt +++ b/pulldown-cmark/specs/wikilinks.txt @@ -146,3 +146,29 @@ Wikilinks cannot be empty. They will render as-is. .

    ]] [[]] [[|]] [[|Symbol]] [[

    ```````````````````````````````` + +Other interactions wikilinks have with other Markdown syntax: + +```````````````````````````````` example_wikilinks +[inline link]([[url]]) +. +

    inline link

    +```````````````````````````````` + +```````````````````````````````` example_wikilinks +[inline link]([[url)]] +. +

    inline link]]

    +```````````````````````````````` + +```````````````````````````````` example_wikilinks +`[[code]]` +. +

    [[code]]

    +```````````````````````````````` + +```````````````````````````````` example_wikilinks +emphasis **cross [[over** here]] +. +

    emphasis **cross over** here

    +```````````````````````````````` diff --git a/pulldown-cmark/tests/suite/wikilinks.rs b/pulldown-cmark/tests/suite/wikilinks.rs index dcea160d..587c6f82 100644 --- a/pulldown-cmark/tests/suite/wikilinks.rs +++ b/pulldown-cmark/tests/suite/wikilinks.rs @@ -171,3 +171,43 @@ fn wikilinks_test_15() { test_markdown_html(original, expected, false, false, false, false, true); } + +#[test] +fn wikilinks_test_16() { + let original = r##"[inline link]([[url]]) +"##; + let expected = r##"

    inline link

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} + +#[test] +fn wikilinks_test_17() { + let original = r##"[inline link]([[url)]] +"##; + let expected = r##"

    inline link]]

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} + +#[test] +fn wikilinks_test_18() { + let original = r##"`[[code]]` +"##; + let expected = r##"

    [[code]]

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} + +#[test] +fn wikilinks_test_19() { + let original = r##"emphasis **cross [[over** here]] +"##; + let expected = r##"

    emphasis **cross over** here

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} From 9085c7c2444886517b2a59c7e020a7d570583c88 Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Sun, 5 Jan 2025 14:40:08 -0800 Subject: [PATCH 085/180] adjust precedence rules --- pulldown-cmark/specs/wikilinks.txt | 8 +- pulldown-cmark/src/parse.rs | 359 ++++++++++-------------- pulldown-cmark/tests/suite/wikilinks.rs | 6 +- 3 files changed, 159 insertions(+), 214 deletions(-) diff --git a/pulldown-cmark/specs/wikilinks.txt b/pulldown-cmark/specs/wikilinks.txt index f923bf92..105b05ca 100644 --- a/pulldown-cmark/specs/wikilinks.txt +++ b/pulldown-cmark/specs/wikilinks.txt @@ -84,12 +84,12 @@ With nested wikilinks, the deepest one takes precedence:

    [[WikiLink|Fish]]

    ```````````````````````````````` -Links inside wikilinks will not render: +Links inside wikilinks will take precedence: ```````````````````````````````` example_wikilinks [[WikiLink|[cat](cat.html)]] . -

    [cat](cat.html)

    +

    [[WikiLink|cat]]

    ```````````````````````````````` Paths can be qualified in wikilinks while only showing the title of the page. @@ -152,13 +152,13 @@ Other interactions wikilinks have with other Markdown syntax: ```````````````````````````````` example_wikilinks [inline link]([[url]]) . -

    inline link

    +

    inline link

    ```````````````````````````````` ```````````````````````````````` example_wikilinks [inline link]([[url)]] . -

    inline link]]

    +

    inline link]]

    ```````````````````````````````` ```````````````````````````````` example_wikilinks diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 3da7d137..96951b75 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -215,6 +215,7 @@ pub struct Parser<'input, F = DefaultBrokenLinkCallback> { // used by inline passes. store them here for reuse inline_stack: InlineStack, link_stack: LinkStack, + wikilink_stack: LinkStack, code_delims: CodeDelims, math_delims: MathDelims, } @@ -273,6 +274,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { tree.reset(); let inline_stack = Default::default(); let link_stack = Default::default(); + let wikilink_stack = Default::default(); let html_scan_guard = Default::default(); Parser { text, @@ -282,6 +284,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { broken_link_callback, inline_stack, link_stack, + wikilink_stack, html_scan_guard, // always allow 100KiB link_ref_expansion_limit: text.len().max(100_000), @@ -374,186 +377,10 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { /// /// Note: there's some potential for optimization here, but that's future work. fn handle_inline(&mut self) { - // options that require an extra pass - if self.options.contains(Options::ENABLE_WIKILINKS) { - self.handle_inline_pass2(); - } self.handle_inline_pass1(); self.handle_emphasis_and_hard_break(); } - /// Handles wikilinks. - /// - /// Because wikilinks have syntax that interferes with normal Markdown - /// links, they must be processed before links are. - fn handle_inline_pass2(&mut self) { - let mut cur = self.tree.cur(); - let mut memory = NodeMemory::<2>::default(); - - let block_end = self.tree[self.tree.peek_up().unwrap()].item.end; - let block_text = &self.text[..block_end]; - - while let Some(cur_ix) = cur { - let link_open_doubled = self.tree[cur_ix] - .next - .map(|ix| self.tree[ix].item.body == ItemBody::MaybeLinkOpen) - .unwrap_or(false); - // we peek next node to see if the tokens are doubled, ie a - // possible wikilink, - // it is disturbing this makes assumptions about the relational - // structure of tokens, though this is a relatively sane solution - match self.tree[cur_ix].item.body { - ItemBody::MaybeLinkOpen => { - self.link_stack.push(LinkStackEl { - node: cur_ix, - ty: LinkStackTy::Link, - doubled: link_open_doubled, - }); - } - ItemBody::MaybeImage => { - self.link_stack.push(LinkStackEl { - node: cur_ix, - ty: LinkStackTy::Image, - doubled: link_open_doubled, - }); - } - ItemBody::MaybeLinkClose(..) => { - let Some(prev_ix) = memory.peek(0) else { - // a properly formed wikilink must be made of two - // tokens - memory.push(cur_ix); - cur = self.tree[cur_ix].next; - continue; - }; - if matches!(self.tree[prev_ix].item.body, ItemBody::MaybeLinkClose(..)) { - // find next wikilink - // we still keep track of normal links so we can disable - // parsing later - let mut tos = None; - while let Some(next_tos) = self.link_stack.pop() { - if next_tos.ty == LinkStackTy::Disabled { - // Link is totally disabled, so untokenize it for next pass - self.tree[next_tos.node].item.body = ItemBody::Text { - backslash_escaped: false, - }; - } else if next_tos.doubled { - tos = Some(next_tos); - break; - } - } - if let Some(tos) = tos { - // fetches the beginning of the wikilink body - let Some(body_node) = - self.tree[tos.node].next.and_then(|ix| self.tree[ix].next) - else { - // skip if no next node exists, like at end of - // input - memory.push(cur_ix); - cur = self.tree[cur_ix].next; - continue; - }; - let start_ix = self.tree[body_node].item.start; - let end_ix = self.tree[prev_ix].item.start; - let wikilink = match scan_wikilink_pipe( - block_text, - start_ix, // bounded by closing tag - end_ix - start_ix, - ) { - Some((rest, wikiname)) => { - // bail early if the wikiname would be empty - if wikiname.is_empty() { - memory.push(cur_ix); - cur = self.tree[cur_ix].next; - continue; - } - // [[WikiName|rest]] - let body_node = - scan_nodes_to_ix(&self.tree, Some(body_node), rest); - if let Some(body_node) = body_node { - // break node so passes can actually format - // the display text - self.tree[body_node].item.start = start_ix + rest; - Some((body_node, wikiname)) - } else { - None - } - } - None => { - // [[WikiName]] - let wikiname = &block_text[start_ix..end_ix]; - // or [[Nested/WikiName]] - let display_ix = wikiname - .as_bytes() - .iter() - .rposition(|b| *b == b'/') - .map(|ix| ix + 1) - .unwrap_or(0) - + start_ix; - let display_end_ix = wikiname - .as_bytes() - .iter() - .position(|b| *b == b'#') - .unwrap_or(wikiname.len()) - + start_ix; - // bail early if the wikiname would be empty - if display_ix >= display_end_ix { - memory.push(cur_ix); - cur = self.tree[cur_ix].next; - continue; - } - // TODO: wikitext should not be styled, might - // need a more experienced contributor's help - let body_node = self.tree.create_node(Item { - start: display_ix, - end: display_end_ix, - body: ItemBody::Text { - backslash_escaped: false, - }, - }); - Some((body_node, wikiname)) - } - }; - - if let Some((body_node, wikiname)) = wikilink { - let link_ix = self.allocs.allocate_link( - LinkType::WikiLink, - wikiname.into(), - "".into(), - "".into(), - ); - if let Some(end_ix) = memory.peek(1) { - self.tree[end_ix].next = None; - } - if tos.ty == LinkStackTy::Image { - self.tree[tos.node].item.body = ItemBody::Image(link_ix); - } else { - self.tree[tos.node].item.body = ItemBody::Link(link_ix); - } - self.tree[tos.node].child = Some(body_node); - self.tree[tos.node].next = self.tree[cur_ix].next; - self.tree[tos.node].item.end = end_ix + 1; - self.link_stack.disable_all_links(); - } - } - } - } - _ => (), - } - - memory.push(cur_ix); - cur = self.tree[cur_ix].next; - } - - while let Some(tos) = self.link_stack.pop() { - if tos.ty == LinkStackTy::Disabled { - // Link is totally disabled, so untokenize it for next pass - self.tree[tos.node].item.body = ItemBody::Text { - backslash_escaped: false, - }; - } - } - } - /// Handle inline HTML, code spans, and links. /// /// This function handles both inline HTML and code spans, because they have @@ -779,27 +606,59 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { self.tree[cur_ix].item.body = ItemBody::Text { backslash_escaped: false, }; + let link_open_doubled = self.tree[cur_ix] + .next + .map(|ix| self.tree[ix].item.body == ItemBody::MaybeLinkOpen) + .unwrap_or(false); + if self.options.contains(Options::ENABLE_WIKILINKS) && link_open_doubled { + self.wikilink_stack.push(LinkStackEl { + node: cur_ix, + ty: LinkStackTy::Link, + }); + } self.link_stack.push(LinkStackEl { node: cur_ix, ty: LinkStackTy::Link, - doubled: false, }); } ItemBody::MaybeImage => { self.tree[cur_ix].item.body = ItemBody::Text { backslash_escaped: false, }; + let link_open_doubled = self.tree[cur_ix] + .next + .map(|ix| self.tree[ix].item.body == ItemBody::MaybeLinkOpen) + .unwrap_or(false); + if self.options.contains(Options::ENABLE_WIKILINKS) && link_open_doubled { + self.wikilink_stack.push(LinkStackEl { + node: cur_ix, + ty: LinkStackTy::Image, + }); + } self.link_stack.push(LinkStackEl { node: cur_ix, ty: LinkStackTy::Image, - doubled: false, }); } ItemBody::MaybeLinkClose(could_be_ref) => { self.tree[cur_ix].item.body = ItemBody::Text { backslash_escaped: false, }; - if let Some(tos) = self.link_stack.pop() { + let tos_link = self.link_stack.pop(); + if self.options.contains(Options::ENABLE_WIKILINKS) + && self.tree[cur_ix] + .next + .map(|ix| { + matches!(self.tree[ix].item.body, ItemBody::MaybeLinkClose(..)) + }) + .unwrap_or(false) + { + if let Some(node) = self.handle_wikilink(block_text, cur_ix, prev) { + cur = self.tree[node].next; + continue; + } + } + if let Some(tos) = tos_link { // skip rendering if already in a link, unless its an // image if tos.ty != LinkStackTy::Image @@ -840,7 +699,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { } if tos.ty == LinkStackTy::Link { - self.link_stack.disable_all_links(); + self.disable_all_links(); } } else { // ok, so its not an inline link. maybe it is a reference @@ -998,7 +857,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { cur_ix = tos.node; if tos.ty == LinkStackTy::Link { - self.link_stack.disable_all_links(); + self.disable_all_links(); } } } @@ -1019,10 +878,117 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { cur = self.tree[cur_ix].next; } self.link_stack.clear(); + self.wikilink_stack.clear(); self.code_delims.clear(); self.math_delims.clear(); } + /// Handles a wikilink. + /// + /// This function may bail early in case the link is malformed, so this + /// acts as a control flow guard. Returns the link node if a wikilink was + /// found and created. + fn handle_wikilink( + &mut self, + block_text: &'input str, + cur_ix: TreeIndex, + prev: Option, + ) -> Option { + let next_ix = self.tree[cur_ix].next.unwrap(); + // this is a wikilink closing delim, try popping from + // the wikilink stack + if let Some(tos) = self.wikilink_stack.pop() { + if tos.ty == LinkStackTy::Disabled { + return None; + } + // fetches the beginning of the wikilink body + let Some(body_node) = self.tree[tos.node].next.and_then(|ix| self.tree[ix].next) else { + // skip if no next node exists, like at end of input + return None; + }; + let start_ix = self.tree[body_node].item.start; + let end_ix = self.tree[cur_ix].item.start; + let wikilink = match scan_wikilink_pipe( + block_text, + start_ix, // bounded by closing tag + end_ix - start_ix, + ) { + Some((rest, wikiname)) => { + // bail early if the wikiname would be empty + if wikiname.is_empty() { + return None; + } + // [[WikiName|rest]] + let body_node = scan_nodes_to_ix(&self.tree, Some(body_node), rest); + if let Some(body_node) = body_node { + // break node so passes can actually format + // the display text + self.tree[body_node].item.start = start_ix + rest; + Some((body_node, wikiname)) + } else { + None + } + } + None => { + // [[WikiName]] + let wikiname = &block_text[start_ix..end_ix]; + // or [[Nested/WikiName]] + let display_ix = wikiname + .as_bytes() + .iter() + .rposition(|b| *b == b'/') + .map(|ix| ix + 1) + .unwrap_or(0) + + start_ix; + let display_end_ix = wikiname + .as_bytes() + .iter() + .position(|b| *b == b'#') + .unwrap_or(wikiname.len()) + + start_ix; + // bail early if the wikiname would be empty + if display_ix >= display_end_ix { + return None; + } + // TODO: wikitext should not be styled, might + // need a more experienced contributor's help + let body_node = self.tree.create_node(Item { + start: display_ix, + end: display_end_ix, + body: ItemBody::Text { + backslash_escaped: false, + }, + }); + Some((body_node, wikiname)) + } + }; + + if let Some((body_node, wikiname)) = wikilink { + let link_ix = self.allocs.allocate_link( + LinkType::WikiLink, + wikiname.into(), + "".into(), + "".into(), + ); + if let Some(prev_ix) = prev { + self.tree[prev_ix].next = None; + } + if tos.ty == LinkStackTy::Image { + self.tree[tos.node].item.body = ItemBody::Image(link_ix); + } else { + self.tree[tos.node].item.body = ItemBody::Link(link_ix); + } + self.tree[tos.node].child = Some(body_node); + self.tree[tos.node].next = self.tree[next_ix].next; + self.tree[tos.node].item.end = end_ix + 1; + self.disable_all_links(); + return Some(tos.node); + } + } + + None + } + fn handle_emphasis_and_hard_break(&mut self) { let mut prev = None; let mut prev_ix: TreeIndex; @@ -1197,6 +1163,11 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { self.inline_stack.pop_all(&mut self.tree); } + fn disable_all_links(&mut self) { + self.link_stack.disable_all_links(); + self.wikilink_stack.disable_all_links(); + } + /// Returns next byte index, url and title. fn scan_inline_link( &self, @@ -1872,8 +1843,6 @@ impl LinkStack { struct LinkStackEl { node: TreeIndex, ty: LinkStackTy, - // used to indicate wikilinks - doubled: bool, } #[derive(PartialEq, Clone, Debug)] @@ -2184,30 +2153,6 @@ pub(crate) struct HtmlScanGuard { pub comment: usize, } -/// Node memory for traversing a tree. -struct NodeMemory { - memory: [Option; N], -} - -impl NodeMemory { - /// Pushes a processed node to the memory. - pub fn push(&mut self, node: TreeIndex) { - self.memory.rotate_right(1); - self.memory[0] = Some(node); - } - - /// Peeks the nth last node processed, by a zero index. - pub fn peek(&self, idx: usize) -> Option { - self.memory.get(idx).and_then(|inner| *inner) - } -} - -impl Default for NodeMemory { - fn default() -> NodeMemory { - NodeMemory { memory: [None; N] } - } -} - /// Trait for broken link callbacks. /// /// See [Parser::new_with_broken_link_callback]. diff --git a/pulldown-cmark/tests/suite/wikilinks.rs b/pulldown-cmark/tests/suite/wikilinks.rs index 587c6f82..ce4a81cd 100644 --- a/pulldown-cmark/tests/suite/wikilinks.rs +++ b/pulldown-cmark/tests/suite/wikilinks.rs @@ -101,7 +101,7 @@ fn wikilinks_test_8() { fn wikilinks_test_9() { let original = r##"[[WikiLink|[cat](cat.html)]] "##; - let expected = r##"

    [cat](cat.html)

    + let expected = r##"

    [[WikiLink|cat]]

    "##; test_markdown_html(original, expected, false, false, false, false, true); @@ -176,7 +176,7 @@ fn wikilinks_test_15() { fn wikilinks_test_16() { let original = r##"[inline link]([[url]]) "##; - let expected = r##"

    inline link

    + let expected = r##"

    inline link

    "##; test_markdown_html(original, expected, false, false, false, false, true); @@ -186,7 +186,7 @@ fn wikilinks_test_16() { fn wikilinks_test_17() { let original = r##"[inline link]([[url)]] "##; - let expected = r##"

    inline link]]

    + let expected = r##"

    inline link]]

    "##; test_markdown_html(original, expected, false, false, false, false, true); From e2d358eff4d2b4c084371ddf2379a7dd94bcffb4 Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Mon, 6 Jan 2025 10:37:00 -0800 Subject: [PATCH 086/180] discard old TODO --- pulldown-cmark/src/parse.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 96951b75..96770dcb 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -950,8 +950,6 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { if display_ix >= display_end_ix { return None; } - // TODO: wikitext should not be styled, might - // need a more experienced contributor's help let body_node = self.tree.create_node(Item { start: display_ix, end: display_end_ix, From cf7558b4ec17bb8c908997bacb722c40d859d724 Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Mon, 6 Jan 2025 12:42:31 -0800 Subject: [PATCH 087/180] add wikilink autolink syntax and tests --- pulldown-cmark/specs/wikilinks.txt | 12 ++++++ pulldown-cmark/src/parse.rs | 66 +++++++++++++++++++++--------- 2 files changed, 58 insertions(+), 20 deletions(-) diff --git a/pulldown-cmark/specs/wikilinks.txt b/pulldown-cmark/specs/wikilinks.txt index 105b05ca..a2dd4133 100644 --- a/pulldown-cmark/specs/wikilinks.txt +++ b/pulldown-cmark/specs/wikilinks.txt @@ -47,6 +47,18 @@ This is [also [[Ambiguous]]](https://example.com/).

    This is [also Ambiguous](https://example.com/).

    ```````````````````````````````` +Wikilinks, when enabled, may be used as an alternative to the autolink syntax; +\: + +```````````````````````````````` example_wikilinks + + +[[https://example.org/]] +. +

    https://example.org/

    +

    https://example.org/

    +```````````````````````````````` + Wikilinks can have different display text, called piping: ```````````````````````````````` example_wikilinks diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 96770dcb..aeb7f8a2 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -930,34 +930,20 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { } } None => { - // [[WikiName]] - let wikiname = &block_text[start_ix..end_ix]; - // or [[Nested/WikiName]] - let display_ix = wikiname - .as_bytes() - .iter() - .rposition(|b| *b == b'/') - .map(|ix| ix + 1) - .unwrap_or(0) - + start_ix; - let display_end_ix = wikiname - .as_bytes() - .iter() - .position(|b| *b == b'#') - .unwrap_or(wikiname.len()) - + start_ix; + let wikitext = &block_text[start_ix..end_ix]; + let (start_ix, end_ix) = trim_wikitext(block_text, start_ix, end_ix); // bail early if the wikiname would be empty - if display_ix >= display_end_ix { + if start_ix >= end_ix { return None; } let body_node = self.tree.create_node(Item { - start: display_ix, - end: display_end_ix, + start: start_ix, + end: end_ix, body: ItemBody::Text { backslash_escaped: false, }, }); - Some((body_node, wikiname)) + Some((body_node, wikitext)) } }; @@ -1480,6 +1466,46 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { } } +fn trim_wikitext(block_text: &str, start: usize, end: usize) -> (usize, usize) { + let wikitext = &block_text[start..end]; + + // first, check if the link is absolute according to RFC 3986 + if let Some(ix) = wikitext.find("//") { + let scheme = &wikitext[..ix]; + let scheme = scheme.strip_suffix(':').unwrap_or(scheme); + + let valid = scheme + .as_bytes() + .iter() + .enumerate() + .all(|(i, ch)| match ch { + ch if ch.is_ascii_alphabetic() => true, + b'+' if i > 0 => true, + b'-' if i > 0 => true, + b'.' if i > 0 => true, + _ => false, + }); + + if valid { + return (start, end); + } + } + + let inner_start = wikitext + .as_bytes() + .iter() + .rposition(|b| *b == b'/') + .map(|ix| ix + 1) + .unwrap_or(0); + let inner_end = wikitext + .as_bytes() + .iter() + .position(|b| *b == b'#') + .unwrap_or(wikitext.len()); + + (start + inner_start, start + inner_end) +} + /// Returns number of containers scanned. pub(crate) fn scan_containers( tree: &Tree, From feab5f350301d0428f2cb8d8a13a90a3df44e501 Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Mon, 6 Jan 2025 12:50:11 -0800 Subject: [PATCH 088/180] update wikilink example --- guide/src/SUMMARY.md | 2 +- guide/src/examples/normalize-wikilink.md | 5 ++ guide/src/examples/wikilink-prefix.md | 5 -- pulldown-cmark/Cargo.toml | 2 +- pulldown-cmark/examples/normalize-wikilink.rs | 90 +++++++++++++++++++ pulldown-cmark/examples/wikilink-prefix.rs | 40 --------- pulldown-cmark/tests/suite/wikilinks.rs | 41 ++++++--- 7 files changed, 124 insertions(+), 61 deletions(-) create mode 100644 guide/src/examples/normalize-wikilink.md delete mode 100644 guide/src/examples/wikilink-prefix.md create mode 100644 pulldown-cmark/examples/normalize-wikilink.rs delete mode 100644 pulldown-cmark/examples/wikilink-prefix.rs diff --git a/guide/src/SUMMARY.md b/guide/src/SUMMARY.md index acc34e25..472dadfa 100644 --- a/guide/src/SUMMARY.md +++ b/guide/src/SUMMARY.md @@ -10,7 +10,7 @@ - [parser-map-event-print.rs](examples/parser-map-event-print.md) - [parser-map-tag-print.rs](examples/parser-map-tag-print.md) - [string-to-string.rs](examples/string-to-string.md) - - [wikilink-prefix.rs](examples/wikilink-prefix.md) + - [normalize-wikilink.rs](examples/normalize-wikilink.md) --- - [Detailed Specifications](specs.md) diff --git a/guide/src/examples/normalize-wikilink.md b/guide/src/examples/normalize-wikilink.md new file mode 100644 index 00000000..fec4ff99 --- /dev/null +++ b/guide/src/examples/normalize-wikilink.md @@ -0,0 +1,5 @@ +Normalizes wikilinks as they pass through the parser. + +```rust +{{#include ../../../pulldown-cmark/examples/normalize-wikilink.rs}} +``` diff --git a/guide/src/examples/wikilink-prefix.md b/guide/src/examples/wikilink-prefix.md deleted file mode 100644 index dc21fc70..00000000 --- a/guide/src/examples/wikilink-prefix.md +++ /dev/null @@ -1,5 +0,0 @@ -Prefixes all wikilinks in source with a string. - -```rust -{{#include ../../../pulldown-cmark/examples/wikilink-prefix.rs}} -``` diff --git a/pulldown-cmark/Cargo.toml b/pulldown-cmark/Cargo.toml index 24b7b620..9b95a6fc 100644 --- a/pulldown-cmark/Cargo.toml +++ b/pulldown-cmark/Cargo.toml @@ -58,7 +58,7 @@ required-features = ["html"] doc-scrape-examples = true [[example]] -name = "wikilink-prefix" +name = "normalize-wikilink" required-features = ["html"] doc-scrape-examples = true diff --git a/pulldown-cmark/examples/normalize-wikilink.rs b/pulldown-cmark/examples/normalize-wikilink.rs new file mode 100644 index 00000000..f674228a --- /dev/null +++ b/pulldown-cmark/examples/normalize-wikilink.rs @@ -0,0 +1,90 @@ +use pulldown_cmark::{html, CowStr, Event, LinkType, Options, Parser, Tag}; +use regex::RegexBuilder; +use std::io::Write; + +/// This example demonstrates how to normalize the href of a wikilink. The +/// details of this implementation can be tweaked for different use cases. +fn main() { + let markdown_input: &str = r#" +Example provided by [[https://example.org/]]. +Some people might prefer the wikilink syntax for autolinks. + +Wanna go for a [[Wiki Walk]]?"#; + + let parser = Parser::new_ext(markdown_input, Options::ENABLE_WIKILINKS).map(|event| { + if let Event::Start(Tag::Link { + link_type: LinkType::WikiLink, + dest_url, + title, + id, + }) = event + { + let new_link = normalize_wikilink(dest_url); + Event::Start(Tag::Link { + link_type: LinkType::WikiLink, + dest_url: new_link, + title, + id, + }) + } else { + event + } + }); + + // Write to anything implementing the `Write` trait. This could also be a file + // or network socket. + let stdout = std::io::stdout(); + let mut handle = stdout.lock(); + handle.write_all(b"\nHTML output:\n").unwrap(); + html::write_html_io(&mut handle, parser).unwrap(); +} + +/// Performs wikilink normalization. +fn normalize_wikilink(link: CowStr) -> CowStr { + // your wiki is stored at "/wiki" + let prefix: &str = "/wiki"; + if link.is_empty() { + return link; + } + + // check if the link is absolute, if it is, return as is + // according to RFC 3986; https://www.rfc-editor.org/rfc/rfc3986 + let is_absolute = RegexBuilder::new("^(?:[a-z+\\-.]+:)?//") + .case_insensitive(true) + .build() + .expect("valid regex"); + + if is_absolute.is_match(&link) { + return link; + } + + let mut result = String::with_capacity(link.len() + 2); + let mut i = 0; + let mut mark = 0; + let mut in_whitespace = false; + + result.push_str(prefix); + + if !link.starts_with('/') { + result.push('/'); + } + + while i < link.len() { + if !in_whitespace && link.as_bytes()[i].is_ascii_whitespace() { + in_whitespace = true; + result.push_str(&link[mark..i]); + result.push('_'); + } else if in_whitespace && !link.as_bytes()[i].is_ascii_whitespace() { + mark = i; + in_whitespace = false; + } + + i += 1; + } + + result.push_str(&link[mark..]); + if !link.ends_with('/') { + result.push('/'); + } + result.into() +} diff --git a/pulldown-cmark/examples/wikilink-prefix.rs b/pulldown-cmark/examples/wikilink-prefix.rs deleted file mode 100644 index 6d0d6915..00000000 --- a/pulldown-cmark/examples/wikilink-prefix.rs +++ /dev/null @@ -1,40 +0,0 @@ -use pulldown_cmark::{html, Event, LinkType, Options, Parser, Tag}; -use std::io::Write; - -/// This example demonstrates how to prefix wikilinks with a special prefix, to -/// correctly render hrefs. -fn main() { - // your wiki is stored at "/wiki" - let prefix: &str = "/wiki"; - let markdown_input: &str = "Wanna go for a [[Wiki Walk]]?"; - - let parser = Parser::new_ext(markdown_input, Options::ENABLE_WIKILINKS).map(|event| { - if let Event::Start(Tag::Link { - link_type: LinkType::WikiLink, - dest_url, - title, - id, - }) = event - { - // prefix wikilink - let mut new_link = String::with_capacity(prefix.len() + dest_url.len()); - new_link.push_str(prefix); - new_link.push_str(&dest_url); - Event::Start(Tag::Link { - link_type: LinkType::WikiLink, - dest_url: new_link.into(), - title, - id, - }) - } else { - event - } - }); - - // Write to anything implementing the `Write` trait. This could also be a file - // or network socket. - let stdout = std::io::stdout(); - let mut handle = stdout.lock(); - handle.write_all(b"\nHTML output:\n").unwrap(); - html::write_html_io(&mut handle, parser).unwrap(); -} diff --git a/pulldown-cmark/tests/suite/wikilinks.rs b/pulldown-cmark/tests/suite/wikilinks.rs index ce4a81cd..97cab87e 100644 --- a/pulldown-cmark/tests/suite/wikilinks.rs +++ b/pulldown-cmark/tests/suite/wikilinks.rs @@ -54,6 +54,19 @@ fn wikilinks_test_4() { #[test] fn wikilinks_test_5() { + let original = r##" + +[[https://example.org/]] +"##; + let expected = r##"

    https://example.org/

    +

    https://example.org/

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} + +#[test] +fn wikilinks_test_6() { let original = r##"This is [[WikiLink|a pothole]]. "##; let expected = r##"

    This is a pothole.

    @@ -63,7 +76,7 @@ fn wikilinks_test_5() { } #[test] -fn wikilinks_test_6() { +fn wikilinks_test_7() { let original = r##"This is [[WikiLink|a **strong** pothole]]. "##; let expected = r##"

    This is a strong pothole.

    @@ -73,7 +86,7 @@ fn wikilinks_test_6() { } #[test] -fn wikilinks_test_7() { +fn wikilinks_test_8() { let original = r##"This is a cute dog, linked to the page "WikiLink" [[WikiLink|![dog](dog.png)]] @@ -88,7 +101,7 @@ fn wikilinks_test_7() { } #[test] -fn wikilinks_test_8() { +fn wikilinks_test_9() { let original = r##"[[WikiLink|[[Fish]]]] "##; let expected = r##"

    [[WikiLink|Fish]]

    @@ -98,7 +111,7 @@ fn wikilinks_test_8() { } #[test] -fn wikilinks_test_9() { +fn wikilinks_test_10() { let original = r##"[[WikiLink|[cat](cat.html)]] "##; let expected = r##"

    [[WikiLink|cat]]

    @@ -108,7 +121,7 @@ fn wikilinks_test_9() { } #[test] -fn wikilinks_test_10() { +fn wikilinks_test_11() { let original = r##"This is a [[WikiLink/In/A/Directory]]. "##; let expected = r##"

    This is a Directory.

    @@ -118,7 +131,7 @@ fn wikilinks_test_10() { } #[test] -fn wikilinks_test_11() { +fn wikilinks_test_12() { let original = r##"This is a [[Wonderful/WikiLink#Secret]]. "##; let expected = r##"

    This is a WikiLink.

    @@ -128,7 +141,7 @@ fn wikilinks_test_11() { } #[test] -fn wikilinks_test_12() { +fn wikilinks_test_13() { let original = r##"This is a [[WikiLink/In/A/Directory|WikiLink]]. "##; let expected = r##"

    This is a WikiLink.

    @@ -138,7 +151,7 @@ fn wikilinks_test_12() { } #[test] -fn wikilinks_test_13() { +fn wikilinks_test_14() { let original = r##"This is a cute dog. ![[dog.png]] @@ -153,7 +166,7 @@ fn wikilinks_test_13() { } #[test] -fn wikilinks_test_14() { +fn wikilinks_test_15() { let original = r##"![[dog.png|a cute dog]] "##; let expected = r##"

    a cute dog

    @@ -163,7 +176,7 @@ fn wikilinks_test_14() { } #[test] -fn wikilinks_test_15() { +fn wikilinks_test_16() { let original = r##"]] [[]] [[|]] [[|Symbol]] [[ "##; let expected = r##"

    ]] [[]] [[|]] [[|Symbol]] [[

    @@ -173,7 +186,7 @@ fn wikilinks_test_15() { } #[test] -fn wikilinks_test_16() { +fn wikilinks_test_17() { let original = r##"[inline link]([[url]]) "##; let expected = r##"

    inline link

    @@ -183,7 +196,7 @@ fn wikilinks_test_16() { } #[test] -fn wikilinks_test_17() { +fn wikilinks_test_18() { let original = r##"[inline link]([[url)]] "##; let expected = r##"

    inline link]]

    @@ -193,7 +206,7 @@ fn wikilinks_test_17() { } #[test] -fn wikilinks_test_18() { +fn wikilinks_test_19() { let original = r##"`[[code]]` "##; let expected = r##"

    [[code]]

    @@ -203,7 +216,7 @@ fn wikilinks_test_18() { } #[test] -fn wikilinks_test_19() { +fn wikilinks_test_20() { let original = r##"emphasis **cross [[over** here]] "##; let expected = r##"

    emphasis **cross over** here

    From 10a31111d1e61047f18c5a4ac6cacb0c2aff4758 Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Mon, 6 Jan 2025 13:50:35 -0800 Subject: [PATCH 089/180] fix absolute URI detection --- pulldown-cmark/examples/normalize-wikilink.rs | 2 +- pulldown-cmark/src/parse.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pulldown-cmark/examples/normalize-wikilink.rs b/pulldown-cmark/examples/normalize-wikilink.rs index f674228a..73292a4c 100644 --- a/pulldown-cmark/examples/normalize-wikilink.rs +++ b/pulldown-cmark/examples/normalize-wikilink.rs @@ -49,7 +49,7 @@ fn normalize_wikilink(link: CowStr) -> CowStr { // check if the link is absolute, if it is, return as is // according to RFC 3986; https://www.rfc-editor.org/rfc/rfc3986 - let is_absolute = RegexBuilder::new("^(?:[a-z+\\-.]+:)?//") + let is_absolute = RegexBuilder::new("^(?:[a-z][a-z0-9+-.]*:)?//") .case_insensitive(true) .build() .expect("valid regex"); diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index aeb7f8a2..b72d483f 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -1480,6 +1480,7 @@ fn trim_wikitext(block_text: &str, start: usize, end: usize) -> (usize, usize) { .enumerate() .all(|(i, ch)| match ch { ch if ch.is_ascii_alphabetic() => true, + ch if ch.is_ascii_digit() && i > 0 => true, b'+' if i > 0 => true, b'-' if i > 0 => true, b'.' if i > 0 => true, From 82ade0ee5ea23e0e4c78b62bd2da58da502a55a9 Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Mon, 6 Jan 2025 13:52:46 -0800 Subject: [PATCH 090/180] escape dash in example regex --- pulldown-cmark/examples/normalize-wikilink.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pulldown-cmark/examples/normalize-wikilink.rs b/pulldown-cmark/examples/normalize-wikilink.rs index 73292a4c..21f0143f 100644 --- a/pulldown-cmark/examples/normalize-wikilink.rs +++ b/pulldown-cmark/examples/normalize-wikilink.rs @@ -49,7 +49,7 @@ fn normalize_wikilink(link: CowStr) -> CowStr { // check if the link is absolute, if it is, return as is // according to RFC 3986; https://www.rfc-editor.org/rfc/rfc3986 - let is_absolute = RegexBuilder::new("^(?:[a-z][a-z0-9+-.]*:)?//") + let is_absolute = RegexBuilder::new("^(?:[a-z][a-z0-9+\\-.]*:)?//") .case_insensitive(true) .build() .expect("valid regex"); From 21a1daf69d8145da202ab2966257ebb1d29d69f4 Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Wed, 8 Jan 2025 08:51:50 -0800 Subject: [PATCH 091/180] fix behavior when links end in spaces in example --- pulldown-cmark/examples/normalize-wikilink.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pulldown-cmark/examples/normalize-wikilink.rs b/pulldown-cmark/examples/normalize-wikilink.rs index 21f0143f..acd7c376 100644 --- a/pulldown-cmark/examples/normalize-wikilink.rs +++ b/pulldown-cmark/examples/normalize-wikilink.rs @@ -73,8 +73,8 @@ fn normalize_wikilink(link: CowStr) -> CowStr { if !in_whitespace && link.as_bytes()[i].is_ascii_whitespace() { in_whitespace = true; result.push_str(&link[mark..i]); - result.push('_'); } else if in_whitespace && !link.as_bytes()[i].is_ascii_whitespace() { + result.push('_'); mark = i; in_whitespace = false; } @@ -82,8 +82,10 @@ fn normalize_wikilink(link: CowStr) -> CowStr { i += 1; } - result.push_str(&link[mark..]); - if !link.ends_with('/') { + if !in_whitespace { + result.push_str(&link[mark..]); + } + if !result.ends_with('/') { result.push('/'); } result.into() From cc8dea9cb41e973d3bd51036de58d284d78ab14e Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Wed, 8 Jan 2025 09:13:38 -0800 Subject: [PATCH 092/180] rework trim wikitext functionality --- pulldown-cmark/specs/wikilinks.txt | 10 ++++ pulldown-cmark/src/parse.rs | 78 +++++++++++++++---------- pulldown-cmark/tests/suite/wikilinks.rs | 24 +++++--- 3 files changed, 74 insertions(+), 38 deletions(-) diff --git a/pulldown-cmark/specs/wikilinks.txt b/pulldown-cmark/specs/wikilinks.txt index a2dd4133..387a41da 100644 --- a/pulldown-cmark/specs/wikilinks.txt +++ b/pulldown-cmark/specs/wikilinks.txt @@ -122,6 +122,16 @@ This is a [[Wonderful/WikiLink#Secret]].

    This is a WikiLink.

    ```````````````````````````````` +If the URL fragment makes up the entire link, that is to say if it is a link to +a heading is in the same document, only the text after the pound symbol will +display. + +```````````````````````````````` example_wikilinks +This is a [[#Pepperoni Secret]]. +. +

    This is a Pepperoni Secret.

    +```````````````````````````````` + Of course, the pipe operator can still be used: ```````````````````````````````` example_wikilinks diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index b72d483f..1e80cb59 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -1467,44 +1467,60 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { } fn trim_wikitext(block_text: &str, start: usize, end: usize) -> (usize, usize) { - let wikitext = &block_text[start..end]; - - // first, check if the link is absolute according to RFC 3986 - if let Some(ix) = wikitext.find("//") { - let scheme = &wikitext[..ix]; - let scheme = scheme.strip_suffix(':').unwrap_or(scheme); + let mut i = start; + let mut maybe_absolute = true; + + let mut trimmed_start = start; + + while i < end { + // NOTE: this should not panic as while i < end gaurantees some sort of + // data + let ch = block_text[i..end].chars().next().unwrap(); + + if maybe_absolute { + match block_text.as_bytes()[i..end] { + [b'/', b'/', ..] | [b':', b'/', b'/', ..] => { + // [[https://example.org/]] + // this is an absolute url, return as-is + return (start, end); + } + _ => (), + } - let valid = scheme - .as_bytes() - .iter() - .enumerate() - .all(|(i, ch)| match ch { + // check if this is a valid URI char + maybe_absolute &= match ch { ch if ch.is_ascii_alphabetic() => true, - ch if ch.is_ascii_digit() && i > 0 => true, - b'+' if i > 0 => true, - b'-' if i > 0 => true, - b'.' if i > 0 => true, + ch if ch.is_ascii_digit() && i > start => true, + '+' if i > start => true, + '-' if i > start => true, + '.' if i > start => true, _ => false, - }); + }; + } - if valid { - return (start, end); + match ch { + '#' => { + if i > start { + // [[Wikilink/Start#Heading]] + return (trimmed_start, i); + } else { + // [[#Heading]] + // this is a heading, trim it and return + return (start + 1, end); + } + } + '/' => { + if i > start && i + 1 < end { + trimmed_start = i + 1; + } + } + _ => (), } - } - let inner_start = wikitext - .as_bytes() - .iter() - .rposition(|b| *b == b'/') - .map(|ix| ix + 1) - .unwrap_or(0); - let inner_end = wikitext - .as_bytes() - .iter() - .position(|b| *b == b'#') - .unwrap_or(wikitext.len()); + i += ch.len_utf8(); + } - (start + inner_start, start + inner_end) + (trimmed_start, end) } /// Returns number of containers scanned. diff --git a/pulldown-cmark/tests/suite/wikilinks.rs b/pulldown-cmark/tests/suite/wikilinks.rs index 97cab87e..d20297e4 100644 --- a/pulldown-cmark/tests/suite/wikilinks.rs +++ b/pulldown-cmark/tests/suite/wikilinks.rs @@ -142,6 +142,16 @@ fn wikilinks_test_12() { #[test] fn wikilinks_test_13() { + let original = r##"This is a [[#Pepperoni Secret]]. +"##; + let expected = r##"

    This is a Pepperoni Secret.

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} + +#[test] +fn wikilinks_test_14() { let original = r##"This is a [[WikiLink/In/A/Directory|WikiLink]]. "##; let expected = r##"

    This is a WikiLink.

    @@ -151,7 +161,7 @@ fn wikilinks_test_13() { } #[test] -fn wikilinks_test_14() { +fn wikilinks_test_15() { let original = r##"This is a cute dog. ![[dog.png]] @@ -166,7 +176,7 @@ fn wikilinks_test_14() { } #[test] -fn wikilinks_test_15() { +fn wikilinks_test_16() { let original = r##"![[dog.png|a cute dog]] "##; let expected = r##"

    a cute dog

    @@ -176,7 +186,7 @@ fn wikilinks_test_15() { } #[test] -fn wikilinks_test_16() { +fn wikilinks_test_17() { let original = r##"]] [[]] [[|]] [[|Symbol]] [[ "##; let expected = r##"

    ]] [[]] [[|]] [[|Symbol]] [[

    @@ -186,7 +196,7 @@ fn wikilinks_test_16() { } #[test] -fn wikilinks_test_17() { +fn wikilinks_test_18() { let original = r##"[inline link]([[url]]) "##; let expected = r##"

    inline link

    @@ -196,7 +206,7 @@ fn wikilinks_test_17() { } #[test] -fn wikilinks_test_18() { +fn wikilinks_test_19() { let original = r##"[inline link]([[url)]] "##; let expected = r##"

    inline link]]

    @@ -206,7 +216,7 @@ fn wikilinks_test_18() { } #[test] -fn wikilinks_test_19() { +fn wikilinks_test_20() { let original = r##"`[[code]]` "##; let expected = r##"

    [[code]]

    @@ -216,7 +226,7 @@ fn wikilinks_test_19() { } #[test] -fn wikilinks_test_20() { +fn wikilinks_test_21() { let original = r##"emphasis **cross [[over** here]] "##; let expected = r##"

    emphasis **cross over** here

    From 2d4f08265f281b862d1bfc7768eed166e3605b90 Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Wed, 8 Jan 2025 09:18:41 -0800 Subject: [PATCH 093/180] add CLI arguments for wikilinks --- pulldown-cmark/src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pulldown-cmark/src/main.rs b/pulldown-cmark/src/main.rs index d93895fe..1757e777 100644 --- a/pulldown-cmark/src/main.rs +++ b/pulldown-cmark/src/main.rs @@ -105,6 +105,7 @@ pub fn main() -> std::io::Result<()> { "enable-definition-list", "enable Commonmark-HS-Extensions compatible definition lists", ); + opts.optflag("W", "enable-wikilinks", "enable wikilinks"); let matches = match opts.parse(&args[1..]) { Ok(m) => m, @@ -158,6 +159,9 @@ pub fn main() -> std::io::Result<()> { if matches.opt_present("enable-definition-list") { opts.insert(Options::ENABLE_DEFINITION_LIST); } + if matches.opt_present("enable-wikilinks") { + opts.insert(Options::ENABLE_WIKILINKS); + } let mut input = String::new(); let mut broken_links = vec![]; From 08801f54686423c74fb27c0afb71588a01f12d34 Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Wed, 8 Jan 2025 12:00:55 -0800 Subject: [PATCH 094/180] remove wikilink trimming --- pulldown-cmark/examples/normalize-wikilink.rs | 4 +- pulldown-cmark/specs/wikilinks.txt | 48 +++------ pulldown-cmark/src/lib.rs | 8 +- pulldown-cmark/src/parse.rs | 100 ++++++------------ pulldown-cmark/tests/suite/wikilinks.rs | 88 ++++++--------- 5 files changed, 90 insertions(+), 158 deletions(-) diff --git a/pulldown-cmark/examples/normalize-wikilink.rs b/pulldown-cmark/examples/normalize-wikilink.rs index acd7c376..bdac8bf2 100644 --- a/pulldown-cmark/examples/normalize-wikilink.rs +++ b/pulldown-cmark/examples/normalize-wikilink.rs @@ -13,7 +13,7 @@ Wanna go for a [[Wiki Walk]]?"#; let parser = Parser::new_ext(markdown_input, Options::ENABLE_WIKILINKS).map(|event| { if let Event::Start(Tag::Link { - link_type: LinkType::WikiLink, + link_type: LinkType::WikiLink { has_pothole }, dest_url, title, id, @@ -21,7 +21,7 @@ Wanna go for a [[Wiki Walk]]?"#; { let new_link = normalize_wikilink(dest_url); Event::Start(Tag::Link { - link_type: LinkType::WikiLink, + link_type: LinkType::WikiLink { has_pothole }, dest_url: new_link, title, id, diff --git a/pulldown-cmark/specs/wikilinks.txt b/pulldown-cmark/specs/wikilinks.txt index 387a41da..cd1b91a1 100644 --- a/pulldown-cmark/specs/wikilinks.txt +++ b/pulldown-cmark/specs/wikilinks.txt @@ -14,6 +14,12 @@ This is a [[WikiLink]].

    This is a WikiLink.

    ```````````````````````````````` +```````````````````````````````` example_wikilinks +This is a [[Main/WikiLink]]. +. +

    This is a Main/WikiLink.

    +```````````````````````````````` + Wikilinks take precedence over reference links: ```````````````````````````````` example_wikilinks @@ -67,6 +73,12 @@ This is [[WikiLink|a pothole]].

    This is a pothole.

    ```````````````````````````````` +```````````````````````````````` example_wikilinks +This is a [[WikiLink/In/A/Directory|WikiLink]]. +. +

    This is a WikiLink.

    +```````````````````````````````` + Using this syntax, it is possible to show more Markdown in the text: ```````````````````````````````` example_wikilinks @@ -104,42 +116,6 @@ Links inside wikilinks will take precedence:

    [[WikiLink|cat]]

    ```````````````````````````````` -Paths can be qualified in wikilinks while only showing the title of the page. -This is useful for wikis that support a "directory-like" system. - -```````````````````````````````` example_wikilinks -This is a [[WikiLink/In/A/Directory]]. -. -

    This is a Directory.

    -```````````````````````````````` - -This functionality will also trim any URL fragments (#Heading) in the display -text. - -```````````````````````````````` example_wikilinks -This is a [[Wonderful/WikiLink#Secret]]. -. -

    This is a WikiLink.

    -```````````````````````````````` - -If the URL fragment makes up the entire link, that is to say if it is a link to -a heading is in the same document, only the text after the pound symbol will -display. - -```````````````````````````````` example_wikilinks -This is a [[#Pepperoni Secret]]. -. -

    This is a Pepperoni Secret.

    -```````````````````````````````` - -Of course, the pipe operator can still be used: - -```````````````````````````````` example_wikilinks -This is a [[WikiLink/In/A/Directory|WikiLink]]. -. -

    This is a WikiLink.

    -```````````````````````````````` - A similar looking syntax can be used to embed images: ```````````````````````````````` example_wikilinks diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index 94d61394..51224fc9 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -435,7 +435,13 @@ pub enum LinkType { /// Email address in autolink like `` Email, /// Wikilink link like `[[foo]]` or `[[foo|bar]]` - WikiLink, + WikiLink { + /// `true` if the wikilink was piped. + /// + /// * `true` - `[[foo|bar]]` + /// * `false` - `[[foo]]` + has_pothole: bool, + }, } impl LinkType { diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 1e80cb59..1a55c956 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -913,9 +913,9 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { start_ix, // bounded by closing tag end_ix - start_ix, ) { - Some((rest, wikiname)) => { + Some((rest, wikitext)) => { // bail early if the wikiname would be empty - if wikiname.is_empty() { + if wikitext.is_empty() { return None; } // [[WikiName|rest]] @@ -924,16 +924,15 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { // break node so passes can actually format // the display text self.tree[body_node].item.start = start_ix + rest; - Some((body_node, wikiname)) + Some((true, body_node, wikitext)) } else { None } } None => { let wikitext = &block_text[start_ix..end_ix]; - let (start_ix, end_ix) = trim_wikitext(block_text, start_ix, end_ix); // bail early if the wikiname would be empty - if start_ix >= end_ix { + if wikitext.is_empty() { return None; } let body_node = self.tree.create_node(Item { @@ -943,13 +942,13 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { backslash_escaped: false, }, }); - Some((body_node, wikitext)) + Some((false, body_node, wikitext)) } }; - if let Some((body_node, wikiname)) = wikilink { + if let Some((has_pothole, body_node, wikiname)) = wikilink { let link_ix = self.allocs.allocate_link( - LinkType::WikiLink, + LinkType::WikiLink { has_pothole }, wikiname.into(), "".into(), "".into(), @@ -1466,63 +1465,6 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { } } -fn trim_wikitext(block_text: &str, start: usize, end: usize) -> (usize, usize) { - let mut i = start; - let mut maybe_absolute = true; - - let mut trimmed_start = start; - - while i < end { - // NOTE: this should not panic as while i < end gaurantees some sort of - // data - let ch = block_text[i..end].chars().next().unwrap(); - - if maybe_absolute { - match block_text.as_bytes()[i..end] { - [b'/', b'/', ..] | [b':', b'/', b'/', ..] => { - // [[https://example.org/]] - // this is an absolute url, return as-is - return (start, end); - } - _ => (), - } - - // check if this is a valid URI char - maybe_absolute &= match ch { - ch if ch.is_ascii_alphabetic() => true, - ch if ch.is_ascii_digit() && i > start => true, - '+' if i > start => true, - '-' if i > start => true, - '.' if i > start => true, - _ => false, - }; - } - - match ch { - '#' => { - if i > start { - // [[Wikilink/Start#Heading]] - return (trimmed_start, i); - } else { - // [[#Heading]] - // this is a heading, trim it and return - return (start + 1, end); - } - } - '/' => { - if i > start && i + 1 < end { - trimmed_start = i + 1; - } - } - _ => (), - } - - i += ch.len_utf8(); - } - - (trimmed_start, end) -} - /// Returns number of containers scanned. pub(crate) fn scan_containers( tree: &Tree, @@ -2895,4 +2837,32 @@ text ]; assert_eq!(&events, &expected); } + + #[test] + fn wikilink_has_pothole() { + let input = "[[foo]] [[bar|baz]]"; + let events: Vec<_> = Parser::new_ext(input, Options::ENABLE_WIKILINKS).collect(); + let expected = [ + Event::Start(Tag::Paragraph), + Event::Start(Tag::Link { + link_type: LinkType::WikiLink { has_pothole: false }, + dest_url: CowStr::Borrowed("foo"), + title: CowStr::Borrowed(""), + id: CowStr::Borrowed(""), + }), + Event::Text(CowStr::Borrowed("foo")), + Event::End(TagEnd::Link), + Event::Text(CowStr::Borrowed(" ")), + Event::Start(Tag::Link { + link_type: LinkType::WikiLink { has_pothole: true }, + dest_url: CowStr::Borrowed("bar"), + title: CowStr::Borrowed(""), + id: CowStr::Borrowed(""), + }), + Event::Text(CowStr::Borrowed("baz")), + Event::End(TagEnd::Link), + Event::End(TagEnd::Paragraph), + ]; + assert_eq!(&events, &expected); + } } diff --git a/pulldown-cmark/tests/suite/wikilinks.rs b/pulldown-cmark/tests/suite/wikilinks.rs index d20297e4..4ddb083a 100644 --- a/pulldown-cmark/tests/suite/wikilinks.rs +++ b/pulldown-cmark/tests/suite/wikilinks.rs @@ -15,6 +15,16 @@ fn wikilinks_test_1() { #[test] fn wikilinks_test_2() { + let original = r##"This is a [[Main/WikiLink]]. +"##; + let expected = r##"

    This is a Main/WikiLink.

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} + +#[test] +fn wikilinks_test_3() { let original = r##"This is [[Ambiguous]]. [Ambiguous]: https://example.com/ @@ -26,7 +36,7 @@ fn wikilinks_test_2() { } #[test] -fn wikilinks_test_3() { +fn wikilinks_test_4() { let original = r##"[[squid] calamari is considered a delicacy](https://en.wikipedia.org/wiki/Squid) [calamari [squid]](https://en.wikipedia.org/wiki/Squid) @@ -43,7 +53,7 @@ fn wikilinks_test_3() { } #[test] -fn wikilinks_test_4() { +fn wikilinks_test_5() { let original = r##"This is [also [[Ambiguous]]](https://example.com/). "##; let expected = r##"

    This is [also Ambiguous](https://example.com/).

    @@ -53,7 +63,7 @@ fn wikilinks_test_4() { } #[test] -fn wikilinks_test_5() { +fn wikilinks_test_6() { let original = r##" [[https://example.org/]] @@ -66,7 +76,7 @@ fn wikilinks_test_5() { } #[test] -fn wikilinks_test_6() { +fn wikilinks_test_7() { let original = r##"This is [[WikiLink|a pothole]]. "##; let expected = r##"

    This is a pothole.

    @@ -76,7 +86,17 @@ fn wikilinks_test_6() { } #[test] -fn wikilinks_test_7() { +fn wikilinks_test_8() { + let original = r##"This is a [[WikiLink/In/A/Directory|WikiLink]]. +"##; + let expected = r##"

    This is a WikiLink.

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} + +#[test] +fn wikilinks_test_9() { let original = r##"This is [[WikiLink|a **strong** pothole]]. "##; let expected = r##"

    This is a strong pothole.

    @@ -86,7 +106,7 @@ fn wikilinks_test_7() { } #[test] -fn wikilinks_test_8() { +fn wikilinks_test_10() { let original = r##"This is a cute dog, linked to the page "WikiLink" [[WikiLink|![dog](dog.png)]] @@ -101,7 +121,7 @@ fn wikilinks_test_8() { } #[test] -fn wikilinks_test_9() { +fn wikilinks_test_11() { let original = r##"[[WikiLink|[[Fish]]]] "##; let expected = r##"

    [[WikiLink|Fish]]

    @@ -111,7 +131,7 @@ fn wikilinks_test_9() { } #[test] -fn wikilinks_test_10() { +fn wikilinks_test_12() { let original = r##"[[WikiLink|[cat](cat.html)]] "##; let expected = r##"

    [[WikiLink|cat]]

    @@ -120,48 +140,8 @@ fn wikilinks_test_10() { test_markdown_html(original, expected, false, false, false, false, true); } -#[test] -fn wikilinks_test_11() { - let original = r##"This is a [[WikiLink/In/A/Directory]]. -"##; - let expected = r##"

    This is a Directory.

    -"##; - - test_markdown_html(original, expected, false, false, false, false, true); -} - -#[test] -fn wikilinks_test_12() { - let original = r##"This is a [[Wonderful/WikiLink#Secret]]. -"##; - let expected = r##"

    This is a WikiLink.

    -"##; - - test_markdown_html(original, expected, false, false, false, false, true); -} - #[test] fn wikilinks_test_13() { - let original = r##"This is a [[#Pepperoni Secret]]. -"##; - let expected = r##"

    This is a Pepperoni Secret.

    -"##; - - test_markdown_html(original, expected, false, false, false, false, true); -} - -#[test] -fn wikilinks_test_14() { - let original = r##"This is a [[WikiLink/In/A/Directory|WikiLink]]. -"##; - let expected = r##"

    This is a WikiLink.

    -"##; - - test_markdown_html(original, expected, false, false, false, false, true); -} - -#[test] -fn wikilinks_test_15() { let original = r##"This is a cute dog. ![[dog.png]] @@ -176,7 +156,7 @@ fn wikilinks_test_15() { } #[test] -fn wikilinks_test_16() { +fn wikilinks_test_14() { let original = r##"![[dog.png|a cute dog]] "##; let expected = r##"

    a cute dog

    @@ -186,7 +166,7 @@ fn wikilinks_test_16() { } #[test] -fn wikilinks_test_17() { +fn wikilinks_test_15() { let original = r##"]] [[]] [[|]] [[|Symbol]] [[ "##; let expected = r##"

    ]] [[]] [[|]] [[|Symbol]] [[

    @@ -196,7 +176,7 @@ fn wikilinks_test_17() { } #[test] -fn wikilinks_test_18() { +fn wikilinks_test_16() { let original = r##"[inline link]([[url]]) "##; let expected = r##"

    inline link

    @@ -206,7 +186,7 @@ fn wikilinks_test_18() { } #[test] -fn wikilinks_test_19() { +fn wikilinks_test_17() { let original = r##"[inline link]([[url)]] "##; let expected = r##"

    inline link]]

    @@ -216,7 +196,7 @@ fn wikilinks_test_19() { } #[test] -fn wikilinks_test_20() { +fn wikilinks_test_18() { let original = r##"`[[code]]` "##; let expected = r##"

    [[code]]

    @@ -226,7 +206,7 @@ fn wikilinks_test_20() { } #[test] -fn wikilinks_test_21() { +fn wikilinks_test_19() { let original = r##"emphasis **cross [[over** here]] "##; let expected = r##"

    emphasis **cross over** here

    From cac0e518f82486e55d2f57c4befb67667820dd56 Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Wed, 8 Jan 2025 19:18:04 -0800 Subject: [PATCH 095/180] define behavior for backslashes preceding pipes --- pulldown-cmark/specs/wikilinks.txt | 64 +++++++++++++++++++++++-- pulldown-cmark/tests/suite/wikilinks.rs | 20 ++++++++ 2 files changed, 80 insertions(+), 4 deletions(-) diff --git a/pulldown-cmark/specs/wikilinks.txt b/pulldown-cmark/specs/wikilinks.txt index cd1b91a1..686a1b85 100644 --- a/pulldown-cmark/specs/wikilinks.txt +++ b/pulldown-cmark/specs/wikilinks.txt @@ -3,10 +3,11 @@ Run this with `cargo test --features gen-tests suite::wikilinks` # Wikilinks Shorthand link definitions for use in Markdown-based wikis. Syntax and design choices inspired heavily by -[Python Markdown WikiLinks](https://python-markdown.github.io/extensions/wikilinks/). +[Obsidian](https://obsidian.md/) and +[commonmark-hs](https://github.com/jgm/commonmark-hs). -A wikilink works very similarly to a normal link. In fact, it might as well be -syntatic sugar. Define wikilinks with double brackets: +A wikilink is defined within double brackets. The destination url of the +resulting anchor is the text in the link. ```````````````````````````````` example_wikilinks This is a [[WikiLink]]. @@ -65,7 +66,7 @@ Wikilinks, when enabled, may be used as an alternative to the autolink syntax;

    https://example.org/

    ```````````````````````````````` -Wikilinks can have different display text, called piping: +Wikilinks can have different display text through a utility called piping: ```````````````````````````````` example_wikilinks This is [[WikiLink|a pothole]]. @@ -170,3 +171,58 @@ emphasis **cross [[over** here]] .

    emphasis **cross over** here

    ```````````````````````````````` + +## Pipe escaping behavior +A pipe symbol can not be included in the href of a wikilink. That is to say the +pipe symbol cannot be escaped, and backslashes will be treated as part of the +URL. + +```````````````````````````````` example_wikilinks +[[first\|second]] +. +

    second

    +```````````````````````````````` + +Also, because the content within is taken as-is, HTML entities cannot be used +to get around this: + +```````````````````````````````` example_wikilinks +[[first!second]] +. +

    first&#33;second

    +```````````````````````````````` + +This is equivalent to the +[commonmark-hs](https://pandoc.org/try/?params=%7b%22text%22%3a%22%5b%5bfirst%5c%5c%7csecond%5d%5d%22%2c%22to%22%3a%22html5%22%2c%22from%22%3a%22commonmark%2bwikilinks_title_after_pipe%22%2c%22standalone%22%3afalse%2c%22embed-resources%22%3afalse%2c%22table-of-contents%22%3afalse%2c%22number-sections%22%3afalse%2c%22citeproc%22%3afalse%2c%22html-math-method%22%3a%22plain%22%2c%22wrap%22%3a%22auto%22%2c%22highlight-style%22%3anull%2c%22files%22%3a%7b%7d%2c%22template%22%3anull%7d) +behavior. + +This is also equivalent to [Gollum](https://github.com/gollum/gollum)'s +support for markdown it ships by default, though the order of href and +display text is switched. The above example roughly renders: + +```html +

    first\

    +``` + +Github Wiki, built on top of Gollum, similarly swaps the href and display text, +but the backslash **does not render at all**. The above example roughly +renders: + +```html +

    first

    +``` + +Obisidian, the original inspiration of this implementation, treats the +backslash as a path seperator. That is to say the backslash does not render +at all in the above example: + +```html +

    second

    +``` + +But the example `[[first\,third|second]]` renders to what +`[second](first/,third)` would (At least on Obsidian Publish). + +```html +

    second

    +``` diff --git a/pulldown-cmark/tests/suite/wikilinks.rs b/pulldown-cmark/tests/suite/wikilinks.rs index 4ddb083a..89566e89 100644 --- a/pulldown-cmark/tests/suite/wikilinks.rs +++ b/pulldown-cmark/tests/suite/wikilinks.rs @@ -214,3 +214,23 @@ fn wikilinks_test_19() { test_markdown_html(original, expected, false, false, false, false, true); } + +#[test] +fn wikilinks_test_20() { + let original = r##"[[first\|second]] +"##; + let expected = r##"

    second

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} + +#[test] +fn wikilinks_test_21() { + let original = r##"[[first!second]] +"##; + let expected = r##"

    first&#33;second

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} From 49117c863c902f8e755a827e6e7c43ff995a89fb Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Wed, 8 Jan 2025 19:26:57 -0800 Subject: [PATCH 096/180] document extra Obsidian detail --- pulldown-cmark/specs/wikilinks.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pulldown-cmark/specs/wikilinks.txt b/pulldown-cmark/specs/wikilinks.txt index 686a1b85..210e431c 100644 --- a/pulldown-cmark/specs/wikilinks.txt +++ b/pulldown-cmark/specs/wikilinks.txt @@ -221,8 +221,15 @@ at all in the above example: ``` But the example `[[first\,third|second]]` renders to what -`[second](first/,third)` would (At least on Obsidian Publish). +`[second](first/,third)` would on Obsidian. ```html

    second

    ``` + +On Obisidan Publish, the `[[first\,third|second]]` snippet *renders* +differently. With extra attributes and data omitted for clarity: + +```html +

    +``` From c0824c69c17443ab4d999ecdfe701f102588c8c5 Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Thu, 9 Jan 2025 11:07:34 -0800 Subject: [PATCH 097/180] add misc doc updates for wikilinks Updates to the guidebook for this feature gate were only partially complete. This commit adds: * A WikiLink section in the cheat sheet. * An example was in the book, but the index did not show it in the table. * Extra details on the normalize-wikilink.rs example on what the intended behavior is so an end-user can more confidently use it as a foundation for their own normalization. --- guide/src/cheat-sheet.md | 12 ++++++++++++ guide/src/examples/index.md | 1 + guide/src/examples/normalize-wikilink.md | 4 ++++ 3 files changed, 17 insertions(+) diff --git a/guide/src/cheat-sheet.md b/guide/src/cheat-sheet.md index f22f9833..6fd0c8ec 100644 --- a/guide/src/cheat-sheet.md +++ b/guide/src/cheat-sheet.md @@ -448,4 +448,16 @@ footnote [1]

    Custom heading

    +
    + +[WikiLinks](specs/wikilinks.md) + + + + [[https://example.com/destination|label]] + + + +label +
    diff --git a/guide/src/examples/index.md b/guide/src/examples/index.md index ad987a78..6420ab51 100644 --- a/guide/src/examples/index.md +++ b/guide/src/examples/index.md @@ -9,3 +9,4 @@ Example | Description [parser-map-event-print.rs](parser-map-event-print.md) | Dump events to the console in flat form [parser-map-tag-print.rs](parser-map-tag-print.md) | Dump block-level tag events to the console in descriptive form [string-to-string.rs](string-to-string.md) | Convert markdown to HTML +[normalize-wikilink.rs](normalize-wikilink.md) | Normalizes wikilinks' destination url diff --git a/guide/src/examples/normalize-wikilink.md b/guide/src/examples/normalize-wikilink.md index fec4ff99..279e2b4e 100644 --- a/guide/src/examples/normalize-wikilink.md +++ b/guide/src/examples/normalize-wikilink.md @@ -1,5 +1,9 @@ Normalizes wikilinks as they pass through the parser. +The resulting destination url of the wikilink is normalized closely to how +[MediaWiki](https://www.mediawiki.org/wiki/Help:Links) links are normalized. +Use this example to customize this behavior for your use cases. + ```rust {{#include ../../../pulldown-cmark/examples/normalize-wikilink.rs}} ``` From 88461dd846cb6f60505454bd00290df3d6d34484 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Fri, 10 Jan 2025 12:36:14 -0700 Subject: [PATCH 098/180] Stop using scan_ch when get will do That scanner, which returns `usize`, makes sense when actual offset arithmetic is being done. But it's overkill for checking if a character exists. Since `slice::get` is in the standard library, use that. --- pulldown-cmark/src/firstpass.rs | 6 +++--- pulldown-cmark/src/parse.rs | 4 ++-- pulldown-cmark/src/scanners.rs | 22 +++++++++++----------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 557ca973..9c1fc228 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -1705,7 +1705,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { return None; } i += 2; - if scan_ch(&bytes[i..], b':') == 0 { + if bytes.get(i) != Some(&b':') { return None; } i += 1; @@ -1762,12 +1762,12 @@ impl<'a, 'b> FirstPass<'a, 'b> { /// Returns number of bytes scanned, label and definition on success. fn parse_refdef_total(&mut self, start: usize) -> Option<(usize, LinkLabel<'a>, LinkDef<'a>)> { let bytes = &self.text.as_bytes()[start..]; - if scan_ch(bytes, b'[') == 0 { + if bytes.get(0) != Some(&b'[') { return None; } let (mut i, label) = self.parse_refdef_label(start + 1)?; i += 1; - if scan_ch(&bytes[i..], b':') == 0 { + if bytes.get(i) != Some(&b':') { return None; } i += 1; diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 1a55c956..5da30bd6 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -1158,7 +1158,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { mut ix: usize, node: Option, ) -> Option<(usize, CowStr<'input>, CowStr<'input>)> { - if scan_ch(&underlying.as_bytes()[ix..], b'(') == 0 { + if underlying.as_bytes().get(ix) != Some(&b'(') { return None; } ix += 1; @@ -1191,7 +1191,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { } else { "".into() }; - if scan_ch(&underlying.as_bytes()[ix..], b')') == 0 { + if underlying.as_bytes().get(ix) != Some(&b')') { return None; } ix += 1; diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index e872e1df..b19817a7 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -905,7 +905,7 @@ fn char_from_codepoint(input: usize) -> Option { // doesn't bother to check data[0] == '&' pub(crate) fn scan_entity(bytes: &[u8]) -> (usize, Option>) { let mut end = 1; - if scan_ch(&bytes[end..], b'#') == 1 { + if bytes.get(end) == Some(&b'#') { end += 1; let (bytecount, codepoint) = if end < bytes.len() && bytes[end] | 0x20 == b'x' { end += 1; @@ -914,7 +914,7 @@ pub(crate) fn scan_entity(bytes: &[u8]) -> (usize, Option>) { parse_decimal(&bytes[end..], 7) }; end += bytecount; - return if bytecount == 0 || scan_ch(&bytes[end..], b';') == 0 { + return if bytecount == 0 || bytes.get(end) != Some(&b';') { (0, None) } else { ( @@ -924,7 +924,7 @@ pub(crate) fn scan_entity(bytes: &[u8]) -> (usize, Option>) { }; } end += scan_while(&bytes[end..], is_ascii_alphanumeric); - if scan_ch(&bytes[end..], b';') == 1 { + if bytes.get(end) == Some(&b';') { if let Some(value) = entities::get_entity(&bytes[1..end]) { return (end + 1, Some(value.into())); } @@ -1031,7 +1031,7 @@ fn scan_attribute( ix += scan_attribute_name(&data[ix..])?; let ix_after_attribute = ix; ix = scan_whitespace_with_newline_handler_without_buffer(data, ix, newline_handler)?; - if scan_ch(&data[ix..], b'=') == 1 { + if data.get(ix) == Some(&b'=') { ix = scan_whitespace_with_newline_handler( data, ix_after_attribute, @@ -1324,7 +1324,7 @@ pub(crate) fn scan_html_block_inner( i += scan_ch(&data[i..], b'/'); } - if scan_ch(&data[i..], b'>') == 0 { + if data.get(i) != Some(&b'>') { None } else { i += 1; @@ -1421,13 +1421,13 @@ fn scan_email(text: &str, start_ix: usize) -> Option<(usize, CowStr<'_>)> { return None; } - if scan_ch(&bytes[i..], b'.') == 0 { + if bytes.get(i) != Some(&b'.') { break; } i += 1; } - if scan_ch(&bytes[i..], b'>') == 0 { + if bytes.get(i) != Some(&b'>') { return None; } @@ -1463,7 +1463,7 @@ pub(crate) fn scan_inline_html_comment( while let Some(x) = memchr(b'-', &bytes[ix..]) { ix += x + 1; scan_guard.comment = ix; - if scan_ch(&bytes[ix..], b'-') == 1 && scan_ch(&bytes[ix + 1..], b'>') == 1 { + if bytes.get(ix) == Some(&b'-') && bytes.get(ix + 1) == Some(&b'>') { return Some(ix + 2); } } @@ -1477,7 +1477,7 @@ pub(crate) fn scan_inline_html_comment( let close_brackets = scan_ch_repeat(&bytes[ix..], b']'); ix += close_brackets; - if close_brackets == 0 || scan_ch(&bytes[ix..], b'>') == 0 { + if close_brackets == 0 || bytes.get(ix) != Some(&b'>') { scan_guard.cdata = ix; None } else { @@ -1488,7 +1488,7 @@ pub(crate) fn scan_inline_html_comment( // including the character >, and the character >. _ if c.is_ascii_alphabetic() && ix > scan_guard.declaration => { ix = memchr(b'>', &bytes[ix..]).map_or(bytes.len(), |x| ix + x); - if scan_ch(&bytes[ix..], b'>') == 0 { + if bytes.get(ix) != Some(&b'>') { scan_guard.declaration = ix; None } else { @@ -1511,7 +1511,7 @@ pub(crate) fn scan_inline_html_processing( } while let Some(offset) = memchr(b'?', &bytes[ix..]) { ix += offset + 1; - if scan_ch(&bytes[ix..], b'>') == 1 { + if bytes.get(ix) == Some(&b'>') { return Some(ix + 1); } } From ec2ace53bbce81602b52a5ce8964c711bf971fcd Mon Sep 17 00:00:00 2001 From: Dante Helmore Date: Fri, 10 Jan 2025 16:51:50 -0800 Subject: [PATCH 099/180] fix panic when symbols are present in wikilink before pipe --- pulldown-cmark/specs/regression.txt | 6 ++++++ pulldown-cmark/src/parse.rs | 2 +- pulldown-cmark/src/scanners.rs | 9 +++++---- pulldown-cmark/tests/suite/regression.rs | 10 ++++++++++ 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/pulldown-cmark/specs/regression.txt b/pulldown-cmark/specs/regression.txt index f7ccb682..8d55c806 100644 --- a/pulldown-cmark/specs/regression.txt +++ b/pulldown-cmark/specs/regression.txt @@ -2782,3 +2782,9 @@ the trailing space after the > should be stripped

    the trailing space after the > should be stripped >

    ```````````````````````````````` + +```````````````````````````````` example_wikilinks +[[Wiki<|Link]] +. +

    Link

    +```````````````````````````````` diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 1a55c956..3eb40805 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -923,7 +923,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { if let Some(body_node) = body_node { // break node so passes can actually format // the display text - self.tree[body_node].item.start = start_ix + rest; + self.tree[body_node].item.start = rest; Some((true, body_node, wikitext)) } else { None diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index e872e1df..73599791 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -933,12 +933,13 @@ pub(crate) fn scan_entity(bytes: &[u8]) -> (usize, Option>) { } pub(crate) fn scan_wikilink_pipe(data: &str, start_ix: usize, len: usize) -> Option<(usize, &str)> { - let bytes = &data.as_bytes()[start_ix..]; - let mut i = 0; + let bytes = data.as_bytes(); + let end_ix = std::cmp::min(start_ix + len, bytes.len()); + let mut i = start_ix; - while i < bytes.len() && i < len { + while i < end_ix { if bytes[i] == b'|' { - return Some((i + 1, &data[start_ix..start_ix + i])); + return Some((i + 1, &data[start_ix..i])); } i += 1; } diff --git a/pulldown-cmark/tests/suite/regression.rs b/pulldown-cmark/tests/suite/regression.rs index 118d89b1..38397346 100644 --- a/pulldown-cmark/tests/suite/regression.rs +++ b/pulldown-cmark/tests/suite/regression.rs @@ -3315,3 +3315,13 @@ fn regression_test_207() { test_markdown_html(original, expected, false, false, false, false, false); } + +#[test] +fn regression_test_208() { + let original = r##"[[Wiki<|Link]] +"##; + let expected = r##"

    Link

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true); +} From fc9ea3ccf663a2ef1dfab4fe86c48e7e9efc37f3 Mon Sep 17 00:00:00 2001 From: rimutaka Date: Sun, 12 Jan 2025 10:51:47 +1300 Subject: [PATCH 100/180] Added a WASM build step to github actions #1005 --- .github/workflows/rust.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e6426a69..a0f6e2fd 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -54,3 +54,8 @@ jobs: - name: Check benchmarks are not broken working-directory: bench run: cargo check --benches + # Make sure the WASM target builds for the main package + - name: Add WASM target + run: rustup target add wasm32-unknown-unknown + - name: Build WASM target + run: cargo build --package pulldown-cmark --target wasm32-unknown-unknown From ea46fecd706dc11f9523210c63e40713211a9409 Mon Sep 17 00:00:00 2001 From: rimutaka Date: Tue, 14 Jan 2025 10:42:47 +1300 Subject: [PATCH 101/180] Added a doc-comment for ENABLE_SMART_PUNCTUATION option. --- pulldown-cmark/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index 51224fc9..d99b4ce0 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -559,6 +559,11 @@ bitflags::bitflags! { const ENABLE_FOOTNOTES = 1 << 2; const ENABLE_STRIKETHROUGH = 1 << 3; const ENABLE_TASKLISTS = 1 << 4; + /// Enables replacement of ASCII punctuation characters with + /// Unicode ligatures and smart quotes. + /// This includes replacing `--` with `—`, `---` with `—`, `...` with `…`, + /// `"quote"` with `“quote”`, and `'quote'` with `‘quote’`. + /// The replacement takes place during the parsing of the document. const ENABLE_SMART_PUNCTUATION = 1 << 5; /// Extension to allow headings to have ID and classes. /// From 9678b702cd7d55132e3ac056949f60f50ae927e6 Mon Sep 17 00:00:00 2001 From: rimutaka Date: Tue, 14 Jan 2025 22:10:08 +1300 Subject: [PATCH 102/180] Fixed formatting errors --- pulldown-cmark/src/lib.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index d99b4ce0..5fdc65d3 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -559,10 +559,12 @@ bitflags::bitflags! { const ENABLE_FOOTNOTES = 1 << 2; const ENABLE_STRIKETHROUGH = 1 << 3; const ENABLE_TASKLISTS = 1 << 4; - /// Enables replacement of ASCII punctuation characters with - /// Unicode ligatures and smart quotes. + /// Enables replacement of ASCII punctuation characters with + /// Unicode ligatures and smart quotes. + /// /// This includes replacing `--` with `—`, `---` with `—`, `...` with `…`, - /// `"quote"` with `“quote”`, and `'quote'` with `‘quote’`. + /// `"quote"` with `“quote”`, and `'quote'` with `‘quote’`. + /// /// The replacement takes place during the parsing of the document. const ENABLE_SMART_PUNCTUATION = 1 << 5; /// Extension to allow headings to have ID and classes. From 96651929abbb2e2e2c520a357fdbbf6f6f8918f9 Mon Sep 17 00:00:00 2001 From: Roland Fredenhagen Date: Fri, 24 Jan 2025 18:56:31 +0100 Subject: [PATCH 103/180] Document more Events and Tags --- pulldown-cmark/src/lib.rs | 121 +++++++++++++++++++++++++++++++++++--- 1 file changed, 114 insertions(+), 7 deletions(-) diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index 5fdc65d3..df00ff6e 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -159,6 +159,8 @@ pub enum Tag<'a> { /// The identifier is prefixed with `#` and the last one in the attributes /// list is chosen, classes are prefixed with `.` and custom attributes /// have no prefix and can optionally have a value (`myattr` or `myattr=myvalue`). + /// + /// `id`, `classes` and `attrs` requires [`Options::ENABLE_HEADING_ATTRIBUTES`]. Heading { level: HeadingLevel, id: Option>, @@ -167,11 +169,36 @@ pub enum Tag<'a> { attrs: Vec<(CowStr<'a>, Option>)>, }, + /// A block quote. + /// + /// The `BlockQuoteKind` requires [`Options::ENABLE_GFM`]. + /// + /// ```markdown + /// > regular quote + /// + /// > [!NOTE] + /// > note quote + /// ``` BlockQuote(Option), /// A code block. CodeBlock(CodeBlockKind<'a>), - /// A HTML block. + /// An HTML block. + /// + /// A line that begins with some predefined tags (HTML block tags) (see [CommonMark Spec](https://spec.commonmark.org/0.31.2/#html-blocks) for more details) or any tag that is followed only by whitespace. + /// + /// Most HTML blocks end on an empty line, though some e.g. `
    ` like `1. *bar*
     "##;
     
    -    test_markdown_html(original, expected, false, false, false, false, false);
    +    test_markdown_html(original, expected, false, false, false, false, false, false);
     }
     
     #[test]
    @@ -2471,7 +2471,7 @@ bar
     

    okay

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2491,7 +2491,7 @@ okay

    okay

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2501,7 +2501,7 @@ fn spec_test_181() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2535,7 +2535,7 @@ function matchwo(a,b)

    okay

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2549,7 +2549,7 @@ fn spec_test_183() {
    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2563,7 +2563,7 @@ fn spec_test_184() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2579,7 +2579,7 @@ bar "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2595,7 +2595,7 @@ bar *foo* "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2609,7 +2609,7 @@ baz baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2625,7 +2625,7 @@ fn spec_test_188() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2639,7 +2639,7 @@ fn spec_test_189() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2665,7 +2665,7 @@ Hi "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2692,7 +2692,7 @@ fn spec_test_191() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2704,7 +2704,7 @@ fn spec_test_192() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2718,7 +2718,7 @@ fn spec_test_193() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2730,7 +2730,7 @@ fn spec_test_194() { let expected = r##"

    Foo*bar]

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2744,7 +2744,7 @@ fn spec_test_195() { let expected = r##"

    Foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2764,7 +2764,7 @@ line2 ">foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2780,7 +2780,7 @@ with blank line'

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2793,7 +2793,7 @@ fn spec_test_198() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2806,7 +2806,7 @@ fn spec_test_199() {

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2818,7 +2818,7 @@ fn spec_test_200() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2831,7 +2831,7 @@ fn spec_test_201() {

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2843,7 +2843,7 @@ fn spec_test_202() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2855,7 +2855,7 @@ fn spec_test_203() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2868,7 +2868,7 @@ fn spec_test_204() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2880,7 +2880,7 @@ fn spec_test_205() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2892,7 +2892,7 @@ fn spec_test_206() { let expected = r##"

    αγω

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2901,7 +2901,7 @@ fn spec_test_207() { "##; let expected = r##""##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2914,7 +2914,7 @@ bar let expected = r##"

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2924,7 +2924,7 @@ fn spec_test_209() { let expected = r##"

    [foo]: /url "title" ok

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2935,7 +2935,7 @@ fn spec_test_210() { let expected = r##"

    "title" ok

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2949,7 +2949,7 @@ fn spec_test_211() {

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2965,7 +2965,7 @@ fn spec_test_212() {

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2980,7 +2980,7 @@ fn spec_test_213() {

    [bar]

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -2995,7 +2995,7 @@ fn spec_test_214() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3009,7 +3009,7 @@ bar

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3022,7 +3022,7 @@ fn spec_test_216() { foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3041,7 +3041,7 @@ fn spec_test_217() { baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3055,7 +3055,7 @@ fn spec_test_218() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3068,7 +3068,7 @@ bbb

    bbb

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3085,7 +3085,7 @@ bbb

    ddd

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3099,7 +3099,7 @@ bbb

    bbb

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3111,7 +3111,7 @@ fn spec_test_222() { bbb

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3125,7 +3125,7 @@ bbb ccc

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3137,7 +3137,7 @@ bbb bbb

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3150,7 +3150,7 @@ bbb

    bbb

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3162,7 +3162,7 @@ bbb bbb

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3180,7 +3180,7 @@ aaa

    aaa

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3196,7 +3196,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3212,7 +3212,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3228,7 +3228,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3243,7 +3243,7 @@ fn spec_test_231() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3259,7 +3259,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3275,7 +3275,7 @@ foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3289,7 +3289,7 @@ fn spec_test_234() {
    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3307,7 +3307,7 @@ fn spec_test_235() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3323,7 +3323,7 @@ fn spec_test_236() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3339,7 +3339,7 @@ foo
    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3353,7 +3353,7 @@ fn spec_test_238() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3364,7 +3364,7 @@ fn spec_test_239() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3377,7 +3377,7 @@ fn spec_test_240() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3391,7 +3391,7 @@ fn spec_test_241() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3408,7 +3408,7 @@ fn spec_test_242() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3422,7 +3422,7 @@ bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3437,7 +3437,7 @@ fn spec_test_244() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3451,7 +3451,7 @@ fn spec_test_245() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3469,7 +3469,7 @@ fn spec_test_246() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3483,7 +3483,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3498,7 +3498,7 @@ baz

    baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3513,7 +3513,7 @@ baz

    baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3531,7 +3531,7 @@ bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3551,7 +3551,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3569,7 +3569,7 @@ fn spec_test_252() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3590,7 +3590,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3615,7 +3615,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3630,7 +3630,7 @@ fn spec_test_255() {

    two

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3647,7 +3647,7 @@ fn spec_test_256() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3663,7 +3663,7 @@ fn spec_test_257() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3680,7 +3680,7 @@ fn spec_test_258() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3701,7 +3701,7 @@ fn spec_test_259() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3720,7 +3720,7 @@ fn spec_test_260() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3733,7 +3733,7 @@ fn spec_test_261() {

    2.two

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3751,7 +3751,7 @@ fn spec_test_262() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3779,7 +3779,7 @@ fn spec_test_263() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3803,7 +3803,7 @@ baz "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3815,7 +3815,7 @@ fn spec_test_265() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3825,7 +3825,7 @@ fn spec_test_266() { let expected = r##"

    1234567890. not ok

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3837,7 +3837,7 @@ fn spec_test_267() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3849,7 +3849,7 @@ fn spec_test_268() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3859,7 +3859,7 @@ fn spec_test_269() { let expected = r##"

    -1. not ok

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3877,7 +3877,7 @@ fn spec_test_270() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3895,7 +3895,7 @@ fn spec_test_271() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3913,7 +3913,7 @@ paragraph "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3935,7 +3935,7 @@ fn spec_test_273() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3957,7 +3957,7 @@ fn spec_test_274() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3970,7 +3970,7 @@ bar

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -3985,7 +3985,7 @@ fn spec_test_276() {

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4002,7 +4002,7 @@ fn spec_test_277() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4029,7 +4029,7 @@ fn spec_test_278() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4042,7 +4042,7 @@ fn spec_test_279() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4057,7 +4057,7 @@ fn spec_test_280() {

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4073,7 +4073,7 @@ fn spec_test_281() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4089,7 +4089,7 @@ fn spec_test_282() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4105,7 +4105,7 @@ fn spec_test_283() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4117,7 +4117,7 @@ fn spec_test_284() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4134,7 +4134,7 @@ foo 1.

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4159,7 +4159,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4184,7 +4184,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4209,7 +4209,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4230,7 +4230,7 @@ fn spec_test_289() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4255,7 +4255,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4269,7 +4269,7 @@ with two lines. "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4289,7 +4289,7 @@ continued here.

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4309,7 +4309,7 @@ continued here.

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4336,7 +4336,7 @@ fn spec_test_294() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4354,7 +4354,7 @@ fn spec_test_295() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4371,7 +4371,7 @@ fn spec_test_296() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4387,7 +4387,7 @@ fn spec_test_297() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4403,7 +4403,7 @@ fn spec_test_298() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4423,7 +4423,7 @@ fn spec_test_299() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4443,7 +4443,7 @@ baz "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4461,7 +4461,7 @@ fn spec_test_301() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4479,7 +4479,7 @@ fn spec_test_302() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4495,7 +4495,7 @@ fn spec_test_303() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4507,7 +4507,7 @@ fn spec_test_304() { 14. The number of doors is 6.

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4521,7 +4521,7 @@ fn spec_test_305() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4546,7 +4546,7 @@ fn spec_test_306() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4574,7 +4574,7 @@ fn spec_test_307() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4598,7 +4598,7 @@ fn spec_test_308() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4627,7 +4627,7 @@ fn spec_test_309() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4651,7 +4651,7 @@ fn spec_test_310() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4675,7 +4675,7 @@ fn spec_test_311() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4695,7 +4695,7 @@ fn spec_test_312() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4718,7 +4718,7 @@ fn spec_test_313() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4741,7 +4741,7 @@ fn spec_test_314() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4762,7 +4762,7 @@ fn spec_test_315() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4787,7 +4787,7 @@ fn spec_test_316() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4811,7 +4811,7 @@ fn spec_test_317() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4836,7 +4836,7 @@ fn spec_test_318() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4860,7 +4860,7 @@ fn spec_test_319() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4880,7 +4880,7 @@ fn spec_test_320() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4904,7 +4904,7 @@ fn spec_test_321() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4916,7 +4916,7 @@ fn spec_test_322() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4933,7 +4933,7 @@ fn spec_test_323() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4953,7 +4953,7 @@ fn spec_test_324() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -4974,7 +4974,7 @@ fn spec_test_325() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5005,7 +5005,7 @@ fn spec_test_326() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5015,7 +5015,7 @@ fn spec_test_327() { let expected = r##"

    hilo`

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5025,7 +5025,7 @@ fn spec_test_328() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5035,7 +5035,7 @@ fn spec_test_329() { let expected = r##"

    foo ` bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5045,7 +5045,7 @@ fn spec_test_330() { let expected = r##"

    ``

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5055,7 +5055,7 @@ fn spec_test_331() { let expected = r##"

    ``

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5065,7 +5065,7 @@ fn spec_test_332() { let expected = r##"

    a

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5075,7 +5075,7 @@ fn spec_test_333() { let expected = r##"

     b 

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5087,7 +5087,7 @@ fn spec_test_334() {

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5101,7 +5101,7 @@ baz let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5113,7 +5113,7 @@ foo let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5124,7 +5124,7 @@ baz` let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5134,7 +5134,7 @@ fn spec_test_338() { let expected = r##"

    foo\bar`

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5144,7 +5144,7 @@ fn spec_test_339() { let expected = r##"

    foo`bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5154,7 +5154,7 @@ fn spec_test_340() { let expected = r##"

    foo `` bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5164,7 +5164,7 @@ fn spec_test_341() { let expected = r##"

    *foo*

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5174,7 +5174,7 @@ fn spec_test_342() { let expected = r##"

    [not a link](/foo)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5184,7 +5184,7 @@ fn spec_test_343() { let expected = r##"

    <a href="">`

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5194,7 +5194,7 @@ fn spec_test_344() { let expected = r##"

    `

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5204,7 +5204,7 @@ fn spec_test_345() { let expected = r##"

    <https://foo.bar.baz>`

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5214,7 +5214,7 @@ fn spec_test_346() { let expected = r##"

    https://foo.bar.`baz`

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5224,7 +5224,7 @@ fn spec_test_347() { let expected = r##"

    ```foo``

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5234,7 +5234,7 @@ fn spec_test_348() { let expected = r##"

    `foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5244,7 +5244,7 @@ fn spec_test_349() { let expected = r##"

    `foobar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5254,7 +5254,7 @@ fn spec_test_350() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5264,7 +5264,7 @@ fn spec_test_351() { let expected = r##"

    a * foo bar*

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5274,7 +5274,7 @@ fn spec_test_352() { let expected = r##"

    a*"foo"*

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5284,7 +5284,7 @@ fn spec_test_353() { let expected = r##"

    * a *

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5300,7 +5300,7 @@ fn spec_test_354() {

    *€*charlie.

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5310,7 +5310,7 @@ fn spec_test_355() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5320,7 +5320,7 @@ fn spec_test_356() { let expected = r##"

    5678

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5330,7 +5330,7 @@ fn spec_test_357() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5340,7 +5340,7 @@ fn spec_test_358() { let expected = r##"

    _ foo bar_

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5350,7 +5350,7 @@ fn spec_test_359() { let expected = r##"

    a_"foo"_

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5360,7 +5360,7 @@ fn spec_test_360() { let expected = r##"

    foo_bar_

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5370,7 +5370,7 @@ fn spec_test_361() { let expected = r##"

    5_6_78

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5380,7 +5380,7 @@ fn spec_test_362() { let expected = r##"

    пристаням_стремятся_

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5390,7 +5390,7 @@ fn spec_test_363() { let expected = r##"

    aa_"bb"_cc

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5400,7 +5400,7 @@ fn spec_test_364() { let expected = r##"

    foo-(bar)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5410,7 +5410,7 @@ fn spec_test_365() { let expected = r##"

    _foo*

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5420,7 +5420,7 @@ fn spec_test_366() { let expected = r##"

    *foo bar *

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5432,7 +5432,7 @@ fn spec_test_367() { *

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5442,7 +5442,7 @@ fn spec_test_368() { let expected = r##"

    *(*foo)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5452,7 +5452,7 @@ fn spec_test_369() { let expected = r##"

    (foo)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5462,7 +5462,7 @@ fn spec_test_370() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5472,7 +5472,7 @@ fn spec_test_371() { let expected = r##"

    _foo bar _

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5482,7 +5482,7 @@ fn spec_test_372() { let expected = r##"

    _(_foo)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5492,7 +5492,7 @@ fn spec_test_373() { let expected = r##"

    (foo)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5502,7 +5502,7 @@ fn spec_test_374() { let expected = r##"

    _foo_bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5512,7 +5512,7 @@ fn spec_test_375() { let expected = r##"

    _пристаням_стремятся

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5522,7 +5522,7 @@ fn spec_test_376() { let expected = r##"

    foo_bar_baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5532,7 +5532,7 @@ fn spec_test_377() { let expected = r##"

    (bar).

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5542,7 +5542,7 @@ fn spec_test_378() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5552,7 +5552,7 @@ fn spec_test_379() { let expected = r##"

    ** foo bar**

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5562,7 +5562,7 @@ fn spec_test_380() { let expected = r##"

    a**"foo"**

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5572,7 +5572,7 @@ fn spec_test_381() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5582,7 +5582,7 @@ fn spec_test_382() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5592,7 +5592,7 @@ fn spec_test_383() { let expected = r##"

    __ foo bar__

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5604,7 +5604,7 @@ foo bar__ foo bar__

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5614,7 +5614,7 @@ fn spec_test_385() { let expected = r##"

    a__"foo"__

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5624,7 +5624,7 @@ fn spec_test_386() { let expected = r##"

    foo__bar__

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5634,7 +5634,7 @@ fn spec_test_387() { let expected = r##"

    5__6__78

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5644,7 +5644,7 @@ fn spec_test_388() { let expected = r##"

    пристаням__стремятся__

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5654,7 +5654,7 @@ fn spec_test_389() { let expected = r##"

    foo, bar, baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5664,7 +5664,7 @@ fn spec_test_390() { let expected = r##"

    foo-(bar)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5674,7 +5674,7 @@ fn spec_test_391() { let expected = r##"

    **foo bar **

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5684,7 +5684,7 @@ fn spec_test_392() { let expected = r##"

    **(**foo)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5694,7 +5694,7 @@ fn spec_test_393() { let expected = r##"

    (foo)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5706,7 +5706,7 @@ fn spec_test_394() { Asclepias physocarpa)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5716,7 +5716,7 @@ fn spec_test_395() { let expected = r##"

    foo "bar" foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5726,7 +5726,7 @@ fn spec_test_396() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5736,7 +5736,7 @@ fn spec_test_397() { let expected = r##"

    __foo bar __

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5746,7 +5746,7 @@ fn spec_test_398() { let expected = r##"

    __(__foo)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5756,7 +5756,7 @@ fn spec_test_399() { let expected = r##"

    (foo)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5766,7 +5766,7 @@ fn spec_test_400() { let expected = r##"

    __foo__bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5776,7 +5776,7 @@ fn spec_test_401() { let expected = r##"

    __пристаням__стремятся

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5786,7 +5786,7 @@ fn spec_test_402() { let expected = r##"

    foo__bar__baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5796,7 +5796,7 @@ fn spec_test_403() { let expected = r##"

    (bar).

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5806,7 +5806,7 @@ fn spec_test_404() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5818,7 +5818,7 @@ bar* bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5828,7 +5828,7 @@ fn spec_test_406() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5838,7 +5838,7 @@ fn spec_test_407() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5848,7 +5848,7 @@ fn spec_test_408() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5858,7 +5858,7 @@ fn spec_test_409() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5868,7 +5868,7 @@ fn spec_test_410() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5878,7 +5878,7 @@ fn spec_test_411() { let expected = r##"

    foobarbaz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5888,7 +5888,7 @@ fn spec_test_412() { let expected = r##"

    foo**bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5898,7 +5898,7 @@ fn spec_test_413() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5908,7 +5908,7 @@ fn spec_test_414() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5918,7 +5918,7 @@ fn spec_test_415() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5928,7 +5928,7 @@ fn spec_test_416() { let expected = r##"

    foobarbaz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5938,7 +5938,7 @@ fn spec_test_417() { let expected = r##"

    foobar***baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5948,7 +5948,7 @@ fn spec_test_418() { let expected = r##"

    foo bar baz bim bop

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5958,7 +5958,7 @@ fn spec_test_419() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5968,7 +5968,7 @@ fn spec_test_420() { let expected = r##"

    ** is not an empty emphasis

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5978,7 +5978,7 @@ fn spec_test_421() { let expected = r##"

    **** is not an empty strong emphasis

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -5988,7 +5988,7 @@ fn spec_test_422() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6000,7 +6000,7 @@ bar** bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6010,7 +6010,7 @@ fn spec_test_424() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6020,7 +6020,7 @@ fn spec_test_425() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6030,7 +6030,7 @@ fn spec_test_426() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6040,7 +6040,7 @@ fn spec_test_427() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6050,7 +6050,7 @@ fn spec_test_428() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6060,7 +6060,7 @@ fn spec_test_429() { let expected = r##"

    foobarbaz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6070,7 +6070,7 @@ fn spec_test_430() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6080,7 +6080,7 @@ fn spec_test_431() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6092,7 +6092,7 @@ bim* bop** bim bop

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6102,7 +6102,7 @@ fn spec_test_433() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6112,7 +6112,7 @@ fn spec_test_434() { let expected = r##"

    __ is not an empty emphasis

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6122,7 +6122,7 @@ fn spec_test_435() { let expected = r##"

    ____ is not an empty strong emphasis

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6132,7 +6132,7 @@ fn spec_test_436() { let expected = r##"

    foo ***

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6142,7 +6142,7 @@ fn spec_test_437() { let expected = r##"

    foo *

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6152,7 +6152,7 @@ fn spec_test_438() { let expected = r##"

    foo _

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6162,7 +6162,7 @@ fn spec_test_439() { let expected = r##"

    foo *****

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6172,7 +6172,7 @@ fn spec_test_440() { let expected = r##"

    foo *

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6182,7 +6182,7 @@ fn spec_test_441() { let expected = r##"

    foo _

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6192,7 +6192,7 @@ fn spec_test_442() { let expected = r##"

    *foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6202,7 +6202,7 @@ fn spec_test_443() { let expected = r##"

    foo*

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6212,7 +6212,7 @@ fn spec_test_444() { let expected = r##"

    *foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6222,7 +6222,7 @@ fn spec_test_445() { let expected = r##"

    ***foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6232,7 +6232,7 @@ fn spec_test_446() { let expected = r##"

    foo*

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6242,7 +6242,7 @@ fn spec_test_447() { let expected = r##"

    foo***

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6252,7 +6252,7 @@ fn spec_test_448() { let expected = r##"

    foo ___

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6262,7 +6262,7 @@ fn spec_test_449() { let expected = r##"

    foo _

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6272,7 +6272,7 @@ fn spec_test_450() { let expected = r##"

    foo *

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6282,7 +6282,7 @@ fn spec_test_451() { let expected = r##"

    foo _____

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6292,7 +6292,7 @@ fn spec_test_452() { let expected = r##"

    foo _

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6302,7 +6302,7 @@ fn spec_test_453() { let expected = r##"

    foo *

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6312,7 +6312,7 @@ fn spec_test_454() { let expected = r##"

    _foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6322,7 +6322,7 @@ fn spec_test_455() { let expected = r##"

    foo_

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6332,7 +6332,7 @@ fn spec_test_456() { let expected = r##"

    _foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6342,7 +6342,7 @@ fn spec_test_457() { let expected = r##"

    ___foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6352,7 +6352,7 @@ fn spec_test_458() { let expected = r##"

    foo_

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6362,7 +6362,7 @@ fn spec_test_459() { let expected = r##"

    foo___

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6372,7 +6372,7 @@ fn spec_test_460() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6382,7 +6382,7 @@ fn spec_test_461() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6392,7 +6392,7 @@ fn spec_test_462() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6402,7 +6402,7 @@ fn spec_test_463() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6412,7 +6412,7 @@ fn spec_test_464() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6422,7 +6422,7 @@ fn spec_test_465() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6432,7 +6432,7 @@ fn spec_test_466() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6442,7 +6442,7 @@ fn spec_test_467() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6452,7 +6452,7 @@ fn spec_test_468() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6462,7 +6462,7 @@ fn spec_test_469() { let expected = r##"

    foo _bar baz_

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6472,7 +6472,7 @@ fn spec_test_470() { let expected = r##"

    foo bar *baz bim bam

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6482,7 +6482,7 @@ fn spec_test_471() { let expected = r##"

    **foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6492,7 +6492,7 @@ fn spec_test_472() { let expected = r##"

    *foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6502,7 +6502,7 @@ fn spec_test_473() { let expected = r##"

    *bar*

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6512,7 +6512,7 @@ fn spec_test_474() { let expected = r##"

    _foo bar_

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6522,7 +6522,7 @@ fn spec_test_475() { let expected = r##"

    *

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6532,7 +6532,7 @@ fn spec_test_476() { let expected = r##"

    **

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6542,7 +6542,7 @@ fn spec_test_477() { let expected = r##"

    __

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6552,7 +6552,7 @@ fn spec_test_478() { let expected = r##"

    a *

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6562,7 +6562,7 @@ fn spec_test_479() { let expected = r##"

    a _

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6572,7 +6572,7 @@ fn spec_test_480() { let expected = r##"

    **ahttps://foo.bar/?q=**

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6582,7 +6582,7 @@ fn spec_test_481() { let expected = r##"

    __ahttps://foo.bar/?q=__

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6592,7 +6592,7 @@ fn spec_test_482() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6602,7 +6602,7 @@ fn spec_test_483() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6612,7 +6612,7 @@ fn spec_test_484() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6622,7 +6622,7 @@ fn spec_test_485() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6632,7 +6632,7 @@ fn spec_test_486() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6642,7 +6642,7 @@ fn spec_test_487() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6652,7 +6652,7 @@ fn spec_test_488() { let expected = r##"

    [link](/my uri)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6662,7 +6662,7 @@ fn spec_test_489() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6674,7 +6674,7 @@ bar) bar)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6686,7 +6686,7 @@ bar>) bar>)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6696,7 +6696,7 @@ fn spec_test_492() { let expected = r##"

    a

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6706,7 +6706,7 @@ fn spec_test_493() { let expected = r##"

    [link](<foo>)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6720,7 +6720,7 @@ fn spec_test_494() { [a](c)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6730,7 +6730,7 @@ fn spec_test_495() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6740,7 +6740,7 @@ fn spec_test_496() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6750,7 +6750,7 @@ fn spec_test_497() { let expected = r##"

    [link](foo(and(bar))

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6760,7 +6760,7 @@ fn spec_test_498() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6770,7 +6770,7 @@ fn spec_test_499() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6780,7 +6780,7 @@ fn spec_test_500() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6796,7 +6796,7 @@ fn spec_test_501() {

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6806,7 +6806,7 @@ fn spec_test_502() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6816,7 +6816,7 @@ fn spec_test_503() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6826,7 +6826,7 @@ fn spec_test_504() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6840,7 +6840,7 @@ fn spec_test_505() { link

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6850,7 +6850,7 @@ fn spec_test_506() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6860,7 +6860,7 @@ fn spec_test_507() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6870,7 +6870,7 @@ fn spec_test_508() { let expected = r##"

    [link](/url "title "and" title")

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6880,7 +6880,7 @@ fn spec_test_509() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6891,7 +6891,7 @@ fn spec_test_510() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6901,7 +6901,7 @@ fn spec_test_511() { let expected = r##"

    [link] (/uri)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6911,7 +6911,7 @@ fn spec_test_512() { let expected = r##"

    link [foo [bar]]

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6921,7 +6921,7 @@ fn spec_test_513() { let expected = r##"

    [link] bar](/uri)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6931,7 +6931,7 @@ fn spec_test_514() { let expected = r##"

    [link bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6941,7 +6941,7 @@ fn spec_test_515() { let expected = r##"

    link [bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6951,7 +6951,7 @@ fn spec_test_516() { let expected = r##"

    link foo bar #

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6961,7 +6961,7 @@ fn spec_test_517() { let expected = r##"

    moon

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6971,7 +6971,7 @@ fn spec_test_518() { let expected = r##"

    [foo bar](/uri)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6981,7 +6981,7 @@ fn spec_test_519() { let expected = r##"

    [foo [bar baz](/uri)](/uri)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -6991,7 +6991,7 @@ fn spec_test_520() { let expected = r##"

    [foo](uri2)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7001,7 +7001,7 @@ fn spec_test_521() { let expected = r##"

    *foo*

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7011,7 +7011,7 @@ fn spec_test_522() { let expected = r##"

    foo *bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7021,7 +7021,7 @@ fn spec_test_523() { let expected = r##"

    foo [bar baz]

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7031,7 +7031,7 @@ fn spec_test_524() { let expected = r##"

    [foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7041,7 +7041,7 @@ fn spec_test_525() { let expected = r##"

    [foo](/uri)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7051,7 +7051,7 @@ fn spec_test_526() { let expected = r##"

    [foohttps://example.com/?search=](uri)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7063,7 +7063,7 @@ fn spec_test_527() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7075,7 +7075,7 @@ fn spec_test_528() { let expected = r##"

    link [foo [bar]]

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7087,7 +7087,7 @@ fn spec_test_529() { let expected = r##"

    link [bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7099,7 +7099,7 @@ fn spec_test_530() { let expected = r##"

    link foo bar #

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7111,7 +7111,7 @@ fn spec_test_531() { let expected = r##"

    moon

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7123,7 +7123,7 @@ fn spec_test_532() { let expected = r##"

    [foo bar]ref

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7135,7 +7135,7 @@ fn spec_test_533() { let expected = r##"

    [foo bar baz]ref

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7147,7 +7147,7 @@ fn spec_test_534() { let expected = r##"

    *foo*

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7159,7 +7159,7 @@ fn spec_test_535() { let expected = r##"

    foo *bar*

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7171,7 +7171,7 @@ fn spec_test_536() { let expected = r##"

    [foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7183,7 +7183,7 @@ fn spec_test_537() { let expected = r##"

    [foo][ref]

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7195,7 +7195,7 @@ fn spec_test_538() { let expected = r##"

    [foohttps://example.com/?search=][ref]

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7207,7 +7207,7 @@ fn spec_test_539() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7219,7 +7219,7 @@ fn spec_test_540() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7232,7 +7232,7 @@ fn spec_test_541() { let expected = r##"

    Baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7244,7 +7244,7 @@ fn spec_test_542() { let expected = r##"

    [foo] bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7258,7 +7258,7 @@ fn spec_test_543() { bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7272,7 +7272,7 @@ fn spec_test_544() { let expected = r##"

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7284,7 +7284,7 @@ fn spec_test_545() { let expected = r##"

    [bar][foo!]

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7297,7 +7297,7 @@ fn spec_test_546() {

    [ref[]: /uri

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7310,7 +7310,7 @@ fn spec_test_547() {

    [ref[bar]]: /uri

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7323,7 +7323,7 @@ fn spec_test_548() {

    [[[foo]]]: /url

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7335,7 +7335,7 @@ fn spec_test_549() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7347,7 +7347,7 @@ fn spec_test_550() { let expected = r##"

    bar\

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7360,7 +7360,7 @@ fn spec_test_551() {

    []: /uri

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7377,7 +7377,7 @@ fn spec_test_552() { ]: /uri

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7389,7 +7389,7 @@ fn spec_test_553() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7401,7 +7401,7 @@ fn spec_test_554() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7413,7 +7413,7 @@ fn spec_test_555() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7427,7 +7427,7 @@ fn spec_test_556() { []

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7439,7 +7439,7 @@ fn spec_test_557() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7451,7 +7451,7 @@ fn spec_test_558() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7463,7 +7463,7 @@ fn spec_test_559() { let expected = r##"

    [foo bar]

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7475,7 +7475,7 @@ fn spec_test_560() { let expected = r##"

    [[bar foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7487,7 +7487,7 @@ fn spec_test_561() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7499,7 +7499,7 @@ fn spec_test_562() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7511,7 +7511,7 @@ fn spec_test_563() { let expected = r##"

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7523,7 +7523,7 @@ fn spec_test_564() { let expected = r##"

    *foo*

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7536,7 +7536,7 @@ fn spec_test_565() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7548,7 +7548,7 @@ fn spec_test_566() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7560,7 +7560,7 @@ fn spec_test_567() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7572,7 +7572,7 @@ fn spec_test_568() { let expected = r##"

    foo(not a link)

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7584,7 +7584,7 @@ fn spec_test_569() { let expected = r##"

    [foo]bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7597,7 +7597,7 @@ fn spec_test_570() { let expected = r##"

    foobaz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7610,7 +7610,7 @@ fn spec_test_571() { let expected = r##"

    [foo]bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7620,7 +7620,7 @@ fn spec_test_572() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7632,7 +7632,7 @@ fn spec_test_573() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7642,7 +7642,7 @@ fn spec_test_574() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7652,7 +7652,7 @@ fn spec_test_575() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7664,7 +7664,7 @@ fn spec_test_576() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7676,7 +7676,7 @@ fn spec_test_577() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7686,7 +7686,7 @@ fn spec_test_578() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7696,7 +7696,7 @@ fn spec_test_579() { let expected = r##"

    My foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7706,7 +7706,7 @@ fn spec_test_580() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7716,7 +7716,7 @@ fn spec_test_581() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7728,7 +7728,7 @@ fn spec_test_582() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7740,7 +7740,7 @@ fn spec_test_583() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7752,7 +7752,7 @@ fn spec_test_584() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7764,7 +7764,7 @@ fn spec_test_585() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7776,7 +7776,7 @@ fn spec_test_586() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7790,7 +7790,7 @@ fn spec_test_587() { []

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7802,7 +7802,7 @@ fn spec_test_588() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7814,7 +7814,7 @@ fn spec_test_589() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7827,7 +7827,7 @@ fn spec_test_590() {

    [[foo]]: /url "title"

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7839,7 +7839,7 @@ fn spec_test_591() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7851,7 +7851,7 @@ fn spec_test_592() { let expected = r##"

    ![foo]

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7863,7 +7863,7 @@ fn spec_test_593() { let expected = r##"

    !foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7873,7 +7873,7 @@ fn spec_test_594() { let expected = r##"

    http://foo.bar.baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7883,7 +7883,7 @@ fn spec_test_595() { let expected = r##"

    https://foo.bar.baz/test?q=hello&id=22&boolean

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7893,7 +7893,7 @@ fn spec_test_596() { let expected = r##"

    irc://foo.bar:2233/baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7903,7 +7903,7 @@ fn spec_test_597() { let expected = r##"

    MAILTO:FOO@BAR.BAZ

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7913,7 +7913,7 @@ fn spec_test_598() { let expected = r##"

    a+b+c:d

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7923,7 +7923,7 @@ fn spec_test_599() { let expected = r##"

    made-up-scheme://foo,bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7933,7 +7933,7 @@ fn spec_test_600() { let expected = r##"

    https://../

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7943,7 +7943,7 @@ fn spec_test_601() { let expected = r##"

    localhost:5001/foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7953,7 +7953,7 @@ fn spec_test_602() { let expected = r##"

    <https://foo.bar/baz bim>

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7963,7 +7963,7 @@ fn spec_test_603() { let expected = r##"

    https://example.com/\[\

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7973,7 +7973,7 @@ fn spec_test_604() { let expected = r##"

    foo@bar.example.com

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7983,7 +7983,7 @@ fn spec_test_605() { let expected = r##"

    foo+special@Bar.baz-bar0.com

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -7993,7 +7993,7 @@ fn spec_test_606() { let expected = r##"

    <foo+@bar.example.com>

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8003,7 +8003,7 @@ fn spec_test_607() { let expected = r##"

    <>

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8013,7 +8013,7 @@ fn spec_test_608() { let expected = r##"

    < https://foo.bar >

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8023,7 +8023,7 @@ fn spec_test_609() { let expected = r##"

    <m:abc>

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8033,7 +8033,7 @@ fn spec_test_610() { let expected = r##"

    <foo.bar.baz>

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8043,7 +8043,7 @@ fn spec_test_611() { let expected = r##"

    https://example.com

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8053,7 +8053,7 @@ fn spec_test_612() { let expected = r##"

    foo@bar.example.com

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8063,7 +8063,7 @@ fn spec_test_613() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8073,7 +8073,7 @@ fn spec_test_614() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8085,7 +8085,7 @@ data="foo" > data="foo" >

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8097,7 +8097,7 @@ _boolean zoop:33=zoop:33 /> _boolean zoop:33=zoop:33 />

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8107,7 +8107,7 @@ fn spec_test_617() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8117,7 +8117,7 @@ fn spec_test_618() { let expected = r##"

    <33> <__>

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8127,7 +8127,7 @@ fn spec_test_619() { let expected = r##"

    <a h*#ref="hi">

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8137,7 +8137,7 @@ fn spec_test_620() { let expected = r##"

    <a href="hi'> <a href=hi'>

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8153,7 +8153,7 @@ foo><bar/ > bim!bop />

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8163,7 +8163,7 @@ fn spec_test_622() { let expected = r##"

    <a href='bar'title=title>

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8173,7 +8173,7 @@ fn spec_test_623() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8183,7 +8183,7 @@ fn spec_test_624() { let expected = r##"

    </a href="foo">

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8195,7 +8195,7 @@ comment - with hyphens --> comment - with hyphens -->

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8208,7 +8208,7 @@ foo foo -->

    foo foo -->

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8218,7 +8218,7 @@ fn spec_test_627() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8228,7 +8228,7 @@ fn spec_test_628() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8238,7 +8238,7 @@ fn spec_test_629() { let expected = r##"

    foo &<]]>

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8248,7 +8248,7 @@ fn spec_test_630() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8258,7 +8258,7 @@ fn spec_test_631() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8268,7 +8268,7 @@ fn spec_test_632() { let expected = r##"

    <a href=""">

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8280,7 +8280,7 @@ baz baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8292,7 +8292,7 @@ baz baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8304,7 +8304,7 @@ baz baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8316,7 +8316,7 @@ fn spec_test_636() { bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8328,7 +8328,7 @@ fn spec_test_637() { bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8340,7 +8340,7 @@ bar* bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8352,7 +8352,7 @@ bar* bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8363,7 +8363,7 @@ span` let expected = r##"

    code span

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8374,7 +8374,7 @@ span` let expected = r##"

    code\ span

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8386,7 +8386,7 @@ bar"> bar">

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8398,7 +8398,7 @@ bar"> bar">

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8408,7 +8408,7 @@ fn spec_test_644() { let expected = r##"

    foo\

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8418,7 +8418,7 @@ fn spec_test_645() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8428,7 +8428,7 @@ fn spec_test_646() { let expected = r##"

    foo\

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8438,7 +8438,7 @@ fn spec_test_647() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8450,7 +8450,7 @@ baz baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8462,7 +8462,7 @@ fn spec_test_649() { baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8472,7 +8472,7 @@ fn spec_test_650() { let expected = r##"

    hello $.;'there

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8482,7 +8482,7 @@ fn spec_test_651() { let expected = r##"

    Foo χρῆν

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -8492,5 +8492,5 @@ fn spec_test_652() { let expected = r##"

    Multiple spaces

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/strikethrough.rs b/pulldown-cmark/tests/suite/strikethrough.rs index ae672a09..3f2bd93f 100644 --- a/pulldown-cmark/tests/suite/strikethrough.rs +++ b/pulldown-cmark/tests/suite/strikethrough.rs @@ -10,7 +10,7 @@ fn strikethrough_test_1() { let expected = r##"

    This is stricken out

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -20,7 +20,7 @@ fn strikethrough_test_2() { let expected = r##"

    This is ~~stricken

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -30,7 +30,7 @@ fn strikethrough_test_3() { let expected = r##"

    Thisisstricken

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -40,7 +40,7 @@ fn strikethrough_test_4() { let expected = r##"

    Thisisstricken

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -50,7 +50,7 @@ fn strikethrough_test_5() { let expected = r##"

    Here I strike out an exclamation point!.

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -60,7 +60,7 @@ fn strikethrough_test_6() { let expected = r##"

    This is stricken out

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -70,7 +70,7 @@ fn strikethrough_test_7() { let expected = r##"

    This is ~stricken

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -80,7 +80,7 @@ fn strikethrough_test_8() { let expected = r##"

    This~is~nothing

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -90,7 +90,7 @@ fn strikethrough_test_9() { let expected = r##"

    This~is~nothing

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -100,7 +100,7 @@ fn strikethrough_test_10() { let expected = r##"

    Here I fail to strike out an exclamation point~!~.

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -110,7 +110,7 @@ fn strikethrough_test_11() { let expected = r##"

    Here I fail to strike out a tilde ~~~.

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -120,7 +120,7 @@ fn strikethrough_test_12() { let expected = r##"

    Here I fail to match up ~~tildes~.

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -130,7 +130,7 @@ fn strikethrough_test_13() { let expected = r##"

    Here I fail to match up ~tildes~~.

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -140,7 +140,7 @@ fn strikethrough_test_14() { let expected = r##"

    This ~is stricken.

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -150,5 +150,5 @@ fn strikethrough_test_15() { let expected = r##"

    This ~~is stricken.

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/super_sub.rs b/pulldown-cmark/tests/suite/super_sub.rs index 283bda0b..a9c0c84a 100644 --- a/pulldown-cmark/tests/suite/super_sub.rs +++ b/pulldown-cmark/tests/suite/super_sub.rs @@ -10,7 +10,7 @@ fn super_sub_test_1() { let expected = r##"

    This is super This is sub

    "##; - test_markdown_html(original, expected, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, true, false, false); } #[test] @@ -20,7 +20,7 @@ fn super_sub_test_2() { let expected = r##"

    This is stricken out

    "##; - test_markdown_html(original, expected, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, true, false, false); } #[test] @@ -30,7 +30,7 @@ fn super_sub_test_3() { let expected = r##"

    This is ~stricken

    "##; - test_markdown_html(original, expected, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, true, false, false); } #[test] @@ -40,7 +40,7 @@ fn super_sub_test_4() { let expected = r##"

    This~is~nothing

    "##; - test_markdown_html(original, expected, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, true, false, false); } #[test] @@ -50,7 +50,7 @@ fn super_sub_test_5() { let expected = r##"

    This ~~is stricken.

    "##; - test_markdown_html(original, expected, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, true, false, false); } #[test] @@ -60,5 +60,5 @@ fn super_sub_test_6() { let expected = r##"

    This ~~is stricken but this is not~~

    "##; - test_markdown_html(original, expected, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, true, false, false); } diff --git a/pulldown-cmark/tests/suite/table.rs b/pulldown-cmark/tests/suite/table.rs index aa46bca7..3e6eee04 100644 --- a/pulldown-cmark/tests/suite/table.rs +++ b/pulldown-cmark/tests/suite/table.rs @@ -11,7 +11,7 @@ fn table_test_1() { let expected = r##"

    Test header

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -23,7 +23,7 @@ fn table_test_2() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -44,7 +44,7 @@ fn table_test_3() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -71,7 +71,7 @@ fn table_test_4() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -87,7 +87,7 @@ fn table_test_5() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -103,7 +103,7 @@ fn table_test_6() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -119,7 +119,7 @@ fn table_test_7() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -135,7 +135,7 @@ fn table_test_8() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -161,7 +161,7 @@ fn table_test_9() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -173,7 +173,7 @@ fn table_test_10() { |ぃ|い|

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -187,7 +187,7 @@ fn table_test_11() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -201,7 +201,7 @@ fn table_test_12() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -302,7 +302,7 @@ b

    b

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -316,7 +316,7 @@ fn table_test_14() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -332,7 +332,7 @@ fn table_test_15() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -348,7 +348,7 @@ fn table_test_16() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -398,7 +398,7 @@ fn table_test_17() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -436,7 +436,7 @@ fn table_test_18() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -466,7 +466,7 @@ fn table_test_19() { | Not | Enough |

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -480,7 +480,7 @@ fn table_test_20() {

    |

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -494,7 +494,7 @@ fn table_test_21() { | Table | Body |

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -516,7 +516,7 @@ fn table_test_22() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -542,7 +542,7 @@ fn table_test_23() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -564,7 +564,7 @@ A: Interrupting —?

    "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -578,7 +578,7 @@ fn table_test_25() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -592,7 +592,7 @@ fn table_test_26() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -610,7 +610,7 @@ moo | moo "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } #[test] @@ -628,5 +628,5 @@ moo | moo "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/wikilinks.rs b/pulldown-cmark/tests/suite/wikilinks.rs index 89566e89..e557d1d3 100644 --- a/pulldown-cmark/tests/suite/wikilinks.rs +++ b/pulldown-cmark/tests/suite/wikilinks.rs @@ -10,7 +10,7 @@ fn wikilinks_test_1() { let expected = r##"

    This is a WikiLink.

    "##; - test_markdown_html(original, expected, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, true, false); } #[test] @@ -20,7 +20,7 @@ fn wikilinks_test_2() { let expected = r##"

    This is a Main/WikiLink.

    "##; - test_markdown_html(original, expected, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, true, false); } #[test] @@ -32,7 +32,7 @@ fn wikilinks_test_3() { let expected = r##"

    This is Ambiguous.

    "##; - test_markdown_html(original, expected, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, true, false); } #[test] @@ -49,7 +49,7 @@ fn wikilinks_test_4() {

    "##; - test_markdown_html(original, expected, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, true, false); } #[test] @@ -59,7 +59,7 @@ fn wikilinks_test_5() { let expected = r##"

    This is [also Ambiguous](https://example.com/).

    "##; - test_markdown_html(original, expected, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, true, false); } #[test] @@ -72,7 +72,7 @@ fn wikilinks_test_6() {

    https://example.org/

    "##; - test_markdown_html(original, expected, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, true, false); } #[test] @@ -82,7 +82,7 @@ fn wikilinks_test_7() { let expected = r##"

    This is a pothole.

    "##; - test_markdown_html(original, expected, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, true, false); } #[test] @@ -92,7 +92,7 @@ fn wikilinks_test_8() { let expected = r##"

    This is a WikiLink.

    "##; - test_markdown_html(original, expected, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, true, false); } #[test] @@ -102,7 +102,7 @@ fn wikilinks_test_9() { let expected = r##"

    This is a strong pothole.

    "##; - test_markdown_html(original, expected, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, true, false); } #[test] @@ -117,7 +117,7 @@ fn wikilinks_test_10() {

    "##; - test_markdown_html(original, expected, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, true, false); } #[test] @@ -127,7 +127,7 @@ fn wikilinks_test_11() { let expected = r##"

    [[WikiLink|Fish]]

    "##; - test_markdown_html(original, expected, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, true, false); } #[test] @@ -137,7 +137,7 @@ fn wikilinks_test_12() { let expected = r##"

    [[WikiLink|cat]]

    "##; - test_markdown_html(original, expected, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, true, false); } #[test] @@ -152,7 +152,7 @@ fn wikilinks_test_13() {

    "##; - test_markdown_html(original, expected, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, true, false); } #[test] @@ -162,7 +162,7 @@ fn wikilinks_test_14() { let expected = r##"

    a cute dog

    "##; - test_markdown_html(original, expected, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, true, false); } #[test] @@ -172,7 +172,7 @@ fn wikilinks_test_15() { let expected = r##"

    ]] [[]] [[|]] [[|Symbol]] [[

    "##; - test_markdown_html(original, expected, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, true, false); } #[test] @@ -182,7 +182,7 @@ fn wikilinks_test_16() { let expected = r##"

    inline link

    "##; - test_markdown_html(original, expected, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, true, false); } #[test] @@ -192,7 +192,7 @@ fn wikilinks_test_17() { let expected = r##"

    inline link]]

    "##; - test_markdown_html(original, expected, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, true, false); } #[test] @@ -202,7 +202,7 @@ fn wikilinks_test_18() { let expected = r##"

    [[code]]

    "##; - test_markdown_html(original, expected, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, true, false); } #[test] @@ -212,7 +212,7 @@ fn wikilinks_test_19() { let expected = r##"

    emphasis **cross over** here

    "##; - test_markdown_html(original, expected, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, true, false); } #[test] @@ -222,7 +222,7 @@ fn wikilinks_test_20() { let expected = r##"

    second

    "##; - test_markdown_html(original, expected, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, true, false); } #[test] @@ -232,5 +232,5 @@ fn wikilinks_test_21() { let expected = r##"

    first&#33;second

    "##; - test_markdown_html(original, expected, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, true, false); } From edee73b7b81b7888c942c6835b5b9a4ab9456f51 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Sat, 15 Feb 2025 15:33:05 -0700 Subject: [PATCH 113/180] Prevent spurious `
    ` at `

    ` start after four-space blank line --- pulldown-cmark/specs/definition_lists.txt | 12 ++++++++++++ pulldown-cmark/specs/regression.txt | 12 ++++++++++++ pulldown-cmark/src/firstpass.rs | 5 +++-- pulldown-cmark/tests/suite/definition_lists.rs | 18 +++++++++++++++--- pulldown-cmark/tests/suite/regression.rs | 12 ++++++++++++ 5 files changed, 54 insertions(+), 5 deletions(-) diff --git a/pulldown-cmark/specs/definition_lists.txt b/pulldown-cmark/specs/definition_lists.txt index 11556f20..c9a079f5 100644 --- a/pulldown-cmark/specs/definition_lists.txt +++ b/pulldown-cmark/specs/definition_lists.txt @@ -673,3 +673,15 @@ level three

    l1
    ```````````````````````````````` + +https://github.com/pulldown-cmark/pulldown-cmark/issues/997 + +Definition lists combined with link refdef + +```````````````````````````````` example_deflists +[a]: /url + +: +. +

    :

    +```````````````````````````````` diff --git a/pulldown-cmark/specs/regression.txt b/pulldown-cmark/specs/regression.txt index 01f83659..855ab646 100644 --- a/pulldown-cmark/specs/regression.txt +++ b/pulldown-cmark/specs/regression.txt @@ -2824,3 +2824,15 @@ https://github.com/pulldown-cmark/pulldown-cmark/issues/999 ```````````````````````````````` + +https://github.com/pulldown-cmark/pulldown-cmark/issues/997 + +Link refdef split from paragraph with line with spaces. + +```````````````````````````````` example +[a]: /url + +: +. +

    :

    +```````````````````````````````` diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index fc8abed6..8994a272 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -421,12 +421,13 @@ impl<'a, 'b> FirstPass<'a, 'b> { let mut line_start = LineStart::new(bytes); let tree_position = scan_containers(&self.tree, &mut line_start, self.options); let current_container = tree_position == self.tree.spine_len(); - if !line_start.scan_space(4) + if (!line_start.scan_space(4) && self.scan_paragraph_interrupt( &bytes[line_start.bytes_scanned()..], current_container, tree_position, - ) + )) + || scan_blank_line(&bytes[line_start.bytes_scanned()..]).is_some() { None } else { diff --git a/pulldown-cmark/tests/suite/definition_lists.rs b/pulldown-cmark/tests/suite/definition_lists.rs index 31cac39a..a3437862 100644 --- a/pulldown-cmark/tests/suite/definition_lists.rs +++ b/pulldown-cmark/tests/suite/definition_lists.rs @@ -300,7 +300,7 @@ chili's "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, true); } #[test] @@ -320,7 +320,7 @@ pomegranate "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, true); } #[test] @@ -621,7 +621,7 @@ fn definition_lists_test_26() { "##; - test_markdown_html(original, expected, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, true); } #[test] @@ -724,3 +724,15 @@ level three test_markdown_html(original, expected, false, false, false, false, false, true); } + +#[test] +fn definition_lists_test_31() { + let original = r##"[a]: /url + +: +"##; + let expected = r##"

    :

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, true); +} diff --git a/pulldown-cmark/tests/suite/regression.rs b/pulldown-cmark/tests/suite/regression.rs index dca508a4..12e98f53 100644 --- a/pulldown-cmark/tests/suite/regression.rs +++ b/pulldown-cmark/tests/suite/regression.rs @@ -3367,3 +3367,15 @@ fn regression_test_210() { test_markdown_html(original, expected, false, false, false, false, true, false); } + +#[test] +fn regression_test_211() { + let original = r##"[a]: /url + +: +"##; + let expected = r##"

    :

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false); +} From 478a2ce7d08960d5b68cdc0e9c56647c082bc76a Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Mon, 17 Feb 2025 17:16:34 -0700 Subject: [PATCH 114/180] Make flanking behavior on `~` and `^` act closer to pandoc --- pulldown-cmark/specs/super_sub.txt | 24 ++++++++++++++++--- pulldown-cmark/src/firstpass.rs | 32 ++++++++++++++++++------- pulldown-cmark/tests/suite/super_sub.rs | 29 +++++++++++++++++++--- 3 files changed, 71 insertions(+), 14 deletions(-) diff --git a/pulldown-cmark/specs/super_sub.txt b/pulldown-cmark/specs/super_sub.txt index f60da2e9..9cd7b9fb 100644 --- a/pulldown-cmark/specs/super_sub.txt +++ b/pulldown-cmark/specs/super_sub.txt @@ -25,13 +25,19 @@ Backslash escapes: ```````````````````````````````` example_super_sub ~This~is~nothing~ . -

    This~is~nothing

    +

    Thisisnothing

    ```````````````````````````````` ```````````````````````````````` example_super_sub -~This ~~is stricken.~ +~This ~~is not stricken.~ . -

    This ~~is stricken.

    +

    This ~~is not stricken.

    +```````````````````````````````` + +```````````````````````````````` example_super_sub +~~This ~is~~ stricken.~ +. +

    This ~is stricken.~

    ```````````````````````````````` The first one wins. @@ -41,3 +47,15 @@ The first one wins. .

    This ~~is stricken but this is not~~

    ```````````````````````````````` + +Though strikethrough requires left and right flanking, subscript does not. +Neither does superscript. + +```````````````````````````````` example_super_sub +H~2~O + +y=x^2^a+xb+c +. +

    H2O

    +

    y=x2a+xb+c

    +```````````````````````````````` diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 8994a272..31eae05a 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -925,6 +925,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { count, ix - start, mode, + self.options, ); let can_close = delim_run_can_close( &self.text[start..], @@ -932,6 +933,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { count, ix - start, mode, + self.options, ); let is_valid_seq = (c != b'~' || count <= 2) || (c == b'~' && count == 2); @@ -1176,14 +1178,21 @@ impl<'a, 'b> FirstPass<'a, 'b> { } c @ b'\'' | c @ b'"' => { let string_suffix = &self.text[ix..]; - let can_open = - delim_run_can_open(&self.text[start..], string_suffix, 1, ix - start, mode); + let can_open = delim_run_can_open( + &self.text[start..], + string_suffix, + 1, + ix - start, + mode, + self.options, + ); let can_close = delim_run_can_close( &self.text[start..], string_suffix, 1, ix - start, mode, + self.options, ); self.tree.append_text(begin_text, ix, backslash_escaped); @@ -2258,6 +2267,7 @@ fn delim_run_can_open( run_len: usize, ix: usize, mode: TableParseMode, + options: Options, ) -> bool { let next_char = if let Some(c) = suffix[run_len..].chars().next() { c @@ -2279,15 +2289,18 @@ fn delim_run_can_open( } } let delim = suffix.bytes().next().unwrap(); - // `*` and `~~` can be intraword, `_` and `~` cannot - if delim == b'*' && !is_punctuation(next_char) { + // `*`, `~~`, and `^` can be intraword, `~` can only be interword if it's subscript, `_` cannot + if (delim == b'*' || delim == b'^') && !is_punctuation(next_char) { return true; } if delim == b'~' && run_len > 1 { return true; } let prev_char = s[..ix].chars().last().unwrap(); - if delim == b'~' && prev_char == '~' && !is_punctuation(next_char) { + if delim == b'~' + && (prev_char == '~' || options.contains(Options::ENABLE_SUBSCRIPT)) + && !is_punctuation(next_char) + { return true; } @@ -2304,6 +2317,7 @@ fn delim_run_can_close( run_len: usize, ix: usize, mode: TableParseMode, + options: Options, ) -> bool { if ix == 0 { return false; @@ -2326,11 +2340,13 @@ fn delim_run_can_close( } } let delim = suffix.bytes().next().unwrap(); - // `*` and `~~` can be intraword, `_` and `~` cannot - if (delim == b'*' || (delim == b'~' && run_len > 1)) && !is_punctuation(prev_char) { + // `*`, `~~`, and `^` can be intraword, `~` can only be interword if it's subscript, `_` cannot + if (delim == b'*' || delim == b'^' || (delim == b'~' && run_len > 1)) + && !is_punctuation(prev_char) + { return true; } - if delim == b'~' && prev_char == '~' { + if delim == b'~' && (prev_char == '~' || options.contains(Options::ENABLE_SUBSCRIPT)) { return true; } diff --git a/pulldown-cmark/tests/suite/super_sub.rs b/pulldown-cmark/tests/suite/super_sub.rs index a9c0c84a..6c2492bf 100644 --- a/pulldown-cmark/tests/suite/super_sub.rs +++ b/pulldown-cmark/tests/suite/super_sub.rs @@ -37,7 +37,7 @@ fn super_sub_test_3() { fn super_sub_test_4() { let original = r##"~This~is~nothing~ "##; - let expected = r##"

    This~is~nothing

    + let expected = r##"

    Thisisnothing

    "##; test_markdown_html(original, expected, false, false, false, true, false, false); @@ -45,9 +45,9 @@ fn super_sub_test_4() { #[test] fn super_sub_test_5() { - let original = r##"~This ~~is stricken.~ + let original = r##"~This ~~is not stricken.~ "##; - let expected = r##"

    This ~~is stricken.

    + let expected = r##"

    This ~~is not stricken.

    "##; test_markdown_html(original, expected, false, false, false, true, false, false); @@ -55,6 +55,16 @@ fn super_sub_test_5() { #[test] fn super_sub_test_6() { + let original = r##"~~This ~is~~ stricken.~ +"##; + let expected = r##"

    This ~is stricken.~

    +"##; + + test_markdown_html(original, expected, false, false, false, true, false, false); +} + +#[test] +fn super_sub_test_7() { let original = r##"~This ~~is stricken~ but this is not~~ "##; let expected = r##"

    This ~~is stricken but this is not~~

    @@ -62,3 +72,16 @@ fn super_sub_test_6() { test_markdown_html(original, expected, false, false, false, true, false, false); } + +#[test] +fn super_sub_test_8() { + let original = r##"H~2~O + +y=x^2^a+xb+c +"##; + let expected = r##"

    H2O

    +

    y=x2a+xb+c

    +"##; + + test_markdown_html(original, expected, false, false, false, true, false, false); +} From 65b2b7695d0fa4f6ac36d831cd799dd69103261f Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Wed, 19 Feb 2025 08:43:53 -0700 Subject: [PATCH 115/180] Fix doc link on pulldown-cmark-escape --- pulldown-cmark-escape/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pulldown-cmark-escape/README.md b/pulldown-cmark-escape/README.md index a0c397f3..4345fac0 100644 --- a/pulldown-cmark-escape/README.md +++ b/pulldown-cmark-escape/README.md @@ -1,10 +1,10 @@ # pulldown-cmark-escape [![Tests](https://github.com/pulldown-cmark/pulldown-cmark/actions/workflows/rust.yml/badge.svg)](https://github.com/pulldown-cmark/pulldown-cmark/actions/workflows/rust.yml) -[![Docs](https://docs.rs/pulldown-cmark/badge.svg)](https://docs.rs/pulldown-cmark) +[![Docs](https://docs.rs/pulldown-cmark-escape/badge.svg)](https://docs.rs/pulldown-cmark-escape) [![Crates.io](https://img.shields.io/crates/v/pulldown-cmark-escape.svg?maxAge=2592000)](https://crates.io/crates/pulldown-cmark-escape) -[Documentation](https://docs.rs/pulldown-cmark/) +[Documentation](https://docs.rs/pulldown-cmark-escape/) This crate allows to escape HTML and links and it is part of the pulldown-cmark project, by providing `escape_html`, `escape_html_body_text` (for From bc1ded86b9425982aafceec97ab6f21d59aba5ca Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Thu, 20 Feb 2025 09:40:46 -0700 Subject: [PATCH 116/180] Do not use the same lower limit for `^` and `~` This fixes some inconsistent behavior between superscript, subscript, and emphasis. --- pulldown-cmark/specs/super_sub.txt | 23 ++++++++++++++++++++++ pulldown-cmark/src/parse.rs | 13 ++++++++++--- pulldown-cmark/tests/suite/super_sub.rs | 26 +++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 3 deletions(-) diff --git a/pulldown-cmark/specs/super_sub.txt b/pulldown-cmark/specs/super_sub.txt index 9cd7b9fb..05ec5817 100644 --- a/pulldown-cmark/specs/super_sub.txt +++ b/pulldown-cmark/specs/super_sub.txt @@ -59,3 +59,26 @@ y=x^2^a+xb+c

    H2O

    y=x2a+xb+c

    ```````````````````````````````` + +Superscript and subscript cannot group with a different delimiter count. + +```````````````````````````````` example_super_sub +~foo~~ + +^bar^^ +. +

    ~foo~~

    +

    ^bar^^

    +```````````````````````````````` + +The lower bound of superscript and subscript are separate. +Emphasis example included for analogy. + +```````````````````````````````` example_super_sub +~foo^~^bar~ + +*foo_*_bar* +. +

    foo^^bar~

    +

    foo__bar*

    +```````````````````````````````` diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index e3d9f2ae..a54709fb 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -1548,7 +1548,7 @@ struct InlineStack { // a strikethrough delimiter will never match with any element // in the stack with index smaller than // `lower_bounds[InlineStack::TILDES]`. - lower_bounds: [usize; 9], + lower_bounds: [usize; 10], } impl InlineStack { @@ -1560,6 +1560,7 @@ impl InlineStack { const ASTERISK_BASE: usize = 2; const TILDES: usize = 5; const UNDERSCORE_BASE: usize = 6; + const CIRCUMFLEXES: usize = 9; fn pop_all(&mut self, tree: &mut Tree) { for el in self.stack.drain(..) { @@ -1569,7 +1570,7 @@ impl InlineStack { }; } } - self.lower_bounds = [0; 9]; + self.lower_bounds = [0; 10]; } fn get_lowerbound(&self, c: u8, count: usize, both: bool) -> usize { @@ -1593,6 +1594,8 @@ impl InlineStack { self.lower_bounds[InlineStack::ASTERISK_NOT_BOTH], ) } + } else if c == b'^' { + self.lower_bounds[InlineStack::CIRCUMFLEXES] } else { self.lower_bounds[InlineStack::TILDES] } @@ -1610,6 +1613,8 @@ impl InlineStack { if !both { self.lower_bounds[InlineStack::ASTERISK_NOT_BOTH] = new_bound; } + } else if c == b'^' { + self.lower_bounds[InlineStack::CIRCUMFLEXES] = new_bound; } else { self.lower_bounds[InlineStack::TILDES] = new_bound; } @@ -1637,7 +1642,7 @@ impl InlineStack { .cloned() .enumerate() .rfind(|(_, el)| { - if c == b'~' && run_length != el.run_length { + if (c == b'~' || c == b'^') && run_length != el.run_length { return false; } el.c == c @@ -1670,6 +1675,8 @@ impl InlineStack { fn push(&mut self, el: InlineEl) { if el.c == b'~' { self.trim_lower_bound(InlineStack::TILDES); + } else if el.c == b'^' { + self.trim_lower_bound(InlineStack::CIRCUMFLEXES); } self.stack.push(el) } diff --git a/pulldown-cmark/tests/suite/super_sub.rs b/pulldown-cmark/tests/suite/super_sub.rs index 6c2492bf..8614ff3f 100644 --- a/pulldown-cmark/tests/suite/super_sub.rs +++ b/pulldown-cmark/tests/suite/super_sub.rs @@ -85,3 +85,29 @@ y=x^2^a+xb+c test_markdown_html(original, expected, false, false, false, true, false, false); } + +#[test] +fn super_sub_test_9() { + let original = r##"~foo~~ + +^bar^^ +"##; + let expected = r##"

    ~foo~~

    +

    ^bar^^

    +"##; + + test_markdown_html(original, expected, false, false, false, true, false, false); +} + +#[test] +fn super_sub_test_10() { + let original = r##"~foo^~^bar~ + +*foo_*_bar* +"##; + let expected = r##"

    foo^^bar~

    +

    foo__bar*

    +"##; + + test_markdown_html(original, expected, false, false, false, true, false, false); +} From 71195c0cbf565a575317a06d1e81069f3702dfb8 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Thu, 20 Feb 2025 17:20:19 -0700 Subject: [PATCH 117/180] Use match guards where they make sense It's odd that some of these branches (like MaybeHtml) use them, but other ones, like MaybeImage, don't. --- pulldown-cmark/src/firstpass.rs | 125 +++++++++++++++----------------- 1 file changed, 59 insertions(+), 66 deletions(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 31eae05a..d8269206 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -875,45 +875,46 @@ impl<'a, 'b> FirstPass<'a, 'b> { }), ) } - b'\\' => { - if ix + 1 < bytes_len && is_ascii_punctuation(bytes[ix + 1]) { - self.tree.append_text(begin_text, ix, backslash_escaped); - if bytes[ix + 1] == b'`' { - let count = 1 + scan_ch_repeat(&bytes[(ix + 2)..], b'`'); - self.tree.append(Item { - start: ix + 1, - end: ix + count + 1, - body: ItemBody::MaybeCode(count, true), - }); - begin_text = ix + 1 + count; - backslash_escaped = false; - LoopInstruction::ContinueAndSkip(count) - } else if bytes[ix + 1] == b'|' && TableParseMode::Active == mode { - // Yeah, it's super weird that backslash escaped pipes in tables aren't "real" - // backslash escapes. - // - // This tree structure is intended for the benefit of inline analysis, and it - // is supposed to operate as-if backslash escaped pipes were stripped out in a - // separate pass. - begin_text = ix + 1; - backslash_escaped = false; - LoopInstruction::ContinueAndSkip(1) - } else if ix + 2 < bytes_len - && bytes[ix + 1] == b'\\' - && bytes[ix + 2] == b'|' - && TableParseMode::Active == mode - { - // To parse `\\|`, discard the backslashes and parse the `|` that follows it. - begin_text = ix + 2; - backslash_escaped = true; - LoopInstruction::ContinueAndSkip(2) - } else { - begin_text = ix + 1; - backslash_escaped = true; - LoopInstruction::ContinueAndSkip(1) - } + b'\\' + if bytes + .get(ix + 1) + .copied() + .map_or(false, is_ascii_punctuation) => + { + self.tree.append_text(begin_text, ix, backslash_escaped); + if bytes[ix + 1] == b'`' { + let count = 1 + scan_ch_repeat(&bytes[(ix + 2)..], b'`'); + self.tree.append(Item { + start: ix + 1, + end: ix + count + 1, + body: ItemBody::MaybeCode(count, true), + }); + begin_text = ix + 1 + count; + backslash_escaped = false; + LoopInstruction::ContinueAndSkip(count) + } else if bytes[ix + 1] == b'|' && TableParseMode::Active == mode { + // Yeah, it's super weird that backslash escaped pipes in tables aren't "real" + // backslash escapes. + // + // This tree structure is intended for the benefit of inline analysis, and it + // is supposed to operate as-if backslash escaped pipes were stripped out in a + // separate pass. + begin_text = ix + 1; + backslash_escaped = false; + LoopInstruction::ContinueAndSkip(1) + } else if ix + 2 < bytes_len + && bytes[ix + 1] == b'\\' + && bytes[ix + 2] == b'|' + && TableParseMode::Active == mode + { + // To parse `\\|`, discard the backslashes and parse the `|` that follows it. + begin_text = ix + 2; + backslash_escaped = true; + LoopInstruction::ContinueAndSkip(2) } else { - LoopInstruction::ContinueAndSkip(0) + begin_text = ix + 1; + backslash_escaped = true; + LoopInstruction::ContinueAndSkip(1) } } c @ b'*' | c @ b'_' | c @ b'~' | c @ b'^' => { @@ -1061,20 +1062,16 @@ impl<'a, 'b> FirstPass<'a, 'b> { begin_text = ix + 1; LoopInstruction::ContinueAndSkip(0) } - b'!' => { - if ix + 1 < bytes_len && bytes[ix + 1] == b'[' { - self.tree.append_text(begin_text, ix, backslash_escaped); - backslash_escaped = false; - self.tree.append(Item { - start: ix, - end: ix + 2, - body: ItemBody::MaybeImage, - }); - begin_text = ix + 2; - LoopInstruction::ContinueAndSkip(1) - } else { - LoopInstruction::ContinueAndSkip(0) - } + b'!' if bytes.get(ix + 1) == Some(&b'[') => { + self.tree.append_text(begin_text, ix, backslash_escaped); + backslash_escaped = false; + self.tree.append(Item { + start: ix, + end: ix + 2, + body: ItemBody::MaybeImage, + }); + begin_text = ix + 2; + LoopInstruction::ContinueAndSkip(1) } b'[' => { self.tree.append_text(begin_text, ix, backslash_escaped); @@ -1123,20 +1120,16 @@ impl<'a, 'b> FirstPass<'a, 'b> { LoopInstruction::ContinueAndSkip(0) } } - b'.' => { - if ix + 2 < bytes.len() && bytes[ix + 1] == b'.' && bytes[ix + 2] == b'.' { - self.tree.append_text(begin_text, ix, backslash_escaped); - backslash_escaped = false; - self.tree.append(Item { - start: ix, - end: ix + 3, - body: ItemBody::SynthesizeChar('…'), - }); - begin_text = ix + 3; - LoopInstruction::ContinueAndSkip(2) - } else { - LoopInstruction::ContinueAndSkip(0) - } + b'.' if matches!(bytes.get(ix + 1..), Some(&[b'.', b'.', ..])) => { + self.tree.append_text(begin_text, ix, backslash_escaped); + backslash_escaped = false; + self.tree.append(Item { + start: ix, + end: ix + 3, + body: ItemBody::SynthesizeChar('…'), + }); + begin_text = ix + 3; + LoopInstruction::ContinueAndSkip(2) } b'-' => { let count = 1 + scan_ch_repeat(&bytes[(ix + 1)..], b'-'); From d6230b7177ce700133494d81450a7a7562a7f928 Mon Sep 17 00:00:00 2001 From: CrazyboyQCD Date: Tue, 4 Mar 2025 16:34:41 +0800 Subject: [PATCH 118/180] Add clippy for `no_std` maintenance --- pulldown-cmark-escape/src/lib.rs | 14 +++++++++++++- pulldown-cmark/src/lib.rs | 6 +++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/pulldown-cmark-escape/src/lib.rs b/pulldown-cmark-escape/src/lib.rs index 7ee03ae2..274a735d 100644 --- a/pulldown-cmark-escape/src/lib.rs +++ b/pulldown-cmark-escape/src/lib.rs @@ -20,8 +20,20 @@ //! Utility functions for HTML escaping. Only useful when building your own //! HTML renderer. +#![warn( + clippy::alloc_instead_of_core, + clippy::std_instead_of_alloc, + clippy::std_instead_of_core +)] +#![cfg_attr(not(feature = "std"), no_std)] +extern crate alloc; -use std::fmt::{self, Arguments}; +#[cfg(feature = "std")] +extern crate std; + +use alloc::string::String; + +use core::fmt::{self, Arguments}; use std::io::{self, Write}; use std::str::from_utf8; diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index 99b625da..cde20d0c 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -68,7 +68,11 @@ //! } //! ``` //! - +#![warn( + clippy::alloc_instead_of_core, + clippy::std_instead_of_alloc, + clippy::std_instead_of_core +)] // When compiled for the rustc compiler itself we want to make sure that this is // an unstable crate. #![cfg_attr(rustbuild, feature(staged_api, rustc_private))] From c121945aacfc3798da8f001297480a7948988d09 Mon Sep 17 00:00:00 2001 From: CrazyboyQCD Date: Tue, 4 Mar 2025 16:37:54 +0800 Subject: [PATCH 119/180] Replace `std` imports with `alloc` and `core`, gate some `std` imports under `std` and `hashbrown` feature --- Cargo.lock | 32 ++++++++++++++++++++- pulldown-cmark-escape/Cargo.toml | 1 + pulldown-cmark-escape/src/lib.rs | 7 ++++- pulldown-cmark/Cargo.toml | 7 +++-- pulldown-cmark/build.rs | 4 +-- pulldown-cmark/src/firstpass.rs | 37 ++++++++++++------------ pulldown-cmark/src/html.rs | 21 +++++++++----- pulldown-cmark/src/lib.rs | 28 ++++++++++++++----- pulldown-cmark/src/linklabel.rs | 8 ++++-- pulldown-cmark/src/parse.rs | 48 +++++++++++++++++++------------- pulldown-cmark/src/scanners.rs | 19 +++++++------ pulldown-cmark/src/strings.rs | 44 +++++++++++++++++++---------- pulldown-cmark/src/tree.rs | 25 +++++++++-------- pulldown-cmark/src/utils.rs | 6 +++- 14 files changed, 190 insertions(+), 97 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6122fa52..15da9fea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "anes" version = "0.1.6" @@ -489,6 +495,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + [[package]] name = "errno" version = "0.3.10" @@ -533,6 +545,12 @@ dependencies = [ "miniz_oxide", ] +[[package]] +name = "foldhash" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" + [[package]] name = "getopts" version = "0.2.21" @@ -575,6 +593,17 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + [[package]] name = "heck" version = "0.5.0" @@ -1026,7 +1055,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -1442,6 +1471,7 @@ dependencies = [ "bincode", "bitflags", "getopts", + "hashbrown 0.15.2", "lazy_static", "memchr", "pulldown-cmark-escape", diff --git a/pulldown-cmark-escape/Cargo.toml b/pulldown-cmark-escape/Cargo.toml index 4aa1c04d..7556ce06 100644 --- a/pulldown-cmark-escape/Cargo.toml +++ b/pulldown-cmark-escape/Cargo.toml @@ -16,3 +16,4 @@ readme = "./README.md" [features] simd = [] +std = [] \ No newline at end of file diff --git a/pulldown-cmark-escape/src/lib.rs b/pulldown-cmark-escape/src/lib.rs index 274a735d..cb764023 100644 --- a/pulldown-cmark-escape/src/lib.rs +++ b/pulldown-cmark-escape/src/lib.rs @@ -34,8 +34,9 @@ extern crate std; use alloc::string::String; use core::fmt::{self, Arguments}; +use core::str::from_utf8; +#[cfg(feature = "std")] use std::io::{self, Write}; -use std::str::from_utf8; #[rustfmt::skip] static HREF_SAFE: [u8; 128] = [ @@ -58,6 +59,7 @@ static SINGLE_QUOTE_ESCAPE: &str = "'"; /// `W: StrWrite`. Since we need the latter a lot, we choose to wrap /// `Write` types. #[derive(Debug)] +#[cfg(feature = "std")] pub struct IoWriter(pub W); /// Trait that allows writing string slices. This is basically an extension @@ -69,6 +71,7 @@ pub trait StrWrite { fn write_fmt(&mut self, args: Arguments) -> Result<(), Self::Error>; } +#[cfg(feature = "std")] impl StrWrite for IoWriter where W: Write, @@ -457,6 +460,8 @@ mod simd { #[cfg(test)] mod test { + use alloc::string::String; + pub use super::{escape_href, escape_html, escape_html_body_text}; #[test] diff --git a/pulldown-cmark/Cargo.toml b/pulldown-cmark/Cargo.toml index e18f5588..0cba85ef 100644 --- a/pulldown-cmark/Cargo.toml +++ b/pulldown-cmark/Cargo.toml @@ -24,7 +24,7 @@ build = "build.rs" [[bin]] name = "pulldown-cmark" -required-features = ["getopts"] +required-features = ["getopts", "std"] doc = false [[example]] @@ -69,6 +69,7 @@ memchr = "2.5" getopts = { version = "0.2", optional = true } serde = { version = "1.0", optional = true, features = ["derive"] } pulldown-cmark-escape = { path = "../pulldown-cmark-escape", version = "0.11", optional = true } +hashbrown = { version = "0.15.2", optional = true } [dev-dependencies] lazy_static = "1.4" @@ -77,10 +78,12 @@ serde_json = "1.0.61" bincode = "1.3.1" [features] -default = ["getopts", "html"] +default = ["std", "getopts", "html"] +std = ["pulldown-cmark-escape?/std"] gen-tests = [] simd = ["pulldown-cmark-escape?/simd"] html = ["pulldown-cmark-escape"] +hashbrown = ["dep:hashbrown"] [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(rustbuild)'] } diff --git a/pulldown-cmark/build.rs b/pulldown-cmark/build.rs index 99790ba2..845dc8c9 100644 --- a/pulldown-cmark/build.rs +++ b/pulldown-cmark/build.rs @@ -4,7 +4,7 @@ fn main() { // If the "gen-tests" feature is absent, // this function will be compiled down to nothing -#[cfg(not(feature = "gen-tests"))] +#[cfg(any(not(feature = "gen-tests"), not(feature = "std")))] fn generate_tests_from_spec() {} // If the feature is present, generate tests @@ -18,7 +18,7 @@ fn generate_tests_from_spec() {} // . // expected html output // ```````````````````````````````` -#[cfg(feature = "gen-tests")] +#[cfg(all(feature = "gen-tests", feature = "std"))] fn generate_tests_from_spec() { use std::fs::{self, File}; use std::io::{Read, Write}; diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index d8269206..ef081fae 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -1,23 +1,22 @@ //! The first pass resolves all block structure, generating an AST. Within a block, items //! are in a linear chain with potential inline markup identified. -use std::cmp::max; -use std::ops::Range; +use alloc::{string::String, vec::Vec}; +use core::{cmp::max, ops::Range}; + +use unicase::UniCase; -use crate::parse::{ - scan_containers, Allocations, FootnoteDef, HeadingAttributes, Item, ItemBody, LinkDef, - LINK_MAX_NESTED_PARENS, -}; -use crate::strings::CowStr; -use crate::tree::{Tree, TreeIndex}; -use crate::Options; use crate::{ linklabel::{scan_link_label_rest, LinkLabel}, - HeadingLevel, + parse::{ + scan_containers, Allocations, FootnoteDef, HeadingAttributes, Item, ItemBody, LinkDef, + LINK_MAX_NESTED_PARENS, + }, + scanners::*, + strings::CowStr, + tree::{Tree, TreeIndex}, + HeadingLevel, MetadataBlockKind, Options, }; -use crate::{scanners::*, MetadataBlockKind}; - -use unicase::UniCase; /// Runs the first pass, which resolves the block structure of the document, /// and returns the resulting tree. @@ -2161,7 +2160,7 @@ fn scan_paragraph_interrupt_no_table( || (has_footnote && bytes.starts_with(b"[^") && scan_link_label_rest( - std::str::from_utf8(&bytes[2..]).unwrap(), + core::str::from_utf8(&bytes[2..]).unwrap(), &|_| None, tree.is_in_table(), ) @@ -2595,11 +2594,12 @@ mod simd { //! //! [great overview]: http://0x80.pl/articles/simd-byte-lookup.html + use core::arch::x86_64::*; + use super::{LookupTable, LoopInstruction}; use crate::Options; - use core::arch::x86_64::*; - const VECTOR_SIZE: usize = std::mem::size_of::<__m128i>(); + const VECTOR_SIZE: usize = core::mem::size_of::<__m128i>(); /// Generates a lookup table containing the bitmaps for our /// special marker bytes. This is effectively a 128 element 2d bitvector, @@ -2756,7 +2756,7 @@ mod simd { let mask = compute_mask(lut, bytes, ix); let block_start = ix; ix = match process_mask(mask, bytes, ix, &mut callback) { - Ok(ix) => std::cmp::max(ix, VECTOR_SIZE + block_start), + Ok(ix) => core::cmp::max(ix, VECTOR_SIZE + block_start), Err((end_ix, val)) => return (end_ix, val), }; } @@ -2774,8 +2774,7 @@ mod simd { #[cfg(test)] mod simd_test { - use super::super::create_lut; - use super::{iterate_special_bytes, LoopInstruction}; + use super::{super::create_lut, iterate_special_bytes, LoopInstruction}; use crate::Options; fn check_expected_indices(bytes: &[u8], expected: &[usize], skip: usize) { diff --git a/pulldown-cmark/src/html.rs b/pulldown-cmark/src/html.rs index b36db90e..69f0c818 100644 --- a/pulldown-cmark/src/html.rs +++ b/pulldown-cmark/src/html.rs @@ -20,13 +20,19 @@ //! HTML renderer that takes an iterator of events as input. +use alloc::{string::String, vec::Vec}; +#[cfg(feature = "std")] use std::collections::HashMap; -use crate::strings::CowStr; -use crate::Event::*; -use crate::{Alignment, BlockQuoteKind, CodeBlockKind, Event, LinkType, Tag, TagEnd}; -use pulldown_cmark_escape::{ - escape_href, escape_html, escape_html_body_text, FmtWriter, IoWriter, StrWrite, +#[cfg(all(not(feature = "std"), feature = "hashbrown"))] +use hashbrown::HashMap; +#[cfg(feature = "std")] +use pulldown_cmark_escape::IoWriter; +use pulldown_cmark_escape::{escape_href, escape_html, escape_html_body_text, FmtWriter, StrWrite}; + +use crate::{ + strings::CowStr, Alignment, BlockQuoteKind, CodeBlockKind, Event, Event::*, LinkType, Tag, + TagEnd, }; enum TableState { @@ -587,6 +593,7 @@ where /// /// "#); /// ``` +#[cfg(feature = "std")] pub fn write_html_io<'a, I, W>(writer: W, iter: I) -> std::io::Result<()> where I: Iterator>, @@ -622,10 +629,10 @@ where /// /// "#); /// ``` -pub fn write_html_fmt<'a, I, W>(writer: W, iter: I) -> std::fmt::Result +pub fn write_html_fmt<'a, I, W>(writer: W, iter: I) -> core::fmt::Result where I: Iterator>, - W: std::fmt::Write, + W: core::fmt::Write, { HtmlWriter::new(iter, FmtWriter(writer)).run() } diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index cde20d0c..fd40530b 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -80,6 +80,18 @@ // Forbid unsafe code unless the SIMD feature is enabled. #![cfg_attr(not(feature = "simd"), forbid(unsafe_code))] #![warn(missing_debug_implementations)] +#![cfg_attr(not(feature = "std"), no_std)] + +#[macro_use] +extern crate alloc; + +#[cfg(feature = "std")] +extern crate std; + +#[cfg(all(not(feature = "std"), not(feature = "hashbrown")))] +compile_error!("\"hashbrown\" feature should be enabled in \"no_std\" environment."); + +use alloc::vec::Vec; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; @@ -98,13 +110,15 @@ mod scanners; mod strings; mod tree; -use std::fmt::Display; +use core::fmt::Display; -pub use crate::parse::{ - BrokenLink, BrokenLinkCallback, DefaultBrokenLinkCallback, OffsetIter, Parser, RefDefs, +pub use crate::{ + parse::{ + BrokenLink, BrokenLinkCallback, DefaultBrokenLinkCallback, OffsetIter, Parser, RefDefs, + }, + strings::{CowStr, InlineStr}, + utils::*, }; -pub use crate::strings::{CowStr, InlineStr}; -pub use crate::utils::*; /// Codeblock kind. #[derive(Clone, Debug, PartialEq)] @@ -423,7 +437,7 @@ pub enum TagEnd { /// Make sure `TagEnd` is no more than two bytes in size. /// This is why it's used instead of just using `Tag`. #[cfg(target_pointer_width = "64")] -const _STATIC_ASSERT_TAG_END_SIZE: [(); 2] = [(); std::mem::size_of::()]; +const _STATIC_ASSERT_TAG_END_SIZE: [(); 2] = [(); core::mem::size_of::()]; impl<'a> From> for TagEnd { fn from(value: Tag) -> Self { @@ -443,7 +457,7 @@ pub enum HeadingLevel { } impl Display for HeadingLevel { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { match self { Self::H1 => write!(f, "h1"), Self::H2 => write!(f, "h2"), diff --git a/pulldown-cmark/src/linklabel.rs b/pulldown-cmark/src/linklabel.rs index e64859ad..6b5fd093 100644 --- a/pulldown-cmark/src/linklabel.rs +++ b/pulldown-cmark/src/linklabel.rs @@ -20,10 +20,14 @@ //! Link label parsing and matching. +use alloc::string::String; + use unicase::UniCase; -use crate::scanners::{is_ascii_punctuation, is_ascii_whitespace, scan_eol}; -use crate::strings::CowStr; +use crate::{ + scanners::{is_ascii_punctuation, is_ascii_whitespace, scan_eol}, + strings::CowStr, +}; #[derive(Debug)] pub(crate) enum ReferenceLabel<'a> { diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index a54709fb..19efcd37 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -20,20 +20,26 @@ //! Tree-based two pass parser. -use std::cmp::{max, min}; -use std::collections::{HashMap, VecDeque}; -use std::iter::FusedIterator; -use std::num::NonZeroUsize; -use std::ops::{Index, Range}; +use alloc::{borrow::ToOwned, boxed::Box, collections::VecDeque, string::String, vec::Vec}; +use core::{ + cmp::{max, min}, + iter::FusedIterator, + num::NonZeroUsize, + ops::{Index, Range}, +}; +#[cfg(feature = "std")] +use std::collections::HashMap; +#[cfg(all(not(feature = "std"), feature = "hashbrown"))] +use hashbrown::HashMap; use unicase::UniCase; -use crate::firstpass::run_first_pass; -use crate::linklabel::{scan_link_label_rest, FootnoteLabel, LinkLabel, ReferenceLabel}; -use crate::scanners::*; -use crate::strings::CowStr; -use crate::tree::{Tree, TreeIndex}; use crate::{ + firstpass::run_first_pass, + linklabel::{scan_link_label_rest, FootnoteLabel, LinkLabel, ReferenceLabel}, + scanners::*, + strings::CowStr, + tree::{Tree, TreeIndex}, Alignment, BlockQuoteKind, CodeBlockKind, Event, HeadingLevel, LinkType, MetadataBlockKind, Options, Tag, TagEnd, }; @@ -178,7 +184,7 @@ impl ItemBody { #[derive(Debug)] pub struct BrokenLink<'a> { - pub span: std::ops::Range, + pub span: core::ops::Range, pub link_type: LinkType, pub reference: CowStr<'a>, } @@ -218,8 +224,8 @@ pub struct Parser<'input, F = DefaultBrokenLinkCallback> { math_delims: MathDelims, } -impl<'input, F> std::fmt::Debug for Parser<'input, F> { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl<'input, F> core::fmt::Debug for Parser<'input, F> { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { // Only print the fields that have public types. f.debug_struct("Parser") .field("text", &self.text) @@ -1781,7 +1787,7 @@ impl LinkStack { fn pop(&mut self) -> Option { let el = self.inner.pop(); - self.disabled_ix = std::cmp::min(self.disabled_ix, self.inner.len()); + self.disabled_ix = core::cmp::min(self.disabled_ix, self.inner.len()); el } @@ -2056,16 +2062,16 @@ impl<'a> Allocations<'a> { } pub fn take_cow(&mut self, ix: CowIndex) -> CowStr<'a> { - std::mem::replace(&mut self.cows[ix.0], "".into()) + core::mem::replace(&mut self.cows[ix.0], "".into()) } pub fn take_link(&mut self, ix: LinkIndex) -> (LinkType, CowStr<'a>, CowStr<'a>, CowStr<'a>) { let default_link = (LinkType::ShortcutUnknown, "".into(), "".into(), "".into()); - std::mem::replace(&mut self.links[ix.0], default_link) + core::mem::replace(&mut self.links[ix.0], default_link) } pub fn take_alignment(&mut self, ix: AlignmentIndex) -> Vec { - std::mem::take(&mut self.alignments[ix.0]) + core::mem::take(&mut self.alignments[ix.0]) } } @@ -2397,6 +2403,8 @@ impl<'a, F: BrokenLinkCallback<'a>> FusedIterator for Parser<'a, F> {} #[cfg(test)] mod test { + use alloc::{borrow::ToOwned, string::ToString, vec::Vec}; + use super::*; use crate::tree::Node; @@ -2417,14 +2425,14 @@ mod test { #[test] #[cfg(target_pointer_width = "64")] fn node_size() { - let node_size = std::mem::size_of::>(); + let node_size = core::mem::size_of::>(); assert_eq!(48, node_size); } #[test] #[cfg(target_pointer_width = "64")] fn body_size() { - let body_size = std::mem::size_of::(); + let body_size = core::mem::size_of::(); assert_eq!(16, body_size); } @@ -2482,7 +2490,7 @@ mod test { #[test] fn issue_283() { - let input = std::str::from_utf8(b"\xf0\x9b\xb2\x9f (usize, Option>) { pub(crate) fn scan_wikilink_pipe(data: &str, start_ix: usize, len: usize) -> Option<(usize, &str)> { let bytes = data.as_bytes(); - let end_ix = std::cmp::min(start_ix + len, bytes.len()); + let end_ix = core::cmp::min(start_ix + len, bytes.len()); let mut i = start_ix; while i < end_ix { @@ -1236,7 +1237,7 @@ fn is_html_tag(tag: &[u8]) -> bool { // We can compare case insensitively because the probes are // all lower case alpha strings. match a.cmp(&(b | 0x20)) { - std::cmp::Ordering::Equal => None, + core::cmp::Ordering::Equal => None, inequality => Some(inequality), } }) diff --git a/pulldown-cmark/src/strings.rs b/pulldown-cmark/src/strings.rs index a4b13f9d..8c6bd7ce 100644 --- a/pulldown-cmark/src/strings.rs +++ b/pulldown-cmark/src/strings.rs @@ -1,10 +1,17 @@ -use std::borrow::{Borrow, Cow}; -use std::fmt; -use std::hash::{Hash, Hasher}; -use std::ops::Deref; -use std::str::from_utf8; - -const MAX_INLINE_STR_LEN: usize = 3 * std::mem::size_of::() - 2; +use alloc::{ + borrow::{Cow, ToOwned}, + boxed::Box, + string::{String, ToString}, +}; +use core::{ + borrow::Borrow, + fmt, + hash::{Hash, Hasher}, + ops::Deref, + str::from_utf8, +}; + +const MAX_INLINE_STR_LEN: usize = 3 * core::mem::size_of::() - 2; /// Returned when trying to convert a `&str` into a `InlineStr` /// but it fails because it doesn't fit. @@ -40,7 +47,7 @@ impl From for InlineStr { } } -impl std::cmp::PartialEq for InlineStr { +impl core::cmp::PartialEq for InlineStr { fn eq(&self, other: &InlineStr) -> bool { self.deref() == other.deref() } @@ -93,9 +100,11 @@ pub enum CowStr<'a> { #[cfg(feature = "serde")] mod serde_impl { - use super::CowStr; + use core::fmt; + use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; - use std::fmt; + + use super::CowStr; impl<'a> Serialize for CowStr<'a> { fn serialize(&self, serializer: S) -> Result @@ -162,7 +171,7 @@ impl<'a> Hash for CowStr<'a> { } } -impl<'a> std::clone::Clone for CowStr<'a> { +impl<'a> core::clone::Clone for CowStr<'a> { fn clone(&self) -> Self { match self { CowStr::Boxed(s) => match InlineStr::try_from(&**s) { @@ -175,7 +184,7 @@ impl<'a> std::clone::Clone for CowStr<'a> { } } -impl<'a> std::cmp::PartialEq> for CowStr<'a> { +impl<'a> core::cmp::PartialEq> for CowStr<'a> { fn eq(&self, other: &CowStr<'_>) -> bool { self.deref() == other.deref() } @@ -281,6 +290,11 @@ impl<'a> fmt::Display for CowStr<'a> { #[cfg(test)] mod test_special_string { + use alloc::{ + borrow::ToOwned, + string::{String, ToString}, + }; + use super::*; #[test] @@ -297,8 +311,8 @@ mod test_special_string { #[test] fn cowstr_size() { - let size = std::mem::size_of::(); - let word_size = std::mem::size_of::(); + let size = core::mem::size_of::(); + let word_size = core::mem::size_of::(); assert_eq!(3 * word_size, size); } @@ -427,6 +441,6 @@ mod test_special_string { } fn variant_eq(a: &T, b: &T) -> bool { - std::mem::discriminant(a) == std::mem::discriminant(b) + core::mem::discriminant(a) == core::mem::discriminant(b) } } diff --git a/pulldown-cmark/src/tree.rs b/pulldown-cmark/src/tree.rs index 4200d770..640d0482 100644 --- a/pulldown-cmark/src/tree.rs +++ b/pulldown-cmark/src/tree.rs @@ -6,8 +6,11 @@ //! A Vec-based container for a tree structure. -use std::num::NonZeroUsize; -use std::ops::{Add, Sub}; +use alloc::vec::Vec; +use core::{ + num::NonZeroUsize, + ops::{Add, Sub}, +}; use crate::parse::{Item, ItemBody}; @@ -166,7 +169,7 @@ impl Tree { } /// Walks the spine from a root node up to, but not including, the current node. - pub(crate) fn walk_spine(&self) -> impl std::iter::DoubleEndedIterator { + pub(crate) fn walk_spine(&self) -> impl core::iter::DoubleEndedIterator { self.spine.iter() } @@ -247,19 +250,19 @@ impl Tree { } } -impl std::fmt::Debug for Tree +impl core::fmt::Debug for Tree where - T: std::fmt::Debug, + T: core::fmt::Debug, { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { fn debug_tree( tree: &Tree, cur: TreeIndex, indent: usize, - f: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result + f: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result where - T: std::fmt::Debug, + T: core::fmt::Debug, { for _ in 0..indent { write!(f, " ")?; @@ -283,7 +286,7 @@ where } } -impl std::ops::Index for Tree { +impl core::ops::Index for Tree { type Output = Node; fn index(&self, ix: TreeIndex) -> &Self::Output { @@ -291,7 +294,7 @@ impl std::ops::Index for Tree { } } -impl std::ops::IndexMut for Tree { +impl core::ops::IndexMut for Tree { fn index_mut(&mut self, ix: TreeIndex) -> &mut Node { self.nodes.index_mut(ix.get()) } diff --git a/pulldown-cmark/src/utils.rs b/pulldown-cmark/src/utils.rs index 977f9702..829813e5 100644 --- a/pulldown-cmark/src/utils.rs +++ b/pulldown-cmark/src/utils.rs @@ -9,8 +9,10 @@ //! Its author proposed the solution in //! . +use alloc::string::String; +use core::ops::Range; + use crate::{CowStr, Event}; -use std::ops::Range; /// Merge consecutive `Event::Text` events into only one. #[derive(Debug)] @@ -134,6 +136,8 @@ where #[cfg(test)] mod test { + use alloc::vec::Vec; + use super::*; use crate::Parser; From fc3ee5ef4922e0e7e271f5ed7433401b20fa7a22 Mon Sep 17 00:00:00 2001 From: CrazyboyQCD Date: Tue, 4 Mar 2025 16:38:40 +0800 Subject: [PATCH 120/180] Format with `imports_granularity=Crate` and `group_imports=StdExternalCrate` --- pulldown-cmark/examples/footnote-rewrite.rs | 4 +--- pulldown-cmark/examples/normalize-wikilink.rs | 3 ++- pulldown-cmark/src/main.rs | 12 +++++++----- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pulldown-cmark/examples/footnote-rewrite.rs b/pulldown-cmark/examples/footnote-rewrite.rs index a550c3e3..00b84fb9 100644 --- a/pulldown-cmark/examples/footnote-rewrite.rs +++ b/pulldown-cmark/examples/footnote-rewrite.rs @@ -1,6 +1,4 @@ -use std::collections::HashMap; -use std::fmt::Write as _; -use std::io::Write as _; +use std::{collections::HashMap, fmt::Write as _, io::Write as _}; use pulldown_cmark::{html, CowStr, Event, Options, Parser, Tag, TagEnd}; diff --git a/pulldown-cmark/examples/normalize-wikilink.rs b/pulldown-cmark/examples/normalize-wikilink.rs index bdac8bf2..e2d505a2 100644 --- a/pulldown-cmark/examples/normalize-wikilink.rs +++ b/pulldown-cmark/examples/normalize-wikilink.rs @@ -1,6 +1,7 @@ +use std::io::Write; + use pulldown_cmark::{html, CowStr, Event, LinkType, Options, Parser, Tag}; use regex::RegexBuilder; -use std::io::Write; /// This example demonstrates how to normalize the href of a wikilink. The /// details of this implementation can be tweaked for different use cases. diff --git a/pulldown-cmark/src/main.rs b/pulldown-cmark/src/main.rs index 0c59596e..fcb8b3af 100644 --- a/pulldown-cmark/src/main.rs +++ b/pulldown-cmark/src/main.rs @@ -22,12 +22,14 @@ #![forbid(unsafe_code)] -use pulldown_cmark::{html, BrokenLink, Options, Parser}; +use std::{ + env, + fs::File, + io::{self, Read}, + path::PathBuf, +}; -use std::env; -use std::fs::File; -use std::io::{self, Read}; -use std::path::PathBuf; +use pulldown_cmark::{html, BrokenLink, Options, Parser}; fn dry_run(text: &str, opts: Options, broken_links: &mut Vec>) { let p = Parser::new_with_broken_link_callback( From 2d155e1e29a459812fc0c4ae2f07b6a41fa990eb Mon Sep 17 00:00:00 2001 From: CrazyboyQCD Date: Tue, 4 Mar 2025 16:39:14 +0800 Subject: [PATCH 121/180] Update `CI` --- .github/workflows/rust.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a0f6e2fd..4d69fb7c 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -39,8 +39,8 @@ jobs: run: cargo test --features=simd,gen-tests - name: Cargo test with serde feature enabled run: cargo test --features=serde - - name: Cargo test without default features - run: cargo test --no-default-features + - name: Cargo test in no_std environment + run: cargo test --no-default-features --features hashbrown regression: runs-on: ubuntu-latest steps: From c8af7f6ed8959eb4a611048ffaf27f3b83a1e06d Mon Sep 17 00:00:00 2001 From: CrazyboyQCD Date: Tue, 4 Mar 2025 22:20:08 +0800 Subject: [PATCH 122/180] Update `README` --- README.md | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 85a808e8..4aa9c13d 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,10 @@ a library. It is designed to be: -* Fast; a bare minimum of allocation and copying -* Safe; written in pure Rust with no unsafe blocks (except in the opt-in SIMD feature) -* Versatile; in particular source-maps are supported -* Correct; the goal is 100% compliance with the [CommonMark spec](http://spec.commonmark.org/) +- Fast; a bare minimum of allocation and copying +- Safe; written in pure Rust with no unsafe blocks (except in the opt-in SIMD feature) +- Versatile; in particular source-maps are supported +- Correct; the goal is 100% compliance with the [CommonMark spec](http://spec.commonmark.org/) Further, it optionally supports parsing footnotes, [Github flavored tables](https://github.github.com/gfm/#tables-extension-), @@ -184,6 +184,32 @@ codegen-units = 1 panic = "abort" ``` +### `no_std` support + +`no_std` support can be enabled by compiling with `--no-default-features` to +disable `std` support and `--features hashbrown` for `Hash` collections that are only +defined in `std` for internal usages in crate. For example: + +```toml +[dependencies] +pulldown-cmark = { version = "*", default-features = false, features = ["hashbrown", ...others] } +``` + +To support both `std` and `no_std` builds in project, you can use the following +in your `Cargo.toml`: + +```toml +[features] +default = ["std", ...others] + +std = ["pulldown-cmark/std"] +hashbrown = ["pulldown-cmark/hashbrown"] +...others + +[dependencies] +pulldown-cmark = { version = "*", default-features = false } +``` + ## Authors The main author is Raph Levien. The implementation of the new design (v0.3+) was From b7a32e75462b1759dea52709717338ce3ad358a6 Mon Sep 17 00:00:00 2001 From: CrazyboyQCD Date: Wed, 5 Mar 2025 09:00:51 +0800 Subject: [PATCH 123/180] Prefer using `hashbrown`'s collections when `std` and `hashbrown` are both enabled --- pulldown-cmark/src/html.rs | 4 ++-- pulldown-cmark/src/parse.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pulldown-cmark/src/html.rs b/pulldown-cmark/src/html.rs index 69f0c818..9aeffb15 100644 --- a/pulldown-cmark/src/html.rs +++ b/pulldown-cmark/src/html.rs @@ -21,10 +21,10 @@ //! HTML renderer that takes an iterator of events as input. use alloc::{string::String, vec::Vec}; -#[cfg(feature = "std")] +#[cfg(all(feature = "std", not(feature = "hashbrown")))] use std::collections::HashMap; -#[cfg(all(not(feature = "std"), feature = "hashbrown"))] +#[cfg(feature = "hashbrown")] use hashbrown::HashMap; #[cfg(feature = "std")] use pulldown_cmark_escape::IoWriter; diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 19efcd37..560f04f7 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -27,10 +27,10 @@ use core::{ num::NonZeroUsize, ops::{Index, Range}, }; -#[cfg(feature = "std")] +#[cfg(all(feature = "std", not(feature = "hashbrown")))] use std::collections::HashMap; -#[cfg(all(not(feature = "std"), feature = "hashbrown"))] +#[cfg(feature = "hashbrown")] use hashbrown::HashMap; use unicase::UniCase; From 4203ce5bd8ef79f67357717d2b728579f3dec294 Mon Sep 17 00:00:00 2001 From: SabrinaJewson Date: Sun, 9 Mar 2025 12:17:03 +0000 Subject: [PATCH 124/180] Memchr no_std support --- pulldown-cmark/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pulldown-cmark/Cargo.toml b/pulldown-cmark/Cargo.toml index 0cba85ef..85e9dc8f 100644 --- a/pulldown-cmark/Cargo.toml +++ b/pulldown-cmark/Cargo.toml @@ -65,7 +65,7 @@ doc-scrape-examples = true [dependencies] bitflags = "2" unicase = "2.6" -memchr = "2.5" +memchr = { version = "2.5", default-features = false } getopts = { version = "0.2", optional = true } serde = { version = "1.0", optional = true, features = ["derive"] } pulldown-cmark-escape = { path = "../pulldown-cmark-escape", version = "0.11", optional = true } @@ -79,7 +79,7 @@ bincode = "1.3.1" [features] default = ["std", "getopts", "html"] -std = ["pulldown-cmark-escape?/std"] +std = ["pulldown-cmark-escape?/std", "memchr/std"] gen-tests = [] simd = ["pulldown-cmark-escape?/simd"] html = ["pulldown-cmark-escape"] From dd4bd1a787263ee5a01810924d67d61159c106f5 Mon Sep 17 00:00:00 2001 From: Martin1887 Date: Mon, 17 Mar 2025 17:21:14 +0100 Subject: [PATCH 125/180] fix: dead link for blog post entry --- CONTRIBUTING.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a2a46669..2f2d7101 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,9 +9,10 @@ frustration later on. ### Getting familiar with the project -**The architecture** is somewhat unique; it was originally inspired by [XML pull parsers](http://www.xmlpull.org), but ended up going in somewhat of its own direction. To get familiar with it, +**The architecture** is somewhat unique; it was originally inspired by [XML pull parsers](http://www.xmlpull.org), but ended up going in somewhat of its own direction. To get familiar with it, + - start by reading the [README](README.md) page, which gives some details on the design of the parser (pull-based events) and some rationalization for it; -- read the [blog post](https://fullyfaithful.eu/pulldown-cmark) about the release of pulldown-cmark 0.3 by Marcus Klaas de Vries. +- read the [blog post](https://web.archive.org/web/20220901143924/https://fullyfaithful.eu/pulldown-cmark/) about the release of pulldown-cmark 0.3 by Marcus Klaas de Vries. **The source code** can be approached by skimming the [API documentation](https://docs.rs/pulldown-cmark/latest/pulldown_cmark) first, then explore the code for the main struct, [`Parser`](https://docs.rs/pulldown-cmark/latest/pulldown_cmark/struct.Parser.html) From 41bca7b3daf86358c32b6dc46aba50c926be5c8d Mon Sep 17 00:00:00 2001 From: CrazyboyQCD Date: Tue, 18 Mar 2025 08:51:19 +0800 Subject: [PATCH 126/180] Update example code in `README` to not render error text --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4aa9c13d..d111acde 100644 --- a/README.md +++ b/README.md @@ -192,7 +192,7 @@ defined in `std` for internal usages in crate. For example: ```toml [dependencies] -pulldown-cmark = { version = "*", default-features = false, features = ["hashbrown", ...others] } +pulldown-cmark = { version = "*", default-features = false, features = ["hashbrown", "other features"] } ``` To support both `std` and `no_std` builds in project, you can use the following @@ -200,12 +200,11 @@ in your `Cargo.toml`: ```toml [features] -default = ["std", ...others] +default = ["std", "other features"] std = ["pulldown-cmark/std"] hashbrown = ["pulldown-cmark/hashbrown"] -...others - +other_features = [] [dependencies] pulldown-cmark = { version = "*", default-features = false } ``` From 520bd63b77b547e36b7af28eaf8f9c86119f8356 Mon Sep 17 00:00:00 2001 From: "Konni (im Schloss)" Date: Mon, 31 Mar 2025 00:22:01 +0200 Subject: [PATCH 127/180] Fix #1030: Wrong Wikilink End-Offset --- pulldown-cmark/src/parse.rs | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 560f04f7..24ff1309 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -947,7 +947,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { } self.tree[tos.node].child = Some(body_node); self.tree[tos.node].next = self.tree[next_ix].next; - self.tree[tos.node].item.end = end_ix + 1; + self.tree[tos.node].item.end = end_ix + 2; self.disable_all_links(); return Some(tos.node); } @@ -2455,6 +2455,29 @@ mod test { Parser::new("\\\r\r\\.\\\\\r\r\\.\\").count(); } + #[test] + fn issue_1030() { + let mut opts = Options::empty(); + opts.insert(Options::ENABLE_WIKILINKS); + + let parser = Parser::new_ext("For a new ferrari, [[Wikientry|click here]]!", opts); + + let offsets = parser + .into_offset_iter() + .map(|(_ev, range)| range) + .collect::>(); + let expected_offsets = vec![ + (0..44), // Paragraph START + (0..19), // `For a new ferrari, ` + (19..43), // Wikilink START + (31..41), // `click here` + (19..43), // Wikilink END + (43..44), // `!` + (0..44), // Paragraph END + ]; + assert_eq!(offsets, expected_offsets); + } + #[test] fn issue_320() { // dont crash From 9b93adc5f4ff4614f6c7389da0ce651fe9dcd1ce Mon Sep 17 00:00:00 2001 From: blyxyas Date: Mon, 26 May 2025 17:47:23 +0200 Subject: [PATCH 128/180] Make Event::FootNoteReference documentation accurate --- pulldown-cmark/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index fd40530b..558ad5d3 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -587,7 +587,7 @@ pub enum Event<'a> { /// **Note**: Under some conditions HTML can also be parsed as an HTML Block, see [`Tag::HtmlBlock`] for details. #[cfg_attr(feature = "serde", serde(borrow))] InlineHtml(CowStr<'a>), - /// A reference to a footnote with given label, which may or may not be defined + /// A reference to a footnote with given label, defined /// by an event with a [`Tag::FootnoteDefinition`] tag. Definitions and references to them may /// occur in any order. Only parsed and emitted with [`Options::ENABLE_FOOTNOTES`] or [`Options::ENABLE_OLD_FOOTNOTES`]. /// From ad964b6c3636b883b8af45f471b0a4b3b64b9d0e Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Tue, 10 Jun 2025 14:47:02 +0100 Subject: [PATCH 129/180] initial spoilers --- .../examples/parser-map-tag-print.rs | 3 + pulldown-cmark/specs/spoiler.txt | 113 ++++++++++++++ pulldown-cmark/src/firstpass.rs | 19 +++ pulldown-cmark/src/html.rs | 15 ++ pulldown-cmark/src/lib.rs | 4 + pulldown-cmark/src/parse.rs | 8 + pulldown-cmark/src/scanners.rs | 44 ++++++ pulldown-cmark/tests/suite/mod.rs | 1 + pulldown-cmark/tests/suite/spoiler.rs | 140 ++++++++++++++++++ 9 files changed, 347 insertions(+) create mode 100644 pulldown-cmark/specs/spoiler.txt create mode 100644 pulldown-cmark/tests/suite/spoiler.rs diff --git a/pulldown-cmark/examples/parser-map-tag-print.rs b/pulldown-cmark/examples/parser-map-tag-print.rs index f8043618..68316b7e 100644 --- a/pulldown-cmark/examples/parser-map-tag-print.rs +++ b/pulldown-cmark/examples/parser-map-tag-print.rs @@ -73,6 +73,9 @@ fn main() { Tag::CodeBlock(code_block_kind) => { println!("CodeBlock code_block_kind: {:?}", code_block_kind) } + Tag::SpoilerBlock(summary) => { + println!("SpoilerBlock summary: {:?}", summary) + } Tag::Link { link_type, dest_url, diff --git a/pulldown-cmark/specs/spoiler.txt b/pulldown-cmark/specs/spoiler.txt new file mode 100644 index 00000000..29a184e4 --- /dev/null +++ b/pulldown-cmark/specs/spoiler.txt @@ -0,0 +1,113 @@ +# Spoiler tests + +```````````````````````````````` example_super_sub +> Is this **bold**? +> Is this **bold**? +> ::: spoiler Is this expandable? +> Is this inside? +> ::: +. +

    Is this bold? +Is this bold?

    +
    +Is this expandable? +

    Is this inside?

    +
    +
    +```````````````````````````````` + +```````````````````````````````` example_super_sub +::: spoiler Is this expandable? +Is this collapsable? +> Is this **bold**? +> Is this **bold**? +::: +**is this seperate and bold** +. +
    +Is this expandable? +

    Is this collapsable?

    +

    Is this bold? +Is this bold?

    +
    +

    is this seperate and bold

    +```````````````````````````````` + +```````````````````````````````` example_super_sub +::: spoiler Is this expandable? +Is this collapsable? +> Is this **bold**? +> Is this **bold**? +> ::: spoiler Is this expandable? +> Is this inside? +> ::: +::: +. +
    +Is this expandable? +

    Is this collapsable?

    +

    Is this bold? +Is this bold?

    +
    +Is this expandable? +

    Is this inside?

    +
    +
    +
    +```````````````````````````````` + +```````````````````````````````` example_super_sub +::: spoiler Is this expandable? +Is this collapsable? +> Is this **bold**? +> Is this **bold**? +> ::: spoiler Is this expandable? +> Is this collapsable? +> > Is this **bold**? +> > Is this **bold**? +> ::: +::: +**is this seperate and bold** +. +
    +Is this expandable? +

    Is this collapsable?

    +

    Is this bold? +Is this bold?

    +
    +Is this expandable? +

    Is this collapsable?

    +

    Is this bold? +Is this bold?

    +
    +
    +
    +

    is this seperate and bold

    +```````````````````````````````` + +```````````````````````````````` example_super_sub +::: spoiler Is this expandable? +Is this collapsable? +::: +**is this seperate and bold** +. +
    +Is this expandable? +

    Is this collapsable?

    +
    +

    is this seperate and bold

    +```````````````````````````````` + +```````````````````````````````` example_super_sub +::: spoiler Is this expandable? +Is this collapsable? + +Is this **bold**? +::: +. +
    +Is this expandable? +

    Is this collapsable?

    +

    Is this bold?

    +
    +```````````````````````````````` diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index ef081fae..90f0c58c 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -265,6 +265,23 @@ impl<'a, 'b> FirstPass<'a, 'b> { break; } } + } else if line_start.scan_spoiler_fence() { + let mut summary_start = start_ix + line_start.bytes_scanned(); + summary_start += scan_whitespace_no_nl(&bytes[summary_start..]); + let line_end = summary_start + scan_nextline(&bytes[summary_start..]); + let summary_end = line_end - scan_rev_while(&bytes[summary_start..line_end], is_ascii_whitespace); + let info_string = + unescape(&self.text[summary_start..summary_end], self.tree.is_in_table()); + let cow_ix = self.allocs.allocate_cow(info_string); + + self.tree.append(Item { + start: container_start, + end: 0, // will get set later + body: ItemBody::Spoiler(cow_ix), + }); + self.tree.push(); + + return summary_end + 1; } else { line_start = save; break; @@ -276,6 +293,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { if let Some(n) = scan_blank_line(&bytes[ix..]) { if let Some(node_ix) = self.tree.peek_up() { match &mut self.tree[node_ix].item.body { + ItemBody::Spoiler(..) => (), ItemBody::BlockQuote(..) => (), ItemBody::ListItem(indent) | ItemBody::DefinitionListDefinition(indent) if self.begin_list_item.is_some() => @@ -2132,6 +2150,7 @@ fn scan_paragraph_interrupt_no_table( || scan_hrule(bytes).is_ok() || scan_atx_heading(bytes).is_some() || scan_code_fence(bytes).is_some() + || scan_closing_spoiler_fence(bytes).is_some() || scan_blockquote_start(bytes).is_some() || scan_listitem(bytes).map_or(false, |(ix, delim, index, _)| { ! current_container || diff --git a/pulldown-cmark/src/html.rs b/pulldown-cmark/src/html.rs index 9aeffb15..4195cfb4 100644 --- a/pulldown-cmark/src/html.rs +++ b/pulldown-cmark/src/html.rs @@ -276,6 +276,18 @@ where CodeBlockKind::Indented => self.write("
    "),
                     }
                 }
    +            Tag::SpoilerBlock(summary) => {
    +                if !self.end_newline {
    +                    self.write_newline()?;
    +                }
    +                if summary.is_empty() {
    +                    self.write("
    ") + } else { + self.write("
    ")?; + escape_html(&mut self.writer, summary.as_ref())?; + self.write("") + } + } Tag::List(Some(1)) => { if self.end_newline { self.write("
      \n") @@ -434,6 +446,9 @@ where TagEnd::CodeBlock => { self.write("
    \n")?; } + TagEnd::SpoilerBlock => { + self.write("\n")?; + } TagEnd::List(true) => { self.write("\n")?; } diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index fd40530b..aa1240ea 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -200,6 +200,7 @@ pub enum Tag<'a> { BlockQuote(Option), /// A code block. CodeBlock(CodeBlockKind<'a>), + SpoilerBlock(CowStr<'a>), /// An HTML block. /// @@ -312,6 +313,7 @@ impl<'a> Tag<'a> { Tag::Heading { level, .. } => TagEnd::Heading(*level), Tag::BlockQuote(kind) => TagEnd::BlockQuote(*kind), Tag::CodeBlock(_) => TagEnd::CodeBlock, + Tag::SpoilerBlock(_) => TagEnd::SpoilerBlock, Tag::HtmlBlock => TagEnd::HtmlBlock, Tag::List(number) => TagEnd::List(number.is_some()), Tag::Item => TagEnd::Item, @@ -353,6 +355,7 @@ impl<'a> Tag<'a> { }, Tag::BlockQuote(k) => Tag::BlockQuote(k), Tag::CodeBlock(kb) => Tag::CodeBlock(kb.into_static()), + Tag::SpoilerBlock(s) => Tag::SpoilerBlock(s.into_static()), Tag::HtmlBlock => Tag::HtmlBlock, Tag::List(v) => Tag::List(v), Tag::Item => Tag::Item, @@ -405,6 +408,7 @@ pub enum TagEnd { BlockQuote(Option), CodeBlock, + SpoilerBlock, HtmlBlock, diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 24ff1309..ee0d4513 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -114,6 +114,7 @@ pub(crate) enum ItemBody { IndentCodeBlock, HtmlBlock, BlockQuote(Option), + Spoiler(CowIndex), List(bool, u8, u64), // is_tight, list character, list start index ListItem(usize), // indent level FootnoteDefinition(CowIndex), @@ -1451,6 +1452,11 @@ pub(crate) fn scan_containers( let mut i = 0; for &node_ix in tree.walk_spine() { match tree[node_ix].item.body { + ItemBody::Spoiler(..) => { + if line_start.scan_closing_spoiler_fence() { + break; + } + } ItemBody::BlockQuote(..) => { let save = line_start.clone(); let _ = line_start.scan_space(3); @@ -2244,6 +2250,7 @@ fn body_to_tag_end(body: &ItemBody) -> TagEnd { ItemBody::Image(..) => TagEnd::Image, ItemBody::Heading(level, _) => TagEnd::Heading(level), ItemBody::IndentCodeBlock | ItemBody::FencedCodeBlock(..) => TagEnd::CodeBlock, + ItemBody::Spoiler(_) => TagEnd::SpoilerBlock, ItemBody::BlockQuote(kind) => TagEnd::BlockQuote(kind), ItemBody::HtmlBlock => TagEnd::HtmlBlock, ItemBody::List(_, c, _) => { @@ -2324,6 +2331,7 @@ fn item_to_event<'a>(item: Item, text: &'a str, allocs: &mut Allocations<'a>) -> Tag::CodeBlock(CodeBlockKind::Fenced(allocs.take_cow(cow_ix))) } ItemBody::IndentCodeBlock => Tag::CodeBlock(CodeBlockKind::Indented), + ItemBody::Spoiler(cow_ix) => Tag::SpoilerBlock(allocs.take_cow(cow_ix)), ItemBody::BlockQuote(kind) => Tag::BlockQuote(kind), ItemBody::List(_, c, listitem_start) => { if c == b'.' || c == b')' { diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index 4019be55..9c37631d 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -269,6 +269,26 @@ impl<'a> LineStart<'a> { } } + pub(crate) fn scan_spoiler_fence(&mut self) -> bool { + if self.scan_case_insensitive(b":::") { + if self.scan_case_insensitive(b" spoiler ") { + true + } else { + false + } + } else { + false + } + } + + pub(crate) fn scan_closing_spoiler_fence(&mut self) -> bool { + if self.scan_case_insensitive(b":::") { + true + } else { + false + } + } + /// Scan a definition marker. /// /// Definition markers are single colons, preceded by at most three spaces @@ -742,6 +762,30 @@ pub(crate) fn scan_code_fence(data: &[u8]) -> Option<(usize, u8)> { } } +/// Scan closing spoiler fence. +/// +/// Returns number of bytes scanned and the char that is repeated to make the spoiler fence. +pub(crate) fn scan_closing_spoiler_fence(data: &[u8]) -> Option<(usize, u8)> { + let c = *data.first()?; + if !(c == b':') { + return None; + } + let i = 1 + scan_ch_repeat(&data[1..], c); + if i >= 3 { + if c == b':' { + let suffix = &data[i..]; + let next_line = i + scan_nextline(suffix); + // FIXME: make sure this is correct + if suffix[..(next_line - i)].iter().any(|&b| b == b':') { + return None; + } + } + Some((i, c)) + } else { + None + } +} + /// Scan metadata block, returning the number of delimiter bytes /// (always 3 for now) and the delimiter character. /// diff --git a/pulldown-cmark/tests/suite/mod.rs b/pulldown-cmark/tests/suite/mod.rs index a5efb382..4e44cdb4 100644 --- a/pulldown-cmark/tests/suite/mod.rs +++ b/pulldown-cmark/tests/suite/mod.rs @@ -16,6 +16,7 @@ mod old_footnotes; mod regression; mod smart_punct; mod spec; +mod spoiler; mod strikethrough; mod super_sub; mod table; diff --git a/pulldown-cmark/tests/suite/spoiler.rs b/pulldown-cmark/tests/suite/spoiler.rs new file mode 100644 index 00000000..f16f4306 --- /dev/null +++ b/pulldown-cmark/tests/suite/spoiler.rs @@ -0,0 +1,140 @@ +// This file is auto-generated by the build script +// Please, do not modify it manually + +use super::test_markdown_html; + +#[test] +fn spoiler_test_1() { + let original = r##"> Is this **bold**? +> Is this **bold**? +> ::: spoiler Is this expandable? +> Is this inside? +> ::: +"##; + let expected = r##"

    Is this bold? +Is this bold?

    +
    +Is this expandable? +

    Is this inside?

    +
    +
    +"##; + + test_markdown_html(original, expected, false, false, false, true, false, false); +} + +#[test] +fn spoiler_test_2() { + let original = r##"::: spoiler Is this expandable? +Is this collapsable? +> Is this **bold**? +> Is this **bold**? +::: +**is this seperate and bold** +"##; + let expected = r##"
    +Is this expandable? +

    Is this collapsable?

    +

    Is this bold? +Is this bold?

    +
    +

    is this seperate and bold

    +"##; + + test_markdown_html(original, expected, false, false, false, true, false, false); +} + +#[test] +fn spoiler_test_3() { + let original = r##"::: spoiler Is this expandable? +Is this collapsable? +> Is this **bold**? +> Is this **bold**? +> ::: spoiler Is this expandable? +> Is this inside? +> ::: +::: +"##; + let expected = r##"
    +Is this expandable? +

    Is this collapsable?

    +

    Is this bold? +Is this bold?

    +
    +Is this expandable? +

    Is this inside?

    +
    +
    +
    +"##; + + test_markdown_html(original, expected, false, false, false, true, false, false); +} + +#[test] +fn spoiler_test_4() { + let original = r##"::: spoiler Is this expandable? +Is this collapsable? +> Is this **bold**? +> Is this **bold**? +> ::: spoiler Is this expandable? +> Is this collapsable? +> > Is this **bold**? +> > Is this **bold**? +> ::: +::: +**is this seperate and bold** +"##; + let expected = r##"
    +Is this expandable? +

    Is this collapsable?

    +

    Is this bold? +Is this bold?

    +
    +Is this expandable? +

    Is this collapsable?

    +

    Is this bold? +Is this bold?

    +
    +
    +
    +

    is this seperate and bold

    +"##; + + test_markdown_html(original, expected, false, false, false, true, false, false); +} + +#[test] +fn spoiler_test_5() { + let original = r##"::: spoiler Is this expandable? +Is this collapsable? +::: +**is this seperate and bold** +"##; + let expected = r##"
    +Is this expandable? +

    Is this collapsable?

    +
    +

    is this seperate and bold

    +"##; + + test_markdown_html(original, expected, false, false, false, true, false, false); +} + +#[test] +fn spoiler_test_6() { + let original = r##"::: spoiler Is this expandable? +Is this collapsable? + +Is this **bold**? +::: +"##; + let expected = r##"
    +Is this expandable? +

    Is this collapsable?

    +

    Is this bold?

    +
    +"##; + + test_markdown_html(original, expected, false, false, false, true, false, false); +} From a19b467e139867847219d14d3cdb0b7afcdb3a5e Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Tue, 10 Jun 2025 15:55:21 +0100 Subject: [PATCH 130/180] feature flag --- pulldown-cmark/build.rs | 26 +- pulldown-cmark/specs/spoiler.txt | 12 +- pulldown-cmark/src/lib.rs | 2 + pulldown-cmark/tests/lib.rs | 4 + .../tests/suite/blockquotes_tags.rs | 36 +- .../tests/suite/definition_lists.rs | 62 +- pulldown-cmark/tests/suite/footnotes.rs | 52 +- .../tests/suite/gfm_strikethrough.rs | 6 +- pulldown-cmark/tests/suite/gfm_table.rs | 18 +- pulldown-cmark/tests/suite/gfm_tasklist.rs | 4 +- pulldown-cmark/tests/suite/heading_attrs.rs | 84 +- pulldown-cmark/tests/suite/math.rs | 94 +- pulldown-cmark/tests/suite/metadata_blocks.rs | 24 +- pulldown-cmark/tests/suite/old_footnotes.rs | 22 +- pulldown-cmark/tests/suite/regression.rs | 422 +++--- pulldown-cmark/tests/suite/smart_punct.rs | 32 +- pulldown-cmark/tests/suite/spec.rs | 1304 ++++++++--------- pulldown-cmark/tests/suite/spoiler.rs | 12 +- pulldown-cmark/tests/suite/strikethrough.rs | 30 +- pulldown-cmark/tests/suite/super_sub.rs | 20 +- pulldown-cmark/tests/suite/table.rs | 56 +- pulldown-cmark/tests/suite/wikilinks.rs | 42 +- 22 files changed, 1196 insertions(+), 1168 deletions(-) diff --git a/pulldown-cmark/build.rs b/pulldown-cmark/build.rs index 845dc8c9..72a24ce1 100644 --- a/pulldown-cmark/build.rs +++ b/pulldown-cmark/build.rs @@ -86,7 +86,7 @@ fn {}_test_{i}() {{ let original = r##"{original}"##; let expected = r##"{expected}"##; - test_markdown_html(original, expected, {smart_punct}, {metadata_blocks}, {old_footnotes}, {subscript}, {wikilinks}, {deflists}); + test_markdown_html(original, expected, {smart_punct}, {metadata_blocks}, {old_footnotes}, {subscript}, {wikilinks}, {deflists}, {spoiler}); }} "###, spec_name, @@ -99,6 +99,7 @@ fn {}_test_{i}() {{ subscript = testcase.subscript, wikilinks = testcase.wikilinks, deflists = testcase.deflists, + spoiler = testcase.spoiler, )) .unwrap(); @@ -157,6 +158,7 @@ pub struct TestCase { pub subscript: bool, pub wikilinks: bool, pub deflists: bool, + pub spoiler: bool, } #[cfg(feature = "gen-tests")] @@ -167,7 +169,7 @@ impl<'a> Iterator for Spec<'a> { let spec = self.spec; let prefix = "```````````````````````````````` example"; - let (i_start, smart_punct, metadata_blocks, old_footnotes, subscript, wikilinks, deflists) = + let (i_start, smart_punct, metadata_blocks, old_footnotes, subscript, wikilinks, deflists, spoiler) = self.spec.find(prefix).and_then(|pos| { let smartpunct_suffix = "_smartpunct\n"; let metadata_blocks_suffix = "_metadata_blocks\n"; @@ -175,6 +177,7 @@ impl<'a> Iterator for Spec<'a> { let super_sub_suffix = "_super_sub\n"; let wikilinks_suffix = "_wikilinks\n"; let deflists_suffix = "_deflists\n"; + let spoiler_suffix = "_spoiler\n"; if spec[(pos + prefix.len())..].starts_with(smartpunct_suffix) { Some(( pos + prefix.len() + smartpunct_suffix.len(), @@ -184,6 +187,7 @@ impl<'a> Iterator for Spec<'a> { false, false, false, + false, )) } else if spec[(pos + prefix.len())..].starts_with(metadata_blocks_suffix) { Some(( @@ -194,6 +198,7 @@ impl<'a> Iterator for Spec<'a> { false, false, false, + false, )) } else if spec[(pos + prefix.len())..].starts_with(old_footnotes_suffix) { Some(( @@ -204,6 +209,7 @@ impl<'a> Iterator for Spec<'a> { false, false, false, + false, )) } else if spec[(pos + prefix.len())..].starts_with(super_sub_suffix) { Some(( @@ -214,6 +220,7 @@ impl<'a> Iterator for Spec<'a> { true, false, false, + false, )) } else if spec[(pos + prefix.len())..].starts_with(wikilinks_suffix) { Some(( @@ -224,6 +231,7 @@ impl<'a> Iterator for Spec<'a> { false, true, false, + false, )) } else if spec[(pos + prefix.len())..].starts_with(deflists_suffix) { Some(( @@ -234,6 +242,18 @@ impl<'a> Iterator for Spec<'a> { false, false, true, + false, + )) + } else if spec[(pos + prefix.len())..].starts_with(spoiler_suffix) { + Some(( + pos + prefix.len() + spoiler_suffix.len(), + false, + false, + false, + false, + false, + false, + true, )) } else if spec[(pos + prefix.len())..].starts_with('\n') { Some(( @@ -244,6 +264,7 @@ impl<'a> Iterator for Spec<'a> { false, false, false, + false, )) } else { None @@ -269,6 +290,7 @@ impl<'a> Iterator for Spec<'a> { subscript, wikilinks, deflists, + spoiler, }; Some(test_case) diff --git a/pulldown-cmark/specs/spoiler.txt b/pulldown-cmark/specs/spoiler.txt index 29a184e4..c55af173 100644 --- a/pulldown-cmark/specs/spoiler.txt +++ b/pulldown-cmark/specs/spoiler.txt @@ -1,6 +1,6 @@ # Spoiler tests -```````````````````````````````` example_super_sub +```````````````````````````````` example_spoiler > Is this **bold**? > Is this **bold**? > ::: spoiler Is this expandable? @@ -16,7 +16,7 @@ Is this bold?

    ```````````````````````````````` -```````````````````````````````` example_super_sub +```````````````````````````````` example_spoiler ::: spoiler Is this expandable? Is this collapsable? > Is this **bold**? @@ -33,7 +33,7 @@ Is this bold?

    is this seperate and bold

    ```````````````````````````````` -```````````````````````````````` example_super_sub +```````````````````````````````` example_spoiler ::: spoiler Is this expandable? Is this collapsable? > Is this **bold**? @@ -56,7 +56,7 @@ Is this bold?

    ```````````````````````````````` -```````````````````````````````` example_super_sub +```````````````````````````````` example_spoiler ::: spoiler Is this expandable? Is this collapsable? > Is this **bold**? @@ -85,7 +85,7 @@ Is this bold?

    is this seperate and bold

    ```````````````````````````````` -```````````````````````````````` example_super_sub +```````````````````````````````` example_spoiler ::: spoiler Is this expandable? Is this collapsable? ::: @@ -98,7 +98,7 @@ Is this collapsable?

    is this seperate and bold

    ```````````````````````````````` -```````````````````````````````` example_super_sub +```````````````````````````````` example_spoiler ::: spoiler Is this expandable? Is this collapsable? diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index f8087f0a..56d7ec0c 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -757,6 +757,8 @@ bitflags::bitflags! { const ENABLE_SUBSCRIPT = 1 << 14; /// Obsidian-style Wikilinks. const ENABLE_WIKILINKS = 1 << 15; + /// Colon-style Spoilers. + const ENABLE_SPOILER = 1 << 16; } } diff --git a/pulldown-cmark/tests/lib.rs b/pulldown-cmark/tests/lib.rs index 47099273..a5ddab47 100644 --- a/pulldown-cmark/tests/lib.rs +++ b/pulldown-cmark/tests/lib.rs @@ -15,6 +15,7 @@ pub fn test_markdown_html( subscript: bool, wikilinks: bool, deflists: bool, + spoiler: bool, ) { let mut s = String::new(); @@ -47,6 +48,9 @@ pub fn test_markdown_html( if deflists { opts.insert(Options::ENABLE_DEFINITION_LIST); } + if spoiler { + opts.insert(Options::ENABLE_SPOILER); + } let p = Parser::new_ext(input, opts); pulldown_cmark::html::push_html(&mut s, p); diff --git a/pulldown-cmark/tests/suite/blockquotes_tags.rs b/pulldown-cmark/tests/suite/blockquotes_tags.rs index e3b8bbbf..bf337a63 100644 --- a/pulldown-cmark/tests/suite/blockquotes_tags.rs +++ b/pulldown-cmark/tests/suite/blockquotes_tags.rs @@ -10,7 +10,7 @@ fn blockquotes_tags_test_1() { let expected = r##"

    This is a normal blockquote without tag.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -21,7 +21,7 @@ fn blockquotes_tags_test_2() { let expected = r##"

    Note blockquote

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -32,7 +32,7 @@ fn blockquotes_tags_test_3() { let expected = r##"

    Tip blockquote

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -43,7 +43,7 @@ fn blockquotes_tags_test_4() { let expected = r##"

    Important blockquote

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -54,7 +54,7 @@ fn blockquotes_tags_test_5() { let expected = r##"

    Warning blockquote

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -65,7 +65,7 @@ fn blockquotes_tags_test_6() { let expected = r##"

    Caution blockquote

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -75,7 +75,7 @@ fn blockquotes_tags_test_7() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -88,7 +88,7 @@ fn blockquotes_tags_test_8() { Line 2.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -103,7 +103,7 @@ fn blockquotes_tags_test_9() { Line 2.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -116,7 +116,7 @@ fn blockquotes_tags_test_10() { let expected = r##"

    Line 1.

    Line 2.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -131,7 +131,7 @@ fn blockquotes_tags_test_11() { let expected = r##"

    Line 1.

    Line 2.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -144,7 +144,7 @@ fn blockquotes_tags_test_12() { Line 2.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -159,7 +159,7 @@ fn blockquotes_tags_test_13() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -174,7 +174,7 @@ fn blockquotes_tags_test_14() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -189,7 +189,7 @@ fn blockquotes_tags_test_15() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -216,7 +216,7 @@ sink ships "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -237,7 +237,7 @@ fn blockquotes_tags_test_17() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -251,5 +251,5 @@ This should be a normal block quote.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/definition_lists.rs b/pulldown-cmark/tests/suite/definition_lists.rs index a3437862..03d28e7c 100644 --- a/pulldown-cmark/tests/suite/definition_lists.rs +++ b/pulldown-cmark/tests/suite/definition_lists.rs @@ -19,7 +19,7 @@ orange "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -44,7 +44,7 @@ orange "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -61,7 +61,7 @@ fn definition_lists_test_3() { "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -80,7 +80,7 @@ orange "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -105,7 +105,7 @@ orange "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -144,7 +144,7 @@ crisp, pleasant to taste

    "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -166,7 +166,7 @@ fn definition_lists_test_7() { "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -189,7 +189,7 @@ orange "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -223,7 +223,7 @@ orange "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -261,7 +261,7 @@ fruit

    "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -300,7 +300,7 @@ chili's "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -320,7 +320,7 @@ pomegranate "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -341,7 +341,7 @@ c "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -363,7 +363,7 @@ bim "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -385,7 +385,7 @@ Bloze

    Bloze

    "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -400,7 +400,7 @@ Bloze

    Bloze

    "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -417,7 +417,7 @@ Bloze

    Bloze

    "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -460,7 +460,7 @@ bar : baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -506,7 +506,7 @@ fn definition_lists_test_19() { "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -521,7 +521,7 @@ fn definition_lists_test_20() { "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -543,7 +543,7 @@ Test|Table "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -556,7 +556,7 @@ fn definition_lists_test_22() {

    : first

    "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -576,7 +576,7 @@ My section

    : fourth

    "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -588,7 +588,7 @@ fn definition_lists_test_24() {

    : first

    "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -607,7 +607,7 @@ fn definition_lists_test_25() {

    : fourth

    "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -621,7 +621,7 @@ fn definition_lists_test_26() { "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -640,7 +640,7 @@ third "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -663,7 +663,7 @@ first : fourth "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -687,7 +687,7 @@ third "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -722,7 +722,7 @@ level three "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -734,5 +734,5 @@ fn definition_lists_test_31() { let expected = r##"

    :

    "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } diff --git a/pulldown-cmark/tests/suite/footnotes.rs b/pulldown-cmark/tests/suite/footnotes.rs index cc80392e..3cb08c5e 100644 --- a/pulldown-cmark/tests/suite/footnotes.rs +++ b/pulldown-cmark/tests/suite/footnotes.rs @@ -15,7 +15,7 @@ fn footnotes_test_1() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -34,7 +34,7 @@ Yes it goes on and on my friends. "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -77,7 +77,7 @@ fn footnotes_test_4() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -114,7 +114,7 @@ fn footnotes_test_5() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -138,7 +138,7 @@ d

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -161,7 +161,7 @@ I had largely given over my inquiries into what Professor Angell called the "Cth "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -180,7 +180,7 @@ If a woodchuck could chuck wood.

    Forms of entertainment that aren't childish

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -213,7 +213,7 @@ fn footnotes_test_9() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -233,7 +233,7 @@ As such, we can guarantee that the non-childish forms of entertainment are proba

    As such, we can guarantee that the non-childish forms of entertainment are probably more entertaining to adults, since, having had a whole childhood doing the childish ones, the non-childish ones are merely the ones that haven't gotten boring yet.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -277,7 +277,7 @@ fn footnotes_test_11() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -293,7 +293,7 @@ fn footnotes_test_12() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -312,7 +312,7 @@ fn footnotes_test_13() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -336,7 +336,7 @@ An unordered list before the footnotes: "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -393,7 +393,7 @@ Songs that simply loop are a popular way to annoy people. [^examples3] "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -431,7 +431,7 @@ test suite into pulldown-cmark should be fine.

    [otherlink1]: https://github.com/github/cmark-gfm/blob/1e230827a584ebc9938c3eadc5059c55ef3c9abf/test/extensions.txt#L702

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -456,7 +456,7 @@ fn main() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -470,7 +470,7 @@ fn footnotes_test_18() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -494,7 +494,7 @@ fn footnotes_test_19() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -556,7 +556,7 @@ Second 2 test

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -568,7 +568,7 @@ fn footnotes_test_21() { let expected = r##"

    Test ^ link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -608,7 +608,7 @@ second fourth]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -623,7 +623,7 @@ fn footnotes_test_23() {

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -644,7 +644,7 @@ footnote [^quux]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -663,7 +663,7 @@ fn footnotes_test_25() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -682,5 +682,5 @@ fn footnotes_test_26() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/gfm_strikethrough.rs b/pulldown-cmark/tests/suite/gfm_strikethrough.rs index 23c332d8..e1a6504a 100644 --- a/pulldown-cmark/tests/suite/gfm_strikethrough.rs +++ b/pulldown-cmark/tests/suite/gfm_strikethrough.rs @@ -10,7 +10,7 @@ fn gfm_strikethrough_test_1() { let expected = r##"

    Hi Hello, there world!

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -23,7 +23,7 @@ new paragraph~~.

    new paragraph~~.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -33,5 +33,5 @@ fn gfm_strikethrough_test_3() { let expected = r##"

    This will ~~~not~~~ strike.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/gfm_table.rs b/pulldown-cmark/tests/suite/gfm_table.rs index 3be2ad9d..e8ef4973 100644 --- a/pulldown-cmark/tests/suite/gfm_table.rs +++ b/pulldown-cmark/tests/suite/gfm_table.rs @@ -25,7 +25,7 @@ fn gfm_table_test_1() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -50,7 +50,7 @@ bar | baz "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -77,7 +77,7 @@ fn gfm_table_test_3() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -106,7 +106,7 @@ fn gfm_table_test_4() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -139,7 +139,7 @@ bar

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -153,7 +153,7 @@ fn gfm_table_test_6() { | bar |

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -183,7 +183,7 @@ fn gfm_table_test_7() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -202,7 +202,7 @@ fn gfm_table_test_8() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -229,5 +229,5 @@ fn gfm_table_test_9() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/gfm_tasklist.rs b/pulldown-cmark/tests/suite/gfm_tasklist.rs index 00252509..c25fa465 100644 --- a/pulldown-cmark/tests/suite/gfm_tasklist.rs +++ b/pulldown-cmark/tests/suite/gfm_tasklist.rs @@ -16,7 +16,7 @@ bar "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -41,5 +41,5 @@ bim "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/heading_attrs.rs b/pulldown-cmark/tests/suite/heading_attrs.rs index 7047ce54..2336594b 100644 --- a/pulldown-cmark/tests/suite/heading_attrs.rs +++ b/pulldown-cmark/tests/suite/heading_attrs.rs @@ -20,7 +20,7 @@ multiple! {.myclass1 myattr #myh3 otherattr=value .myclass2}

    multiple!

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -36,7 +36,7 @@ fn heading_attrs_test_2() {

    multiple!

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -53,7 +53,7 @@ fn heading_attrs_test_3() {

    non-attribute-block {#id4}

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -65,7 +65,7 @@ fn heading_attrs_test_4() {

    tabs

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -77,7 +77,7 @@ nextline

    nextline

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -99,7 +99,7 @@ nextline {.class}

    ](https://example.com/) {#myid3}

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -114,7 +114,7 @@ cont "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -133,7 +133,7 @@ fn heading_attrs_test_8() { } "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -145,7 +145,7 @@ fn heading_attrs_test_9() {

    recommended style with spaces

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -159,7 +159,7 @@ fn heading_attrs_test_10() {

    H3

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -171,7 +171,7 @@ fn heading_attrs_test_11() {

    H2

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -183,7 +183,7 @@ fn heading_attrs_test_12() {

    H2 {#id2

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -195,7 +195,7 @@ fn heading_attrs_test_13() {

    H2 #id2}

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -207,7 +207,7 @@ fn heading_attrs_test_14() {

    H2 {#id2}

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -225,7 +225,7 @@ fn heading_attrs_test_15() {
    text
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -235,7 +235,7 @@ fn heading_attrs_test_16() { let expected = r##"

    H1

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -245,7 +245,7 @@ fn heading_attrs_test_17() { let expected = r##"

    H1

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -255,7 +255,7 @@ fn heading_attrs_test_18() { let expected = r##"

    H1

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -267,7 +267,7 @@ fn heading_attrs_test_19() {

    H2

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -279,7 +279,7 @@ fn heading_attrs_test_20() {

    H2

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -289,7 +289,7 @@ fn heading_attrs_test_21() { let expected = r##"

    Header

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -299,7 +299,7 @@ fn heading_attrs_test_22() { let expected = r##"

    Header

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -311,7 +311,7 @@ fn heading_attrs_test_23() {

    H2 {.foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -321,7 +321,7 @@ fn heading_attrs_test_24() { let expected = r##"

    H1 {.foo}bar}

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -331,7 +331,7 @@ fn heading_attrs_test_25() { let expected = r##"

    H1 {foo}

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -341,7 +341,7 @@ fn heading_attrs_test_26() { let expected = r##"

    H1 {.foo}

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -354,7 +354,7 @@ fn heading_attrs_test_27() { .bar} "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -368,7 +368,7 @@ fn heading_attrs_test_28() {

    H2 {}

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -378,7 +378,7 @@ fn heading_attrs_test_29() { let expected = r##"

    H2 {}

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -396,7 +396,7 @@ newline can be used for setext heading { } "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -410,7 +410,7 @@ fn heading_attrs_test_31() {

    stray backslash at the end is preserved \

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -428,7 +428,7 @@ stray backslash at the end is preserved \

    stray backslash at the end is preserved \

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -442,7 +442,7 @@ fn heading_attrs_test_33() {

    H3

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -461,7 +461,7 @@ H2-2 {#foo**bar**baz}

    H2-2

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -475,7 +475,7 @@ fn heading_attrs_test_35() {

    H3

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -487,7 +487,7 @@ fn heading_attrs_test_36() {

    H2

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -499,7 +499,7 @@ fn heading_attrs_test_37() {

    H1

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -518,7 +518,7 @@ fn heading_attrs_test_38() {

    #{}

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -545,7 +545,7 @@ fn heading_attrs_test_39() {

    {}

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -565,7 +565,7 @@ fn heading_attrs_test_40() {

    vertical tab

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -580,7 +580,7 @@ fn heading_attrs_test_41() {

    vertical tab (U+000B)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -592,5 +592,5 @@ fn heading_attrs_test_42() {

    IDEOGRAPHIC SPACE (U+3000)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/math.rs b/pulldown-cmark/tests/suite/math.rs index 4f3afb72..c774c58b 100644 --- a/pulldown-cmark/tests/suite/math.rs +++ b/pulldown-cmark/tests/suite/math.rs @@ -15,7 +15,7 @@ $\sum_{k=1}^n a_k b_k$: Mathematical expression at head of line

    \ may follow just after the first $: \{1, 2, 3\}

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -28,7 +28,7 @@ $$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \

    \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -41,7 +41,7 @@ $$$$

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -57,7 +57,7 @@ $$x$$$$$$y$$

    xy$$

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -82,7 +82,7 @@ $α$

    &alpha;

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -95,7 +95,7 @@ Dollar at end of line$

    Dollar at end of line$

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -112,7 +112,7 @@ $$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -126,7 +126,7 @@ hard break either

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -139,7 +139,7 @@ $$y = \$ x$$

    y = \$ x

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -152,7 +152,7 @@ $$ $ $$

    $$ $ $$

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -162,7 +162,7 @@ fn math_test_11() { let expected = r##"

    alpha$betagamma$$delta

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -190,7 +190,7 @@ they should not allow inlines to do that $$2 + *

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -200,7 +200,7 @@ fn math_test_13() { let expected = r##"

    these are math texts: fooy=xbar and y=xbar and fooy=x bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -216,7 +216,7 @@ braces: ($x=y$) [$x=y$] {$x=y$}

    braces: (x=y) [x=y] {x=y}

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -226,7 +226,7 @@ fn math_test_15() { let expected = r##"

    x=y

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -245,7 +245,7 @@ $$a$$$$b$$

    ab

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -264,7 +264,7 @@ $$ Display `first $$ then` code

    Code $$ first then $$ display

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -288,7 +288,7 @@ $$ x + y "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -311,7 +311,7 @@ not

    $$

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -334,7 +334,7 @@ math$ "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -354,7 +354,7 @@ And this is inline math: \text{Hello $x$ there!}

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -379,7 +379,7 @@ Math environment contains y: $x {$ $ } $y$

    Math environment contains y: $x {$ $ } y

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -412,7 +412,7 @@ and expected to be as short as possible:

    \text{first $$ second}$$

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -434,7 +434,7 @@ $}$] $$

    $}$] $$

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -444,7 +444,7 @@ fn math_test_25() { let expected = r##"

    x `y`

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -486,7 +486,7 @@ b "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -500,7 +500,7 @@ fn math_test_27() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -523,7 +523,7 @@ A = 5 "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -536,7 +536,7 @@ $$aa<b

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -551,7 +551,7 @@ fn math_test_30() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -563,7 +563,7 @@ fn math_test_31() {

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -579,7 +579,7 @@ fn math_test_32() {

    1x

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -595,7 +595,7 @@ _$a$ equals $b$_

    a equals b

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -618,7 +618,7 @@ a "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -628,7 +628,7 @@ fn math_test_35() { let expected = r##"

    \{a\,b\}

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -644,7 +644,7 @@ ${a}_b c_{d}$

    {a}_b c_{d}

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -656,7 +656,7 @@ $$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$ x = {-b \pm \sqrt{b^2-4ac} \over 2a}

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -666,7 +666,7 @@ fn math_test_38() { let expected = r##"

    x = \$

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -676,7 +676,7 @@ fn math_test_39() { let expected = r##"

    Equation \Omega(69) in italic text

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -700,7 +700,7 @@ fn math_test_40() {

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -716,7 +716,7 @@ fn math_test_41() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -732,7 +732,7 @@ fn math_test_42() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -770,7 +770,7 @@ fn math_test_43() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -790,7 +790,7 @@ improperly }{ nested But this still isn't, because the braces are still counted: $}{$

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -819,7 +819,7 @@ another improperly nested example }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -853,7 +853,7 @@ fn math_test_46() { {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{ 255 brace pairs and one unclosed brace

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -915,5 +915,5 @@ fn math_test_47() { }}}}}}}}}}}}}}}{$ 255 close braces and one open brace

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/metadata_blocks.rs b/pulldown-cmark/tests/suite/metadata_blocks.rs index 93dbc885..aa27615c 100644 --- a/pulldown-cmark/tests/suite/metadata_blocks.rs +++ b/pulldown-cmark/tests/suite/metadata_blocks.rs @@ -12,7 +12,7 @@ another_field: 0 "##; let expected = r##""##; - test_markdown_html(original, expected, false, true, false, false, false, false); + test_markdown_html(original, expected, false, true, false, false, false, false, false); } #[test] @@ -26,7 +26,7 @@ another_field: 0 another_field: 0

    "##; - test_markdown_html(original, expected, false, true, false, false, false, false); + test_markdown_html(original, expected, false, true, false, false, false, false, false); } #[test] @@ -38,7 +38,7 @@ fn metadata_blocks_test_3() {
    "##; - test_markdown_html(original, expected, false, true, false, false, false, false); + test_markdown_html(original, expected, false, true, false, false, false, false, false); } #[test] @@ -54,7 +54,7 @@ another_field: 0 another_field: 0 "##; - test_markdown_html(original, expected, false, true, false, false, false, false); + test_markdown_html(original, expected, false, true, false, false, false, false, false); } #[test] @@ -70,7 +70,7 @@ another_field: 0 another_field: 0 "##; - test_markdown_html(original, expected, false, true, false, false, false, false); + test_markdown_html(original, expected, false, true, false, false, false, false, false); } #[test] @@ -85,7 +85,7 @@ another_field: 0 let expected = r##"

    My paragraph here.

    "##; - test_markdown_html(original, expected, false, true, false, false, false, false); + test_markdown_html(original, expected, false, true, false, false, false, false, false); } #[test] @@ -105,7 +105,7 @@ another_field: 0 another_field: 0 "##; - test_markdown_html(original, expected, false, true, false, false, false, false); + test_markdown_html(original, expected, false, true, false, false, false, false, false); } #[test] @@ -126,7 +126,7 @@ another_field: 0 ---a

    "##; - test_markdown_html(original, expected, false, true, false, false, false, false); + test_markdown_html(original, expected, false, true, false, false, false, false, false); } #[test] @@ -138,7 +138,7 @@ another_field: 0 "##; let expected = r##""##; - test_markdown_html(original, expected, false, true, false, false, false, false); + test_markdown_html(original, expected, false, true, false, false, false, false, false); } #[test] @@ -150,7 +150,7 @@ another_field: 0 "##; let expected = r##""##; - test_markdown_html(original, expected, false, true, false, false, false, false); + test_markdown_html(original, expected, false, true, false, false, false, false, false); } #[test] @@ -165,7 +165,7 @@ Things "##; - test_markdown_html(original, expected, false, true, false, false, false, false); + test_markdown_html(original, expected, false, true, false, false, false, false, false); } #[test] @@ -177,5 +177,5 @@ fn metadata_blocks_test_12() { "##; let expected = r##""##; - test_markdown_html(original, expected, false, true, false, false, false, false); + test_markdown_html(original, expected, false, true, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/old_footnotes.rs b/pulldown-cmark/tests/suite/old_footnotes.rs index 316b236a..314610bb 100644 --- a/pulldown-cmark/tests/suite/old_footnotes.rs +++ b/pulldown-cmark/tests/suite/old_footnotes.rs @@ -15,7 +15,7 @@ fn old_footnotes_test_1() { "##; - test_markdown_html(original, expected, false, false, true, false, false, false); + test_markdown_html(original, expected, false, false, true, false, false, false, false); } #[test] @@ -34,7 +34,7 @@ Yes it goes on and on my friends. "##; - test_markdown_html(original, expected, false, false, true, false, false, false); + test_markdown_html(original, expected, false, false, true, false, false, false, false); } #[test] @@ -71,7 +71,7 @@ I had largely given over my inquiries into what Professor Angell called the "Cth

    I had largely given over my inquiries into what Professor Angell called the "Cthulhu Cult", and was visiting a learned friend in Paterson, New Jersey; the curator of a local museum and a mineralogist of note. Examining one day the reserve specimens roughly set on the storage shelves in a rear room of the museum, my eye was caught by an odd picture in one of the old papers spread beneath the stones. It was the Sydney Bulletin I have mentioned, for my friend had wide affiliations in all conceivable foreign parts; and the picture was a half-tone cut of a hideous stone image almost identical with that which Legrasse had found in the swamp.

    "##; - test_markdown_html(original, expected, false, false, true, false, false, false); + test_markdown_html(original, expected, false, false, true, false, false, false, false); } #[test] @@ -90,7 +90,7 @@ If a woodchuck could chuck wood.

    Forms of entertainment that aren't childish

    "##; - test_markdown_html(original, expected, false, false, true, false, false, false); + test_markdown_html(original, expected, false, false, true, false, false, false, false); } #[test] @@ -110,7 +110,7 @@ As such, we can guarantee that the non-childish forms of entertainment are proba

    As such, we can guarantee that the non-childish forms of entertainment are probably more entertaining to adults, since, having had a whole childhood doing the childish ones, the non-childish ones are merely the ones that haven't gotten boring yet.

    "##; - test_markdown_html(original, expected, false, false, true, false, false, false); + test_markdown_html(original, expected, false, false, true, false, false, false, false); } #[test] @@ -144,7 +144,7 @@ fn old_footnotes_test_7() { "##; - test_markdown_html(original, expected, false, false, true, false, false, false); + test_markdown_html(original, expected, false, false, true, false, false, false, false); } #[test] @@ -159,7 +159,7 @@ fn old_footnotes_test_8() {
    2

    Common for people practicing music.

    "##; - test_markdown_html(original, expected, false, false, true, false, false, false); + test_markdown_html(original, expected, false, false, true, false, false, false, false); } #[test] @@ -173,7 +173,7 @@ fn old_footnotes_test_9() { let expected = r##"

    [Reference to footnotes A1, B2 and C3.

    1

    Footnote A.

    2

    Footnote B.

    3

    Footnote C.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -192,7 +192,7 @@ fn old_footnotes_test_10() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -211,5 +211,5 @@ fn old_footnotes_test_11() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/regression.rs b/pulldown-cmark/tests/suite/regression.rs index 12e98f53..5a3422ac 100644 --- a/pulldown-cmark/tests/suite/regression.rs +++ b/pulldown-cmark/tests/suite/regression.rs @@ -16,7 +16,7 @@ This is a test of the details element. "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -31,7 +31,7 @@ fn regression_test_2() { let expected = r##"

    see the many articles on QuickCheck.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -48,7 +48,7 @@ fn regression_test_3() { debug-stub-derive on docs.rs

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -69,7 +69,7 @@ fn regression_test_4() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -79,7 +79,7 @@ fn regression_test_5() { let expected = r##"

    foo§(bar)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -89,7 +89,7 @@ fn regression_test_6() { let expected = r##"

    https://example.com hello

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -103,7 +103,7 @@ fn regression_test_7() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -130,7 +130,7 @@ fn regression_test_8() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -144,7 +144,7 @@ i8 let expected = r##"

    i8

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -156,7 +156,7 @@ fn regression_test_10() { let expected = r##"

    a

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -168,7 +168,7 @@ fn regression_test_11() { let expected = r##"

    a

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -181,7 +181,7 @@ fn regression_test_12() {

    [a]: /url (title))

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -194,7 +194,7 @@ b

    b

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -205,7 +205,7 @@ foo let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -215,7 +215,7 @@ fn regression_test_15() { let expected = r##"

    `foo`

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -227,7 +227,7 @@ bar bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -240,7 +240,7 @@ fn regression_test_17() {

    1) bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -262,7 +262,7 @@ fn regression_test_18() {

    1)2)3)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -272,7 +272,7 @@ fn regression_test_19() { let expected = r##"

    [](<<>)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -282,7 +282,7 @@ fn regression_test_20() { let expected = r##"

    `foo``bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -292,7 +292,7 @@ fn regression_test_21() { let expected = r##"

    \foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -304,7 +304,7 @@ YOLO let expected = r##"

    YOLO

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -320,7 +320,7 @@ A | B foo | bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -334,7 +334,7 @@ foo|bar "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -348,7 +348,7 @@ foo|bar "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -358,7 +358,7 @@ fn regression_test_26() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -368,7 +368,7 @@ fn regression_test_27() { let expected = r##"

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -378,7 +378,7 @@ fn regression_test_28() { let expected = r##"

    http://example.com

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -388,7 +388,7 @@ fn regression_test_29() { let expected = r##"

    http://one http://two

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -403,7 +403,7 @@ some text

    some text

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -424,7 +424,7 @@ fn regression_test_31() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -439,7 +439,7 @@ x

    ]: f

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -449,7 +449,7 @@ fn regression_test_33() { let expected = r##"

    [foo]:

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -464,7 +464,7 @@ fn regression_test_34() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -479,7 +479,7 @@ yolo | swag

    yolo | swag

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -489,7 +489,7 @@ fn regression_test_36() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -501,7 +501,7 @@ fn regression_test_37() { "hi">

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -514,7 +514,7 @@ __a__

    a

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -527,7 +527,7 @@ fn regression_test_39() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -537,7 +537,7 @@ fn regression_test_40() { let expected = r##"

    \|

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -550,7 +550,7 @@ Paragraph 2

    Paragraph 2

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -560,7 +560,7 @@ fn regression_test_42() { let expected = r##"

    [link text]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -572,7 +572,7 @@ fn regression_test_43() { let expected = r##"
    foobar
    [a](<url>)
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -586,7 +586,7 @@ fn regression_test_44() {

    ")

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -599,7 +599,7 @@ fn regression_test_45() {

    )

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -612,7 +612,7 @@ fn regression_test_46() {

    ")

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -622,7 +622,7 @@ fn regression_test_47() { let expected = r##"

    <http:// >

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -632,7 +632,7 @@ fn regression_test_48() { let expected = r##"

    <http://>

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -651,7 +651,7 @@ fn regression_test_49() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -670,7 +670,7 @@ fn regression_test_50() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -680,7 +680,7 @@ fn regression_test_51() { let expected = r##"

    *hi_

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -690,7 +690,7 @@ fn regression_test_52() { let expected = r##"

    email: john@example.com_

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -704,7 +704,7 @@ bar">link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -719,7 +719,7 @@ fn regression_test_54() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -735,7 +735,7 @@ bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -753,7 +753,7 @@ fn regression_test_56() {

    a b c

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -770,7 +770,7 @@ fn regression_test_57() {

    [a b] [a > b]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -783,7 +783,7 @@ package`] let expected = r##"

    cargo package

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -798,7 +798,7 @@ fn regression_test_59() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -811,7 +811,7 @@ fn regression_test_60() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -827,7 +827,7 @@ the size of usize and have the same alignment.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -851,7 +851,7 @@ An unordered list before the footnotes: "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -869,7 +869,7 @@ fn regression_test_63() {

    assimp-rs

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -914,7 +914,7 @@ fn regression_test_64() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -924,7 +924,7 @@ fn regression_test_65() { let expected = r##"

    <foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -942,7 +942,7 @@ lo">

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -953,7 +953,7 @@ fn regression_test_67() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -975,7 +975,7 @@ a 2. a

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -991,7 +991,7 @@ fn regression_test_69() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1010,7 +1010,7 @@ bar

    baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1029,7 +1029,7 @@ fn regression_test_71() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1041,7 +1041,7 @@ fn regression_test_72() { let expected = r##"

    []]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1051,7 +1051,7 @@ fn regression_test_73() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1061,7 +1061,7 @@ fn regression_test_74() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1071,7 +1071,7 @@ fn regression_test_75() { let expected = r##"

    emphasis strike strong strike emphasis strong

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1081,7 +1081,7 @@ fn regression_test_76() { let expected = r##"

    emphasis strike strong strike emphasis strong code

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1091,7 +1091,7 @@ fn regression_test_77() { let expected = r##"

    emphasis strike code strike emphasis strong

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1101,7 +1101,7 @@ fn regression_test_78() { let expected = r##"

    emphasis strike code strike emphasis strong code

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1111,7 +1111,7 @@ fn regression_test_79() { let expected = r##"

    strong strike emphasis strike emphasis strong

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1121,7 +1121,7 @@ fn regression_test_80() { let expected = r##"

    strong strike emphasis strike emphasis strong code

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1131,7 +1131,7 @@ fn regression_test_81() { let expected = r##"

    strong strike code strike emphasis strong

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1141,7 +1141,7 @@ fn regression_test_82() { let expected = r##"

    strong strike code strike emphasis strong code

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1234,7 +1234,7 @@ fn regression_test_83() { | baz | alef |

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1244,7 +1244,7 @@ fn regression_test_84() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1254,7 +1254,7 @@ fn regression_test_85() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1264,7 +1264,7 @@ fn regression_test_86() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1326,7 +1326,7 @@ fn regression_test_87() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1339,7 +1339,7 @@ b

    b

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1353,7 +1353,7 @@ fn regression_test_89() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1367,7 +1367,7 @@ fn regression_test_90() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1379,7 +1379,7 @@ fn regression_test_91() {

    b

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1390,7 +1390,7 @@ fn regression_test_92() { let expected = r##"

    a\

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1403,7 +1403,7 @@ fn regression_test_93() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1415,7 +1415,7 @@ fn regression_test_94() {
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1427,7 +1427,7 @@ fn regression_test_95() { > "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1439,7 +1439,7 @@ fn regression_test_96() {

    quote

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1451,7 +1451,7 @@ fn regression_test_97() { > not quote "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1463,7 +1463,7 @@ fn regression_test_98() {

    quote

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1475,7 +1475,7 @@ fn regression_test_99() { >not quote "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1494,7 +1494,7 @@ fn regression_test_100() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1504,7 +1504,7 @@ fn regression_test_101() { let expected = r##"

    *R]-

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1514,7 +1514,7 @@ fn regression_test_102() { let expected = r##"

    foobarbaz**

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1528,7 +1528,7 @@ fn regression_test_103() { %

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1542,7 +1542,7 @@ fn regression_test_104() { %

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1552,7 +1552,7 @@ fn regression_test_105() { let expected = r##"

    <@1>

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1566,7 +1566,7 @@ Things let expected = r##"

    Things

    "##; - test_markdown_html(original, expected, false, true, false, false, false, false); + test_markdown_html(original, expected, false, true, false, false, false, false, false); } #[test] @@ -1581,7 +1581,7 @@ Things let expected = r##"

    Things

    "##; - test_markdown_html(original, expected, false, true, false, false, false, false); + test_markdown_html(original, expected, false, true, false, false, false, false, false); } #[test] @@ -1595,7 +1595,7 @@ Things let expected = r##"

    Things

    "##; - test_markdown_html(original, expected, false, true, false, false, false, false); + test_markdown_html(original, expected, false, true, false, false, false, false, false); } #[test] @@ -1619,7 +1619,7 @@ fn regression_test_109() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1634,7 +1634,7 @@ fn regression_test_110() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1644,7 +1644,7 @@ fn regression_test_111() { let expected = r##"

    j*5=

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1710,7 +1710,7 @@ Table "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1723,7 +1723,7 @@ fn regression_test_113() {

    [x]: (

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1745,7 +1745,7 @@ an unmatched asterisk.

    {{

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1755,7 +1755,7 @@ fn regression_test_115() { let expected = r##"

    *a.*.a..

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1774,7 +1774,7 @@ _*xx-_-

    *xx--

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1803,7 +1803,7 @@ fn regression_test_117() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1832,7 +1832,7 @@ fn regression_test_118() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1845,7 +1845,7 @@ fn regression_test_119() {

    ]: https://rust-lang.org

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1878,7 +1878,7 @@ fn regression_test_120() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1921,7 +1921,7 @@ The second hyphen should parse the same way in both samples. "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1936,7 +1936,7 @@ https://rust-lang.org "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1949,7 +1949,7 @@ Second try]: https://rust-lang.org

    Second try]: https://rust-lang.org

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1972,7 +1972,7 @@ fn regression_test_124() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1984,7 +1984,7 @@ bar \

    bar \

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1998,7 +1998,7 @@ fn regression_test_126() {

    [third try]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2018,7 +2018,7 @@ bar "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2040,7 +2040,7 @@ fn regression_test_128() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2051,7 +2051,7 @@ fn regression_test_129() { let expected = r##"

    -

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2068,7 +2068,7 @@ foo) "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2085,7 +2085,7 @@ fn regression_test_131() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2104,7 +2104,7 @@ fn regression_test_132() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2125,7 +2125,7 @@ fn regression_test_133() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2136,7 +2136,7 @@ fn regression_test_134() { let expected = r##"

    - baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2154,7 +2154,7 @@ GFM footnotes can interrupt link defs if they have three spaces, but not four.

    GFM footnotes can interrupt link defs if they have three spaces, but not four.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2171,7 +2171,7 @@ Setext heading can interrupt link def if it has three spaces, but not four.

    Setext heading can interrupt link def if it has three spaces, but not four.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2191,7 +2191,7 @@ List can interrupt the paragraph at the start of a link definition if it starts

    List can interrupt the paragraph at the start of a link definition if it starts with three spaces, but not four.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2210,7 +2210,7 @@ second]

    second]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2228,7 +2228,7 @@ second] second

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2245,7 +2245,7 @@ fn regression_test_140() {

    first

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2262,7 +2262,7 @@ fn regression_test_141() { ">first

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2281,7 +2281,7 @@ fn regression_test_142() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2300,7 +2300,7 @@ fn regression_test_143() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2319,7 +2319,7 @@ fn regression_test_144() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2336,7 +2336,7 @@ fn regression_test_145() { ">first

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2355,7 +2355,7 @@ fn regression_test_146() {

    first

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2366,7 +2366,7 @@ fn regression_test_147() { let expected = r##"

    'foo'bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2382,7 +2382,7 @@ fn regression_test_148() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2398,7 +2398,7 @@ a]: https://example.com let expected = r##"

    a b

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2419,7 +2419,7 @@ fn regression_test_150() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2441,7 +2441,7 @@ baz* "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2463,7 +2463,7 @@ baz` "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2485,7 +2485,7 @@ baz](https://example.com) "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2500,7 +2500,7 @@ part of the title' part of the title">mylink

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2517,7 +2517,7 @@ starts in column three. "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2531,7 +2531,7 @@ fn regression_test_156() {

    This is not in the list at all. It's a paragraph after it.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2543,7 +2543,7 @@ fn regression_test_157() { let expected = r##"

    \!\&quot;\#\$\%\& \!\&quot;\#\$\%\& \!\&quot;\#\$\%\&

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2555,7 +2555,7 @@ fn regression_test_158() { -|- *

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2568,7 +2568,7 @@ fn regression_test_159() {

    Another paragraph whose spaces must be removed.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2583,7 +2583,7 @@ fn regression_test_160() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2598,7 +2598,7 @@ fn regression_test_161() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2608,7 +2608,7 @@ fn regression_test_162() { let expected = r##"

    &#00000000; &#x0000000;

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2618,7 +2618,7 @@ fn regression_test_163() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2634,7 +2634,7 @@ t_ "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2650,7 +2650,7 @@ N* "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2661,7 +2661,7 @@ fn regression_test_166() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2672,7 +2672,7 @@ fn regression_test_167() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2683,7 +2683,7 @@ fn regression_test_168() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2699,7 +2699,7 @@ fn regression_test_169() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2718,7 +2718,7 @@ fn regression_test_170() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2734,7 +2734,7 @@ fn regression_test_171() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2750,7 +2750,7 @@ fn regression_test_172() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2766,7 +2766,7 @@ fn regression_test_173() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2782,7 +2782,7 @@ fn regression_test_174() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2800,7 +2800,7 @@ fn regression_test_175() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2813,7 +2813,7 @@ fn regression_test_176() {

    [link]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2826,7 +2826,7 @@ fn regression_test_177() {

    [link]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2838,7 +2838,7 @@ fn regression_test_178() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2851,7 +2851,7 @@ fn regression_test_179() {

    [link]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2863,7 +2863,7 @@ fn regression_test_180() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2876,7 +2876,7 @@ fn regression_test_181() {

    [link]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2888,7 +2888,7 @@ fn regression_test_182() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2906,7 +2906,7 @@ fn regression_test_183() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2920,7 +2920,7 @@ test2

    test2

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2936,7 +2936,7 @@ test2 "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2953,7 +2953,7 @@ fn regression_test_186() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2973,7 +2973,7 @@ fn regression_test_187() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2986,7 +2986,7 @@ fn regression_test_188() {

    <!p>

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2998,7 +2998,7 @@ fn regression_test_189() { let expected = r##"

    linky

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3014,7 +3014,7 @@ junk

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3026,7 +3026,7 @@ fn regression_test_191() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3037,7 +3037,7 @@ fn regression_test_192() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3051,7 +3051,7 @@ fn regression_test_193() { text ">link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3069,7 +3069,7 @@ _** "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3084,7 +3084,7 @@ fn regression_test_195() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3097,7 +3097,7 @@ fn regression_test_196() {

    --

    "##; - test_markdown_html(original, expected, false, true, false, false, false, false); + test_markdown_html(original, expected, false, true, false, false, false, false, false); } #[test] @@ -3109,7 +3109,7 @@ fn regression_test_197() { [40](https://rust.org/something%3A((((((((((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))))))))))

    "##; - test_markdown_html(original, expected, false, true, false, false, false, false); + test_markdown_html(original, expected, false, true, false, false, false, false, false); } #[test] @@ -3124,7 +3124,7 @@ fn regression_test_198() {

    \

    "##; - test_markdown_html(original, expected, false, true, false, false, false, false); + test_markdown_html(original, expected, false, true, false, false, false, false, false); } #[test] @@ -3140,7 +3140,7 @@ bar

    bar

    "##; - test_markdown_html(original, expected, false, true, false, false, false, false); + test_markdown_html(original, expected, false, true, false, false, false, false, false); } #[test] @@ -3151,7 +3151,7 @@ fn regression_test_200() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3169,7 +3169,7 @@ fn regression_test_201() { "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -3188,7 +3188,7 @@ fn regression_test_202() { "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -3212,7 +3212,7 @@ T U, V W
    x:.)
    "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -3234,7 +3234,7 @@ Some preamble foobar_raz, not barfoo_raz

    > Something is wrong!

    "##; - test_markdown_html(original, expected, false, false, false, false, false, true); + test_markdown_html(original, expected, false, false, false, false, false, true, false); } #[test] @@ -3251,7 +3251,7 @@ stuff](https://example.com) "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3300,7 +3300,7 @@ fn regression_test_206() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3313,7 +3313,7 @@ fn regression_test_207() { > "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3323,7 +3323,7 @@ fn regression_test_208() { let expected = r##"

    Link

    "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } #[test] @@ -3337,7 +3337,7 @@ fn regression_test_209() { "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } #[test] @@ -3365,7 +3365,7 @@ fn regression_test_210() { "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } #[test] @@ -3377,5 +3377,5 @@ fn regression_test_211() { let expected = r##"

    :

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/smart_punct.rs b/pulldown-cmark/tests/suite/smart_punct.rs index 97f37c27..7823b476 100644 --- a/pulldown-cmark/tests/suite/smart_punct.rs +++ b/pulldown-cmark/tests/suite/smart_punct.rs @@ -12,7 +12,7 @@ fn smart_punct_test_1() { “‘Shelob’ is my name.”

    "##; - test_markdown_html(original, expected, true, false, false, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false, false, false); } #[test] @@ -22,7 +22,7 @@ fn smart_punct_test_2() { let expected = r##"

    ‘A’, ‘B’, and ‘C’ are letters.

    "##; - test_markdown_html(original, expected, true, false, false, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false, false, false); } #[test] @@ -34,7 +34,7 @@ So is 'pine.' So is ‘pine.’

    "##; - test_markdown_html(original, expected, true, false, false, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false, false, false); } #[test] @@ -44,7 +44,7 @@ fn smart_punct_test_4() { let expected = r##"

    ‘He said, “I want to go.”’

    "##; - test_markdown_html(original, expected, true, false, false, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false, false, false); } #[test] @@ -54,7 +54,7 @@ fn smart_punct_test_5() { let expected = r##"

    Were you alive in the 70’s?

    "##; - test_markdown_html(original, expected, true, false, false, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false, false, false); } #[test] @@ -64,7 +64,7 @@ fn smart_punct_test_6() { let expected = r##"

    Here is some quoted ‘code’ and a “quoted link”.

    "##; - test_markdown_html(original, expected, true, false, false, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false, false, false); } #[test] @@ -74,7 +74,7 @@ fn smart_punct_test_7() { let expected = r##"

    ’tis the season to be ‘jolly’

    "##; - test_markdown_html(original, expected, true, false, false, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false, false, false); } #[test] @@ -84,7 +84,7 @@ fn smart_punct_test_8() { let expected = r##"

    ‘We’ll use Jane’s boat and John’s truck,’ Jenna said.

    "##; - test_markdown_html(original, expected, true, false, false, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false, false, false); } #[test] @@ -97,7 +97,7 @@ fn smart_punct_test_9() {

    “Second paragraph by same speaker, in fiction.”

    "##; - test_markdown_html(original, expected, true, false, false, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false, false, false); } #[test] @@ -107,7 +107,7 @@ fn smart_punct_test_10() { let expected = r##"

    [a]’s b’

    "##; - test_markdown_html(original, expected, true, false, false, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false, false, false); } #[test] @@ -121,7 +121,7 @@ This isn't either. 5'8"

    "##; - test_markdown_html(original, expected, true, false, false, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false, false, false); } #[test] @@ -139,7 +139,7 @@ en – en 2–3

    "##; - test_markdown_html(original, expected, true, false, false, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false, false, false); } #[test] @@ -167,7 +167,7 @@ nine——— thirteen———––.

    "##; - test_markdown_html(original, expected, true, false, false, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false, false, false); } #[test] @@ -177,7 +177,7 @@ fn smart_punct_test_14() { let expected = r##"

    Escaped hyphens: -- ---.

    "##; - test_markdown_html(original, expected, true, false, false, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false, false, false); } #[test] @@ -187,7 +187,7 @@ fn smart_punct_test_15() { let expected = r##"

    Ellipses…and…and….

    "##; - test_markdown_html(original, expected, true, false, false, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false, false, false); } #[test] @@ -197,5 +197,5 @@ fn smart_punct_test_16() { let expected = r##"

    No ellipses...

    "##; - test_markdown_html(original, expected, true, false, false, false, false, false); + test_markdown_html(original, expected, true, false, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/spec.rs b/pulldown-cmark/tests/suite/spec.rs index 1a0488d3..f3c3437a 100644 --- a/pulldown-cmark/tests/suite/spec.rs +++ b/pulldown-cmark/tests/suite/spec.rs @@ -11,7 +11,7 @@ fn spec_test_1() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -22,7 +22,7 @@ fn spec_test_2() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -35,7 +35,7 @@ fn spec_test_3() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -52,7 +52,7 @@ fn spec_test_4() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -70,7 +70,7 @@ fn spec_test_5() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -83,7 +83,7 @@ fn spec_test_6() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -98,7 +98,7 @@ fn spec_test_7() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -111,7 +111,7 @@ bar "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -133,7 +133,7 @@ fn spec_test_9() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -143,7 +143,7 @@ fn spec_test_10() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -153,7 +153,7 @@ fn spec_test_11() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -163,7 +163,7 @@ fn spec_test_12() { let expected = r##"

    !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -173,7 +173,7 @@ fn spec_test_13() { let expected = r##"

    \ \A\a\ \3\φ\«

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -199,7 +199,7 @@ fn spec_test_14() { &ouml; not a character entity

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -209,7 +209,7 @@ fn spec_test_15() { let expected = r##"

    \emphasis

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -221,7 +221,7 @@ bar bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -231,7 +231,7 @@ fn spec_test_17() { let expected = r##"

    \[\`

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -242,7 +242,7 @@ fn spec_test_18() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -255,7 +255,7 @@ fn spec_test_19() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -265,7 +265,7 @@ fn spec_test_20() { let expected = r##"

    https://example.com?find=\*

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -275,7 +275,7 @@ fn spec_test_21() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -285,7 +285,7 @@ fn spec_test_22() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -297,7 +297,7 @@ fn spec_test_23() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -310,7 +310,7 @@ foo "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -324,7 +324,7 @@ fn spec_test_25() { ∲ ≧̸

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -334,7 +334,7 @@ fn spec_test_26() { let expected = r##"

    # Ӓ Ϡ �

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -344,7 +344,7 @@ fn spec_test_27() { let expected = r##"

    " ആ ಫ

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -360,7 +360,7 @@ fn spec_test_28() { &ThisIsNotDefined; &hi?;

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -370,7 +370,7 @@ fn spec_test_29() { let expected = r##"

    &copy

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -380,7 +380,7 @@ fn spec_test_30() { let expected = r##"

    &MadeUpEntity;

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -390,7 +390,7 @@ fn spec_test_31() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -400,7 +400,7 @@ fn spec_test_32() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -412,7 +412,7 @@ fn spec_test_33() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -425,7 +425,7 @@ foo "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -435,7 +435,7 @@ fn spec_test_35() { let expected = r##"

    f&ouml;&ouml;

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -446,7 +446,7 @@ fn spec_test_36() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -458,7 +458,7 @@ fn spec_test_37() { foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -473,7 +473,7 @@ fn spec_test_38() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -485,7 +485,7 @@ fn spec_test_39() { bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -495,7 +495,7 @@ fn spec_test_40() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -505,7 +505,7 @@ fn spec_test_41() { let expected = r##"

    [a](url "tit")

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -519,7 +519,7 @@ fn spec_test_42() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -533,7 +533,7 @@ ___
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -543,7 +543,7 @@ fn spec_test_44() { let expected = r##"

    +++

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -553,7 +553,7 @@ fn spec_test_45() { let expected = r##"

    ===

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -567,7 +567,7 @@ __ __

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -581,7 +581,7 @@ fn spec_test_47() {
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -592,7 +592,7 @@ fn spec_test_48() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -604,7 +604,7 @@ fn spec_test_49() { ***

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -614,7 +614,7 @@ fn spec_test_50() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -624,7 +624,7 @@ fn spec_test_51() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -634,7 +634,7 @@ fn spec_test_52() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -644,7 +644,7 @@ fn spec_test_53() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -654,7 +654,7 @@ fn spec_test_54() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -670,7 +670,7 @@ a------

    ---a---

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -680,7 +680,7 @@ fn spec_test_56() { let expected = r##"

    -

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -698,7 +698,7 @@ fn spec_test_57() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -712,7 +712,7 @@ bar

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -725,7 +725,7 @@ bar

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -743,7 +743,7 @@ fn spec_test_60() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -759,7 +759,7 @@ fn spec_test_61() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -779,7 +779,7 @@ fn spec_test_62() {
    foo
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -789,7 +789,7 @@ fn spec_test_63() { let expected = r##"

    ####### foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -802,7 +802,7 @@ fn spec_test_64() {

    #hashtag

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -812,7 +812,7 @@ fn spec_test_65() { let expected = r##"

    ## foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -822,7 +822,7 @@ fn spec_test_66() { let expected = r##"

    foo bar *baz*

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -832,7 +832,7 @@ fn spec_test_67() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -846,7 +846,7 @@ fn spec_test_68() {

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -857,7 +857,7 @@ fn spec_test_69() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -869,7 +869,7 @@ fn spec_test_70() { # bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -881,7 +881,7 @@ fn spec_test_71() {

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -893,7 +893,7 @@ fn spec_test_72() {
    foo
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -903,7 +903,7 @@ fn spec_test_73() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -913,7 +913,7 @@ fn spec_test_74() { let expected = r##"

    foo ### b

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -923,7 +923,7 @@ fn spec_test_75() { let expected = r##"

    foo#

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -937,7 +937,7 @@ fn spec_test_76() {

    foo #

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -951,7 +951,7 @@ fn spec_test_77() {
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -965,7 +965,7 @@ Bar foo

    Bar foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -979,7 +979,7 @@ fn spec_test_79() {

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -994,7 +994,7 @@ Foo *bar*

    Foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1007,7 +1007,7 @@ baz* baz "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1020,7 +1020,7 @@ baz* baz "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1035,7 +1035,7 @@ Foo

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1054,7 +1054,7 @@ fn spec_test_84() {

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1073,7 +1073,7 @@ Foo
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1084,7 +1084,7 @@ fn spec_test_86() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1096,7 +1096,7 @@ fn spec_test_87() { ---

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1113,7 +1113,7 @@ Foo
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1124,7 +1124,7 @@ fn spec_test_89() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1135,7 +1135,7 @@ fn spec_test_90() { let expected = r##"

    Foo\

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1154,7 +1154,7 @@ of dashes"/>

    of dashes"/>

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1168,7 +1168,7 @@ fn spec_test_92() {
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1184,7 +1184,7 @@ bar "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1198,7 +1198,7 @@ fn spec_test_94() {
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1211,7 +1211,7 @@ Bar Bar "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1229,7 +1229,7 @@ Baz

    Baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1240,7 +1240,7 @@ fn spec_test_97() { let expected = r##"

    ====

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1252,7 +1252,7 @@ fn spec_test_98() {
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1266,7 +1266,7 @@ fn spec_test_99() {
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1279,7 +1279,7 @@ fn spec_test_100() {
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1293,7 +1293,7 @@ fn spec_test_101() {
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1304,7 +1304,7 @@ fn spec_test_102() { let expected = r##"

    > foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1320,7 +1320,7 @@ baz

    baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1338,7 +1338,7 @@ bar

    baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1354,7 +1354,7 @@ bar

    baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1370,7 +1370,7 @@ bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1383,7 +1383,7 @@ fn spec_test_107() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1400,7 +1400,7 @@ fn spec_test_108() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1419,7 +1419,7 @@ fn spec_test_109() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1436,7 +1436,7 @@ fn spec_test_110() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1459,7 +1459,7 @@ chunk3 "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1474,7 +1474,7 @@ fn spec_test_112() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1487,7 +1487,7 @@ fn spec_test_113() { bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1500,7 +1500,7 @@ bar

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1521,7 +1521,7 @@ Heading
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1534,7 +1534,7 @@ bar "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1549,7 +1549,7 @@ fn spec_test_117() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1560,7 +1560,7 @@ fn spec_test_118() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1575,7 +1575,7 @@ fn spec_test_119() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1590,7 +1590,7 @@ fn spec_test_120() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1602,7 +1602,7 @@ foo let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1617,7 +1617,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1632,7 +1632,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1647,7 +1647,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1662,7 +1662,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1672,7 +1672,7 @@ fn spec_test_126() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1688,7 +1688,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1705,7 +1705,7 @@ bbb

    bbb

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1720,7 +1720,7 @@ fn spec_test_129() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1731,7 +1731,7 @@ fn spec_test_130() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1746,7 +1746,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1763,7 +1763,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1780,7 +1780,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1795,7 +1795,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1808,7 +1808,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1821,7 +1821,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1835,7 +1835,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1847,7 +1847,7 @@ aaa aaa

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1861,7 +1861,7 @@ aaa "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1878,7 +1878,7 @@ baz

    baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1896,7 +1896,7 @@ bar

    baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1913,7 +1913,7 @@ end "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1930,7 +1930,7 @@ end "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1941,7 +1941,7 @@ fn spec_test_144() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1953,7 +1953,7 @@ foo foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1966,7 +1966,7 @@ foo "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -1979,7 +1979,7 @@ fn spec_test_147() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2000,7 +2000,7 @@ _world_. "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2025,7 +2025,7 @@ okay.

    okay.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2039,7 +2039,7 @@ fn spec_test_150() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2051,7 +2051,7 @@ fn spec_test_151() { *foo* "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2067,7 +2067,7 @@ fn spec_test_152() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2081,7 +2081,7 @@ fn spec_test_153() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2095,7 +2095,7 @@ fn spec_test_154() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2110,7 +2110,7 @@ fn spec_test_155() {

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2122,7 +2122,7 @@ fn spec_test_156() { *hi* "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2134,7 +2134,7 @@ foo foo "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2146,7 +2146,7 @@ fn spec_test_158() { *foo* "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2156,7 +2156,7 @@ fn spec_test_159() { let expected = r##"
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2170,7 +2170,7 @@ foo "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2186,7 +2186,7 @@ int x = 33; ``` "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2200,7 +2200,7 @@ fn spec_test_162() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2214,7 +2214,7 @@ fn spec_test_163() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2228,7 +2228,7 @@ fn spec_test_164() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2240,7 +2240,7 @@ fn spec_test_165() { *bar* "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2254,7 +2254,7 @@ fn spec_test_166() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2270,7 +2270,7 @@ fn spec_test_167() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2280,7 +2280,7 @@ fn spec_test_168() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2302,7 +2302,7 @@ main = print $ parseTags tags

    okay

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2322,7 +2322,7 @@ document.getElementById("demo").innerHTML = "Hello JavaScript!";

    okay

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2344,7 +2344,7 @@ _bar_ "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2366,7 +2366,7 @@ p {color:blue;}

    okay

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2382,7 +2382,7 @@ foo foo "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2399,7 +2399,7 @@ foo

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2415,7 +2415,7 @@ fn spec_test_175() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2427,7 +2427,7 @@ fn spec_test_176() {

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2439,7 +2439,7 @@ fn spec_test_177() {

    baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2453,7 +2453,7 @@ foo 1. *bar* "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2471,7 +2471,7 @@ bar

    okay

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2491,7 +2491,7 @@ okay

    okay

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2501,7 +2501,7 @@ fn spec_test_181() { let expected = r##" "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2535,7 +2535,7 @@ function matchwo(a,b)

    okay

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2549,7 +2549,7 @@ fn spec_test_183() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2563,7 +2563,7 @@ fn spec_test_184() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2579,7 +2579,7 @@ bar "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2595,7 +2595,7 @@ bar *foo* "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2609,7 +2609,7 @@ baz baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2625,7 +2625,7 @@ fn spec_test_188() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2639,7 +2639,7 @@ fn spec_test_189() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2665,7 +2665,7 @@ Hi "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2692,7 +2692,7 @@ fn spec_test_191() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2704,7 +2704,7 @@ fn spec_test_192() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2718,7 +2718,7 @@ fn spec_test_193() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2730,7 +2730,7 @@ fn spec_test_194() { let expected = r##"

    Foo*bar]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2744,7 +2744,7 @@ fn spec_test_195() { let expected = r##"

    Foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2764,7 +2764,7 @@ line2 ">foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2780,7 +2780,7 @@ with blank line'

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2793,7 +2793,7 @@ fn spec_test_198() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2806,7 +2806,7 @@ fn spec_test_199() {

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2818,7 +2818,7 @@ fn spec_test_200() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2831,7 +2831,7 @@ fn spec_test_201() {

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2843,7 +2843,7 @@ fn spec_test_202() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2855,7 +2855,7 @@ fn spec_test_203() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2868,7 +2868,7 @@ fn spec_test_204() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2880,7 +2880,7 @@ fn spec_test_205() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2892,7 +2892,7 @@ fn spec_test_206() { let expected = r##"

    αγω

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2901,7 +2901,7 @@ fn spec_test_207() { "##; let expected = r##""##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2914,7 +2914,7 @@ bar let expected = r##"

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2924,7 +2924,7 @@ fn spec_test_209() { let expected = r##"

    [foo]: /url "title" ok

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2935,7 +2935,7 @@ fn spec_test_210() { let expected = r##"

    "title" ok

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2949,7 +2949,7 @@ fn spec_test_211() {

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2965,7 +2965,7 @@ fn spec_test_212() {

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2980,7 +2980,7 @@ fn spec_test_213() {

    [bar]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -2995,7 +2995,7 @@ fn spec_test_214() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3009,7 +3009,7 @@ bar

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3022,7 +3022,7 @@ fn spec_test_216() { foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3041,7 +3041,7 @@ fn spec_test_217() { baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3055,7 +3055,7 @@ fn spec_test_218() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3068,7 +3068,7 @@ bbb

    bbb

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3085,7 +3085,7 @@ bbb

    ddd

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3099,7 +3099,7 @@ bbb

    bbb

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3111,7 +3111,7 @@ fn spec_test_222() { bbb

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3125,7 +3125,7 @@ bbb ccc

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3137,7 +3137,7 @@ bbb bbb

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3150,7 +3150,7 @@ bbb

    bbb

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3162,7 +3162,7 @@ bbb bbb

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3180,7 +3180,7 @@ aaa

    aaa

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3196,7 +3196,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3212,7 +3212,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3228,7 +3228,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3243,7 +3243,7 @@ fn spec_test_231() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3259,7 +3259,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3275,7 +3275,7 @@ foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3289,7 +3289,7 @@ fn spec_test_234() {
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3307,7 +3307,7 @@ fn spec_test_235() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3323,7 +3323,7 @@ fn spec_test_236() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3339,7 +3339,7 @@ foo
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3353,7 +3353,7 @@ fn spec_test_238() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3364,7 +3364,7 @@ fn spec_test_239() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3377,7 +3377,7 @@ fn spec_test_240() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3391,7 +3391,7 @@ fn spec_test_241() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3408,7 +3408,7 @@ fn spec_test_242() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3422,7 +3422,7 @@ bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3437,7 +3437,7 @@ fn spec_test_244() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3451,7 +3451,7 @@ fn spec_test_245() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3469,7 +3469,7 @@ fn spec_test_246() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3483,7 +3483,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3498,7 +3498,7 @@ baz

    baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3513,7 +3513,7 @@ baz

    baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3531,7 +3531,7 @@ bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3551,7 +3551,7 @@ baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3569,7 +3569,7 @@ fn spec_test_252() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3590,7 +3590,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3615,7 +3615,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3630,7 +3630,7 @@ fn spec_test_255() {

    two

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3647,7 +3647,7 @@ fn spec_test_256() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3663,7 +3663,7 @@ fn spec_test_257() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3680,7 +3680,7 @@ fn spec_test_258() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3701,7 +3701,7 @@ fn spec_test_259() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3720,7 +3720,7 @@ fn spec_test_260() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3733,7 +3733,7 @@ fn spec_test_261() {

    2.two

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3751,7 +3751,7 @@ fn spec_test_262() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3779,7 +3779,7 @@ fn spec_test_263() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3803,7 +3803,7 @@ baz "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3815,7 +3815,7 @@ fn spec_test_265() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3825,7 +3825,7 @@ fn spec_test_266() { let expected = r##"

    1234567890. not ok

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3837,7 +3837,7 @@ fn spec_test_267() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3849,7 +3849,7 @@ fn spec_test_268() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3859,7 +3859,7 @@ fn spec_test_269() { let expected = r##"

    -1. not ok

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3877,7 +3877,7 @@ fn spec_test_270() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3895,7 +3895,7 @@ fn spec_test_271() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3913,7 +3913,7 @@ paragraph "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3935,7 +3935,7 @@ fn spec_test_273() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3957,7 +3957,7 @@ fn spec_test_274() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3970,7 +3970,7 @@ bar

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -3985,7 +3985,7 @@ fn spec_test_276() {

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4002,7 +4002,7 @@ fn spec_test_277() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4029,7 +4029,7 @@ fn spec_test_278() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4042,7 +4042,7 @@ fn spec_test_279() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4057,7 +4057,7 @@ fn spec_test_280() {

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4073,7 +4073,7 @@ fn spec_test_281() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4089,7 +4089,7 @@ fn spec_test_282() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4105,7 +4105,7 @@ fn spec_test_283() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4117,7 +4117,7 @@ fn spec_test_284() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4134,7 +4134,7 @@ foo 1.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4159,7 +4159,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4184,7 +4184,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4209,7 +4209,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4230,7 +4230,7 @@ fn spec_test_289() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4255,7 +4255,7 @@ with two lines.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4269,7 +4269,7 @@ with two lines. "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4289,7 +4289,7 @@ continued here.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4309,7 +4309,7 @@ continued here.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4336,7 +4336,7 @@ fn spec_test_294() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4354,7 +4354,7 @@ fn spec_test_295() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4371,7 +4371,7 @@ fn spec_test_296() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4387,7 +4387,7 @@ fn spec_test_297() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4403,7 +4403,7 @@ fn spec_test_298() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4423,7 +4423,7 @@ fn spec_test_299() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4443,7 +4443,7 @@ baz "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4461,7 +4461,7 @@ fn spec_test_301() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4479,7 +4479,7 @@ fn spec_test_302() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4495,7 +4495,7 @@ fn spec_test_303() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4507,7 +4507,7 @@ fn spec_test_304() { 14. The number of doors is 6.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4521,7 +4521,7 @@ fn spec_test_305() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4546,7 +4546,7 @@ fn spec_test_306() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4574,7 +4574,7 @@ fn spec_test_307() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4598,7 +4598,7 @@ fn spec_test_308() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4627,7 +4627,7 @@ fn spec_test_309() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4651,7 +4651,7 @@ fn spec_test_310() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4675,7 +4675,7 @@ fn spec_test_311() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4695,7 +4695,7 @@ fn spec_test_312() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4718,7 +4718,7 @@ fn spec_test_313() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4741,7 +4741,7 @@ fn spec_test_314() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4762,7 +4762,7 @@ fn spec_test_315() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4787,7 +4787,7 @@ fn spec_test_316() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4811,7 +4811,7 @@ fn spec_test_317() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4836,7 +4836,7 @@ fn spec_test_318() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4860,7 +4860,7 @@ fn spec_test_319() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4880,7 +4880,7 @@ fn spec_test_320() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4904,7 +4904,7 @@ fn spec_test_321() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4916,7 +4916,7 @@ fn spec_test_322() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4933,7 +4933,7 @@ fn spec_test_323() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4953,7 +4953,7 @@ fn spec_test_324() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -4974,7 +4974,7 @@ fn spec_test_325() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5005,7 +5005,7 @@ fn spec_test_326() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5015,7 +5015,7 @@ fn spec_test_327() { let expected = r##"

    hilo`

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5025,7 +5025,7 @@ fn spec_test_328() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5035,7 +5035,7 @@ fn spec_test_329() { let expected = r##"

    foo ` bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5045,7 +5045,7 @@ fn spec_test_330() { let expected = r##"

    ``

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5055,7 +5055,7 @@ fn spec_test_331() { let expected = r##"

    ``

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5065,7 +5065,7 @@ fn spec_test_332() { let expected = r##"

    a

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5075,7 +5075,7 @@ fn spec_test_333() { let expected = r##"

     b 

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5087,7 +5087,7 @@ fn spec_test_334() {

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5101,7 +5101,7 @@ baz let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5113,7 +5113,7 @@ foo let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5124,7 +5124,7 @@ baz` let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5134,7 +5134,7 @@ fn spec_test_338() { let expected = r##"

    foo\bar`

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5144,7 +5144,7 @@ fn spec_test_339() { let expected = r##"

    foo`bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5154,7 +5154,7 @@ fn spec_test_340() { let expected = r##"

    foo `` bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5164,7 +5164,7 @@ fn spec_test_341() { let expected = r##"

    *foo*

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5174,7 +5174,7 @@ fn spec_test_342() { let expected = r##"

    [not a link](/foo)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5184,7 +5184,7 @@ fn spec_test_343() { let expected = r##"

    <a href="">`

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5194,7 +5194,7 @@ fn spec_test_344() { let expected = r##"

    `

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5204,7 +5204,7 @@ fn spec_test_345() { let expected = r##"

    <https://foo.bar.baz>`

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5214,7 +5214,7 @@ fn spec_test_346() { let expected = r##"

    https://foo.bar.`baz`

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5224,7 +5224,7 @@ fn spec_test_347() { let expected = r##"

    ```foo``

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5234,7 +5234,7 @@ fn spec_test_348() { let expected = r##"

    `foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5244,7 +5244,7 @@ fn spec_test_349() { let expected = r##"

    `foobar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5254,7 +5254,7 @@ fn spec_test_350() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5264,7 +5264,7 @@ fn spec_test_351() { let expected = r##"

    a * foo bar*

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5274,7 +5274,7 @@ fn spec_test_352() { let expected = r##"

    a*"foo"*

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5284,7 +5284,7 @@ fn spec_test_353() { let expected = r##"

    * a *

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5300,7 +5300,7 @@ fn spec_test_354() {

    *€*charlie.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5310,7 +5310,7 @@ fn spec_test_355() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5320,7 +5320,7 @@ fn spec_test_356() { let expected = r##"

    5678

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5330,7 +5330,7 @@ fn spec_test_357() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5340,7 +5340,7 @@ fn spec_test_358() { let expected = r##"

    _ foo bar_

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5350,7 +5350,7 @@ fn spec_test_359() { let expected = r##"

    a_"foo"_

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5360,7 +5360,7 @@ fn spec_test_360() { let expected = r##"

    foo_bar_

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5370,7 +5370,7 @@ fn spec_test_361() { let expected = r##"

    5_6_78

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5380,7 +5380,7 @@ fn spec_test_362() { let expected = r##"

    пристаням_стремятся_

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5390,7 +5390,7 @@ fn spec_test_363() { let expected = r##"

    aa_"bb"_cc

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5400,7 +5400,7 @@ fn spec_test_364() { let expected = r##"

    foo-(bar)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5410,7 +5410,7 @@ fn spec_test_365() { let expected = r##"

    _foo*

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5420,7 +5420,7 @@ fn spec_test_366() { let expected = r##"

    *foo bar *

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5432,7 +5432,7 @@ fn spec_test_367() { *

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5442,7 +5442,7 @@ fn spec_test_368() { let expected = r##"

    *(*foo)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5452,7 +5452,7 @@ fn spec_test_369() { let expected = r##"

    (foo)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5462,7 +5462,7 @@ fn spec_test_370() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5472,7 +5472,7 @@ fn spec_test_371() { let expected = r##"

    _foo bar _

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5482,7 +5482,7 @@ fn spec_test_372() { let expected = r##"

    _(_foo)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5492,7 +5492,7 @@ fn spec_test_373() { let expected = r##"

    (foo)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5502,7 +5502,7 @@ fn spec_test_374() { let expected = r##"

    _foo_bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5512,7 +5512,7 @@ fn spec_test_375() { let expected = r##"

    _пристаням_стремятся

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5522,7 +5522,7 @@ fn spec_test_376() { let expected = r##"

    foo_bar_baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5532,7 +5532,7 @@ fn spec_test_377() { let expected = r##"

    (bar).

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5542,7 +5542,7 @@ fn spec_test_378() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5552,7 +5552,7 @@ fn spec_test_379() { let expected = r##"

    ** foo bar**

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5562,7 +5562,7 @@ fn spec_test_380() { let expected = r##"

    a**"foo"**

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5572,7 +5572,7 @@ fn spec_test_381() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5582,7 +5582,7 @@ fn spec_test_382() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5592,7 +5592,7 @@ fn spec_test_383() { let expected = r##"

    __ foo bar__

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5604,7 +5604,7 @@ foo bar__ foo bar__

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5614,7 +5614,7 @@ fn spec_test_385() { let expected = r##"

    a__"foo"__

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5624,7 +5624,7 @@ fn spec_test_386() { let expected = r##"

    foo__bar__

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5634,7 +5634,7 @@ fn spec_test_387() { let expected = r##"

    5__6__78

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5644,7 +5644,7 @@ fn spec_test_388() { let expected = r##"

    пристаням__стремятся__

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5654,7 +5654,7 @@ fn spec_test_389() { let expected = r##"

    foo, bar, baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5664,7 +5664,7 @@ fn spec_test_390() { let expected = r##"

    foo-(bar)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5674,7 +5674,7 @@ fn spec_test_391() { let expected = r##"

    **foo bar **

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5684,7 +5684,7 @@ fn spec_test_392() { let expected = r##"

    **(**foo)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5694,7 +5694,7 @@ fn spec_test_393() { let expected = r##"

    (foo)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5706,7 +5706,7 @@ fn spec_test_394() { Asclepias physocarpa)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5716,7 +5716,7 @@ fn spec_test_395() { let expected = r##"

    foo "bar" foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5726,7 +5726,7 @@ fn spec_test_396() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5736,7 +5736,7 @@ fn spec_test_397() { let expected = r##"

    __foo bar __

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5746,7 +5746,7 @@ fn spec_test_398() { let expected = r##"

    __(__foo)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5756,7 +5756,7 @@ fn spec_test_399() { let expected = r##"

    (foo)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5766,7 +5766,7 @@ fn spec_test_400() { let expected = r##"

    __foo__bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5776,7 +5776,7 @@ fn spec_test_401() { let expected = r##"

    __пристаням__стремятся

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5786,7 +5786,7 @@ fn spec_test_402() { let expected = r##"

    foo__bar__baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5796,7 +5796,7 @@ fn spec_test_403() { let expected = r##"

    (bar).

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5806,7 +5806,7 @@ fn spec_test_404() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5818,7 +5818,7 @@ bar* bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5828,7 +5828,7 @@ fn spec_test_406() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5838,7 +5838,7 @@ fn spec_test_407() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5848,7 +5848,7 @@ fn spec_test_408() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5858,7 +5858,7 @@ fn spec_test_409() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5868,7 +5868,7 @@ fn spec_test_410() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5878,7 +5878,7 @@ fn spec_test_411() { let expected = r##"

    foobarbaz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5888,7 +5888,7 @@ fn spec_test_412() { let expected = r##"

    foo**bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5898,7 +5898,7 @@ fn spec_test_413() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5908,7 +5908,7 @@ fn spec_test_414() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5918,7 +5918,7 @@ fn spec_test_415() { let expected = r##"

    foobar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5928,7 +5928,7 @@ fn spec_test_416() { let expected = r##"

    foobarbaz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5938,7 +5938,7 @@ fn spec_test_417() { let expected = r##"

    foobar***baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5948,7 +5948,7 @@ fn spec_test_418() { let expected = r##"

    foo bar baz bim bop

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5958,7 +5958,7 @@ fn spec_test_419() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5968,7 +5968,7 @@ fn spec_test_420() { let expected = r##"

    ** is not an empty emphasis

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5978,7 +5978,7 @@ fn spec_test_421() { let expected = r##"

    **** is not an empty strong emphasis

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -5988,7 +5988,7 @@ fn spec_test_422() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6000,7 +6000,7 @@ bar** bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6010,7 +6010,7 @@ fn spec_test_424() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6020,7 +6020,7 @@ fn spec_test_425() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6030,7 +6030,7 @@ fn spec_test_426() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6040,7 +6040,7 @@ fn spec_test_427() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6050,7 +6050,7 @@ fn spec_test_428() { let expected = r##"

    foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6060,7 +6060,7 @@ fn spec_test_429() { let expected = r##"

    foobarbaz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6070,7 +6070,7 @@ fn spec_test_430() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6080,7 +6080,7 @@ fn spec_test_431() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6092,7 +6092,7 @@ bim* bop** bim bop

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6102,7 +6102,7 @@ fn spec_test_433() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6112,7 +6112,7 @@ fn spec_test_434() { let expected = r##"

    __ is not an empty emphasis

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6122,7 +6122,7 @@ fn spec_test_435() { let expected = r##"

    ____ is not an empty strong emphasis

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6132,7 +6132,7 @@ fn spec_test_436() { let expected = r##"

    foo ***

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6142,7 +6142,7 @@ fn spec_test_437() { let expected = r##"

    foo *

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6152,7 +6152,7 @@ fn spec_test_438() { let expected = r##"

    foo _

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6162,7 +6162,7 @@ fn spec_test_439() { let expected = r##"

    foo *****

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6172,7 +6172,7 @@ fn spec_test_440() { let expected = r##"

    foo *

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6182,7 +6182,7 @@ fn spec_test_441() { let expected = r##"

    foo _

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6192,7 +6192,7 @@ fn spec_test_442() { let expected = r##"

    *foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6202,7 +6202,7 @@ fn spec_test_443() { let expected = r##"

    foo*

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6212,7 +6212,7 @@ fn spec_test_444() { let expected = r##"

    *foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6222,7 +6222,7 @@ fn spec_test_445() { let expected = r##"

    ***foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6232,7 +6232,7 @@ fn spec_test_446() { let expected = r##"

    foo*

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6242,7 +6242,7 @@ fn spec_test_447() { let expected = r##"

    foo***

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6252,7 +6252,7 @@ fn spec_test_448() { let expected = r##"

    foo ___

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6262,7 +6262,7 @@ fn spec_test_449() { let expected = r##"

    foo _

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6272,7 +6272,7 @@ fn spec_test_450() { let expected = r##"

    foo *

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6282,7 +6282,7 @@ fn spec_test_451() { let expected = r##"

    foo _____

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6292,7 +6292,7 @@ fn spec_test_452() { let expected = r##"

    foo _

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6302,7 +6302,7 @@ fn spec_test_453() { let expected = r##"

    foo *

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6312,7 +6312,7 @@ fn spec_test_454() { let expected = r##"

    _foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6322,7 +6322,7 @@ fn spec_test_455() { let expected = r##"

    foo_

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6332,7 +6332,7 @@ fn spec_test_456() { let expected = r##"

    _foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6342,7 +6342,7 @@ fn spec_test_457() { let expected = r##"

    ___foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6352,7 +6352,7 @@ fn spec_test_458() { let expected = r##"

    foo_

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6362,7 +6362,7 @@ fn spec_test_459() { let expected = r##"

    foo___

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6372,7 +6372,7 @@ fn spec_test_460() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6382,7 +6382,7 @@ fn spec_test_461() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6392,7 +6392,7 @@ fn spec_test_462() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6402,7 +6402,7 @@ fn spec_test_463() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6412,7 +6412,7 @@ fn spec_test_464() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6422,7 +6422,7 @@ fn spec_test_465() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6432,7 +6432,7 @@ fn spec_test_466() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6442,7 +6442,7 @@ fn spec_test_467() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6452,7 +6452,7 @@ fn spec_test_468() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6462,7 +6462,7 @@ fn spec_test_469() { let expected = r##"

    foo _bar baz_

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6472,7 +6472,7 @@ fn spec_test_470() { let expected = r##"

    foo bar *baz bim bam

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6482,7 +6482,7 @@ fn spec_test_471() { let expected = r##"

    **foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6492,7 +6492,7 @@ fn spec_test_472() { let expected = r##"

    *foo bar baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6502,7 +6502,7 @@ fn spec_test_473() { let expected = r##"

    *bar*

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6512,7 +6512,7 @@ fn spec_test_474() { let expected = r##"

    _foo bar_

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6522,7 +6522,7 @@ fn spec_test_475() { let expected = r##"

    *

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6532,7 +6532,7 @@ fn spec_test_476() { let expected = r##"

    **

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6542,7 +6542,7 @@ fn spec_test_477() { let expected = r##"

    __

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6552,7 +6552,7 @@ fn spec_test_478() { let expected = r##"

    a *

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6562,7 +6562,7 @@ fn spec_test_479() { let expected = r##"

    a _

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6572,7 +6572,7 @@ fn spec_test_480() { let expected = r##"

    **ahttps://foo.bar/?q=**

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6582,7 +6582,7 @@ fn spec_test_481() { let expected = r##"

    __ahttps://foo.bar/?q=__

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6592,7 +6592,7 @@ fn spec_test_482() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6602,7 +6602,7 @@ fn spec_test_483() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6612,7 +6612,7 @@ fn spec_test_484() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6622,7 +6622,7 @@ fn spec_test_485() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6632,7 +6632,7 @@ fn spec_test_486() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6642,7 +6642,7 @@ fn spec_test_487() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6652,7 +6652,7 @@ fn spec_test_488() { let expected = r##"

    [link](/my uri)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6662,7 +6662,7 @@ fn spec_test_489() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6674,7 +6674,7 @@ bar) bar)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6686,7 +6686,7 @@ bar>) bar>)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6696,7 +6696,7 @@ fn spec_test_492() { let expected = r##"

    a

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6706,7 +6706,7 @@ fn spec_test_493() { let expected = r##"

    [link](<foo>)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6720,7 +6720,7 @@ fn spec_test_494() { [a](c)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6730,7 +6730,7 @@ fn spec_test_495() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6740,7 +6740,7 @@ fn spec_test_496() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6750,7 +6750,7 @@ fn spec_test_497() { let expected = r##"

    [link](foo(and(bar))

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6760,7 +6760,7 @@ fn spec_test_498() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6770,7 +6770,7 @@ fn spec_test_499() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6780,7 +6780,7 @@ fn spec_test_500() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6796,7 +6796,7 @@ fn spec_test_501() {

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6806,7 +6806,7 @@ fn spec_test_502() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6816,7 +6816,7 @@ fn spec_test_503() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6826,7 +6826,7 @@ fn spec_test_504() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6840,7 +6840,7 @@ fn spec_test_505() { link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6850,7 +6850,7 @@ fn spec_test_506() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6860,7 +6860,7 @@ fn spec_test_507() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6870,7 +6870,7 @@ fn spec_test_508() { let expected = r##"

    [link](/url "title "and" title")

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6880,7 +6880,7 @@ fn spec_test_509() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6891,7 +6891,7 @@ fn spec_test_510() { let expected = r##"

    link

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6901,7 +6901,7 @@ fn spec_test_511() { let expected = r##"

    [link] (/uri)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6911,7 +6911,7 @@ fn spec_test_512() { let expected = r##"

    link [foo [bar]]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6921,7 +6921,7 @@ fn spec_test_513() { let expected = r##"

    [link] bar](/uri)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6931,7 +6931,7 @@ fn spec_test_514() { let expected = r##"

    [link bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6941,7 +6941,7 @@ fn spec_test_515() { let expected = r##"

    link [bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6951,7 +6951,7 @@ fn spec_test_516() { let expected = r##"

    link foo bar #

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6961,7 +6961,7 @@ fn spec_test_517() { let expected = r##"

    moon

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6971,7 +6971,7 @@ fn spec_test_518() { let expected = r##"

    [foo bar](/uri)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6981,7 +6981,7 @@ fn spec_test_519() { let expected = r##"

    [foo [bar baz](/uri)](/uri)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -6991,7 +6991,7 @@ fn spec_test_520() { let expected = r##"

    [foo](uri2)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7001,7 +7001,7 @@ fn spec_test_521() { let expected = r##"

    *foo*

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7011,7 +7011,7 @@ fn spec_test_522() { let expected = r##"

    foo *bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7021,7 +7021,7 @@ fn spec_test_523() { let expected = r##"

    foo [bar baz]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7031,7 +7031,7 @@ fn spec_test_524() { let expected = r##"

    [foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7041,7 +7041,7 @@ fn spec_test_525() { let expected = r##"

    [foo](/uri)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7051,7 +7051,7 @@ fn spec_test_526() { let expected = r##"

    [foohttps://example.com/?search=](uri)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7063,7 +7063,7 @@ fn spec_test_527() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7075,7 +7075,7 @@ fn spec_test_528() { let expected = r##"

    link [foo [bar]]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7087,7 +7087,7 @@ fn spec_test_529() { let expected = r##"

    link [bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7099,7 +7099,7 @@ fn spec_test_530() { let expected = r##"

    link foo bar #

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7111,7 +7111,7 @@ fn spec_test_531() { let expected = r##"

    moon

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7123,7 +7123,7 @@ fn spec_test_532() { let expected = r##"

    [foo bar]ref

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7135,7 +7135,7 @@ fn spec_test_533() { let expected = r##"

    [foo bar baz]ref

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7147,7 +7147,7 @@ fn spec_test_534() { let expected = r##"

    *foo*

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7159,7 +7159,7 @@ fn spec_test_535() { let expected = r##"

    foo *bar*

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7171,7 +7171,7 @@ fn spec_test_536() { let expected = r##"

    [foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7183,7 +7183,7 @@ fn spec_test_537() { let expected = r##"

    [foo][ref]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7195,7 +7195,7 @@ fn spec_test_538() { let expected = r##"

    [foohttps://example.com/?search=][ref]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7207,7 +7207,7 @@ fn spec_test_539() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7219,7 +7219,7 @@ fn spec_test_540() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7232,7 +7232,7 @@ fn spec_test_541() { let expected = r##"

    Baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7244,7 +7244,7 @@ fn spec_test_542() { let expected = r##"

    [foo] bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7258,7 +7258,7 @@ fn spec_test_543() { bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7272,7 +7272,7 @@ fn spec_test_544() { let expected = r##"

    bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7284,7 +7284,7 @@ fn spec_test_545() { let expected = r##"

    [bar][foo!]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7297,7 +7297,7 @@ fn spec_test_546() {

    [ref[]: /uri

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7310,7 +7310,7 @@ fn spec_test_547() {

    [ref[bar]]: /uri

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7323,7 +7323,7 @@ fn spec_test_548() {

    [[[foo]]]: /url

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7335,7 +7335,7 @@ fn spec_test_549() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7347,7 +7347,7 @@ fn spec_test_550() { let expected = r##"

    bar\

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7360,7 +7360,7 @@ fn spec_test_551() {

    []: /uri

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7377,7 +7377,7 @@ fn spec_test_552() { ]: /uri

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7389,7 +7389,7 @@ fn spec_test_553() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7401,7 +7401,7 @@ fn spec_test_554() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7413,7 +7413,7 @@ fn spec_test_555() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7427,7 +7427,7 @@ fn spec_test_556() { []

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7439,7 +7439,7 @@ fn spec_test_557() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7451,7 +7451,7 @@ fn spec_test_558() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7463,7 +7463,7 @@ fn spec_test_559() { let expected = r##"

    [foo bar]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7475,7 +7475,7 @@ fn spec_test_560() { let expected = r##"

    [[bar foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7487,7 +7487,7 @@ fn spec_test_561() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7499,7 +7499,7 @@ fn spec_test_562() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7511,7 +7511,7 @@ fn spec_test_563() { let expected = r##"

    [foo]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7523,7 +7523,7 @@ fn spec_test_564() { let expected = r##"

    *foo*

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7536,7 +7536,7 @@ fn spec_test_565() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7548,7 +7548,7 @@ fn spec_test_566() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7560,7 +7560,7 @@ fn spec_test_567() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7572,7 +7572,7 @@ fn spec_test_568() { let expected = r##"

    foo(not a link)

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7584,7 +7584,7 @@ fn spec_test_569() { let expected = r##"

    [foo]bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7597,7 +7597,7 @@ fn spec_test_570() { let expected = r##"

    foobaz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7610,7 +7610,7 @@ fn spec_test_571() { let expected = r##"

    [foo]bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7620,7 +7620,7 @@ fn spec_test_572() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7632,7 +7632,7 @@ fn spec_test_573() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7642,7 +7642,7 @@ fn spec_test_574() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7652,7 +7652,7 @@ fn spec_test_575() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7664,7 +7664,7 @@ fn spec_test_576() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7676,7 +7676,7 @@ fn spec_test_577() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7686,7 +7686,7 @@ fn spec_test_578() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7696,7 +7696,7 @@ fn spec_test_579() { let expected = r##"

    My foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7706,7 +7706,7 @@ fn spec_test_580() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7716,7 +7716,7 @@ fn spec_test_581() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7728,7 +7728,7 @@ fn spec_test_582() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7740,7 +7740,7 @@ fn spec_test_583() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7752,7 +7752,7 @@ fn spec_test_584() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7764,7 +7764,7 @@ fn spec_test_585() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7776,7 +7776,7 @@ fn spec_test_586() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7790,7 +7790,7 @@ fn spec_test_587() { []

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7802,7 +7802,7 @@ fn spec_test_588() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7814,7 +7814,7 @@ fn spec_test_589() { let expected = r##"

    foo bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7827,7 +7827,7 @@ fn spec_test_590() {

    [[foo]]: /url "title"

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7839,7 +7839,7 @@ fn spec_test_591() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7851,7 +7851,7 @@ fn spec_test_592() { let expected = r##"

    ![foo]

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7863,7 +7863,7 @@ fn spec_test_593() { let expected = r##"

    !foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7873,7 +7873,7 @@ fn spec_test_594() { let expected = r##"

    http://foo.bar.baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7883,7 +7883,7 @@ fn spec_test_595() { let expected = r##"

    https://foo.bar.baz/test?q=hello&id=22&boolean

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7893,7 +7893,7 @@ fn spec_test_596() { let expected = r##"

    irc://foo.bar:2233/baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7903,7 +7903,7 @@ fn spec_test_597() { let expected = r##"

    MAILTO:FOO@BAR.BAZ

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7913,7 +7913,7 @@ fn spec_test_598() { let expected = r##"

    a+b+c:d

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7923,7 +7923,7 @@ fn spec_test_599() { let expected = r##"

    made-up-scheme://foo,bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7933,7 +7933,7 @@ fn spec_test_600() { let expected = r##"

    https://../

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7943,7 +7943,7 @@ fn spec_test_601() { let expected = r##"

    localhost:5001/foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7953,7 +7953,7 @@ fn spec_test_602() { let expected = r##"

    <https://foo.bar/baz bim>

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7963,7 +7963,7 @@ fn spec_test_603() { let expected = r##"

    https://example.com/\[\

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7973,7 +7973,7 @@ fn spec_test_604() { let expected = r##"

    foo@bar.example.com

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7983,7 +7983,7 @@ fn spec_test_605() { let expected = r##"

    foo+special@Bar.baz-bar0.com

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -7993,7 +7993,7 @@ fn spec_test_606() { let expected = r##"

    <foo+@bar.example.com>

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8003,7 +8003,7 @@ fn spec_test_607() { let expected = r##"

    <>

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8013,7 +8013,7 @@ fn spec_test_608() { let expected = r##"

    < https://foo.bar >

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8023,7 +8023,7 @@ fn spec_test_609() { let expected = r##"

    <m:abc>

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8033,7 +8033,7 @@ fn spec_test_610() { let expected = r##"

    <foo.bar.baz>

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8043,7 +8043,7 @@ fn spec_test_611() { let expected = r##"

    https://example.com

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8053,7 +8053,7 @@ fn spec_test_612() { let expected = r##"

    foo@bar.example.com

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8063,7 +8063,7 @@ fn spec_test_613() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8073,7 +8073,7 @@ fn spec_test_614() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8085,7 +8085,7 @@ data="foo" > data="foo" >

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8097,7 +8097,7 @@ _boolean zoop:33=zoop:33 /> _boolean zoop:33=zoop:33 />

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8107,7 +8107,7 @@ fn spec_test_617() { let expected = r##"

    Foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8117,7 +8117,7 @@ fn spec_test_618() { let expected = r##"

    <33> <__>

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8127,7 +8127,7 @@ fn spec_test_619() { let expected = r##"

    <a h*#ref="hi">

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8137,7 +8137,7 @@ fn spec_test_620() { let expected = r##"

    <a href="hi'> <a href=hi'>

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8153,7 +8153,7 @@ foo><bar/ > bim!bop />

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8163,7 +8163,7 @@ fn spec_test_622() { let expected = r##"

    <a href='bar'title=title>

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8173,7 +8173,7 @@ fn spec_test_623() { let expected = r##"

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8183,7 +8183,7 @@ fn spec_test_624() { let expected = r##"

    </a href="foo">

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8195,7 +8195,7 @@ comment - with hyphens --> comment - with hyphens -->

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8208,7 +8208,7 @@ foo foo -->

    foo foo -->

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8218,7 +8218,7 @@ fn spec_test_627() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8228,7 +8228,7 @@ fn spec_test_628() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8238,7 +8238,7 @@ fn spec_test_629() { let expected = r##"

    foo &<]]>

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8248,7 +8248,7 @@ fn spec_test_630() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8258,7 +8258,7 @@ fn spec_test_631() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8268,7 +8268,7 @@ fn spec_test_632() { let expected = r##"

    <a href=""">

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8280,7 +8280,7 @@ baz baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8292,7 +8292,7 @@ baz baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8304,7 +8304,7 @@ baz baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8316,7 +8316,7 @@ fn spec_test_636() { bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8328,7 +8328,7 @@ fn spec_test_637() { bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8340,7 +8340,7 @@ bar* bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8352,7 +8352,7 @@ bar* bar

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8363,7 +8363,7 @@ span` let expected = r##"

    code span

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8374,7 +8374,7 @@ span` let expected = r##"

    code\ span

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8386,7 +8386,7 @@ bar"> bar">

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8398,7 +8398,7 @@ bar"> bar">

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8408,7 +8408,7 @@ fn spec_test_644() { let expected = r##"

    foo\

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8418,7 +8418,7 @@ fn spec_test_645() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8428,7 +8428,7 @@ fn spec_test_646() { let expected = r##"

    foo\

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8438,7 +8438,7 @@ fn spec_test_647() { let expected = r##"

    foo

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8450,7 +8450,7 @@ baz baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8462,7 +8462,7 @@ fn spec_test_649() { baz

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8472,7 +8472,7 @@ fn spec_test_650() { let expected = r##"

    hello $.;'there

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8482,7 +8482,7 @@ fn spec_test_651() { let expected = r##"

    Foo χρῆν

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -8492,5 +8492,5 @@ fn spec_test_652() { let expected = r##"

    Multiple spaces

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/spoiler.rs b/pulldown-cmark/tests/suite/spoiler.rs index f16f4306..40c1418d 100644 --- a/pulldown-cmark/tests/suite/spoiler.rs +++ b/pulldown-cmark/tests/suite/spoiler.rs @@ -20,7 +20,7 @@ Is this bold?

    "##; - test_markdown_html(original, expected, false, false, false, true, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, true); } #[test] @@ -41,7 +41,7 @@ Is this bold?

    is this seperate and bold

    "##; - test_markdown_html(original, expected, false, false, false, true, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, true); } #[test] @@ -68,7 +68,7 @@ Is this bold?

    "##; - test_markdown_html(original, expected, false, false, false, true, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, true); } #[test] @@ -101,7 +101,7 @@ Is this bold?

    is this seperate and bold

    "##; - test_markdown_html(original, expected, false, false, false, true, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, true); } #[test] @@ -118,7 +118,7 @@ Is this collapsable?

    is this seperate and bold

    "##; - test_markdown_html(original, expected, false, false, false, true, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, true); } #[test] @@ -136,5 +136,5 @@ Is this **bold**? "##; - test_markdown_html(original, expected, false, false, false, true, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, true); } diff --git a/pulldown-cmark/tests/suite/strikethrough.rs b/pulldown-cmark/tests/suite/strikethrough.rs index 3f2bd93f..4e1457c2 100644 --- a/pulldown-cmark/tests/suite/strikethrough.rs +++ b/pulldown-cmark/tests/suite/strikethrough.rs @@ -10,7 +10,7 @@ fn strikethrough_test_1() { let expected = r##"

    This is stricken out

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -20,7 +20,7 @@ fn strikethrough_test_2() { let expected = r##"

    This is ~~stricken

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -30,7 +30,7 @@ fn strikethrough_test_3() { let expected = r##"

    Thisisstricken

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -40,7 +40,7 @@ fn strikethrough_test_4() { let expected = r##"

    Thisisstricken

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -50,7 +50,7 @@ fn strikethrough_test_5() { let expected = r##"

    Here I strike out an exclamation point!.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -60,7 +60,7 @@ fn strikethrough_test_6() { let expected = r##"

    This is stricken out

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -70,7 +70,7 @@ fn strikethrough_test_7() { let expected = r##"

    This is ~stricken

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -80,7 +80,7 @@ fn strikethrough_test_8() { let expected = r##"

    This~is~nothing

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -90,7 +90,7 @@ fn strikethrough_test_9() { let expected = r##"

    This~is~nothing

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -100,7 +100,7 @@ fn strikethrough_test_10() { let expected = r##"

    Here I fail to strike out an exclamation point~!~.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -110,7 +110,7 @@ fn strikethrough_test_11() { let expected = r##"

    Here I fail to strike out a tilde ~~~.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -120,7 +120,7 @@ fn strikethrough_test_12() { let expected = r##"

    Here I fail to match up ~~tildes~.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -130,7 +130,7 @@ fn strikethrough_test_13() { let expected = r##"

    Here I fail to match up ~tildes~~.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -140,7 +140,7 @@ fn strikethrough_test_14() { let expected = r##"

    This ~is stricken.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -150,5 +150,5 @@ fn strikethrough_test_15() { let expected = r##"

    This ~~is stricken.

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/super_sub.rs b/pulldown-cmark/tests/suite/super_sub.rs index 8614ff3f..ba59aeda 100644 --- a/pulldown-cmark/tests/suite/super_sub.rs +++ b/pulldown-cmark/tests/suite/super_sub.rs @@ -10,7 +10,7 @@ fn super_sub_test_1() { let expected = r##"

    This is super This is sub

    "##; - test_markdown_html(original, expected, false, false, false, true, false, false); + test_markdown_html(original, expected, false, false, false, true, false, false, false); } #[test] @@ -20,7 +20,7 @@ fn super_sub_test_2() { let expected = r##"

    This is stricken out

    "##; - test_markdown_html(original, expected, false, false, false, true, false, false); + test_markdown_html(original, expected, false, false, false, true, false, false, false); } #[test] @@ -30,7 +30,7 @@ fn super_sub_test_3() { let expected = r##"

    This is ~stricken

    "##; - test_markdown_html(original, expected, false, false, false, true, false, false); + test_markdown_html(original, expected, false, false, false, true, false, false, false); } #[test] @@ -40,7 +40,7 @@ fn super_sub_test_4() { let expected = r##"

    Thisisnothing

    "##; - test_markdown_html(original, expected, false, false, false, true, false, false); + test_markdown_html(original, expected, false, false, false, true, false, false, false); } #[test] @@ -50,7 +50,7 @@ fn super_sub_test_5() { let expected = r##"

    This ~~is not stricken.

    "##; - test_markdown_html(original, expected, false, false, false, true, false, false); + test_markdown_html(original, expected, false, false, false, true, false, false, false); } #[test] @@ -60,7 +60,7 @@ fn super_sub_test_6() { let expected = r##"

    This ~is stricken.~

    "##; - test_markdown_html(original, expected, false, false, false, true, false, false); + test_markdown_html(original, expected, false, false, false, true, false, false, false); } #[test] @@ -70,7 +70,7 @@ fn super_sub_test_7() { let expected = r##"

    This ~~is stricken but this is not~~

    "##; - test_markdown_html(original, expected, false, false, false, true, false, false); + test_markdown_html(original, expected, false, false, false, true, false, false, false); } #[test] @@ -83,7 +83,7 @@ y=x^2^a+xb+c

    y=x2a+xb+c

    "##; - test_markdown_html(original, expected, false, false, false, true, false, false); + test_markdown_html(original, expected, false, false, false, true, false, false, false); } #[test] @@ -96,7 +96,7 @@ fn super_sub_test_9() {

    ^bar^^

    "##; - test_markdown_html(original, expected, false, false, false, true, false, false); + test_markdown_html(original, expected, false, false, false, true, false, false, false); } #[test] @@ -109,5 +109,5 @@ fn super_sub_test_10() {

    foo__bar*

    "##; - test_markdown_html(original, expected, false, false, false, true, false, false); + test_markdown_html(original, expected, false, false, false, true, false, false, false); } diff --git a/pulldown-cmark/tests/suite/table.rs b/pulldown-cmark/tests/suite/table.rs index 3e6eee04..952c3db5 100644 --- a/pulldown-cmark/tests/suite/table.rs +++ b/pulldown-cmark/tests/suite/table.rs @@ -11,7 +11,7 @@ fn table_test_1() { let expected = r##"

    Test header

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -23,7 +23,7 @@ fn table_test_2() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -44,7 +44,7 @@ fn table_test_3() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -71,7 +71,7 @@ fn table_test_4() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -87,7 +87,7 @@ fn table_test_5() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -103,7 +103,7 @@ fn table_test_6() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -119,7 +119,7 @@ fn table_test_7() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -135,7 +135,7 @@ fn table_test_8() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -161,7 +161,7 @@ fn table_test_9() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -173,7 +173,7 @@ fn table_test_10() { |ぃ|い|

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -187,7 +187,7 @@ fn table_test_11() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -201,7 +201,7 @@ fn table_test_12() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -302,7 +302,7 @@ b

    b

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -316,7 +316,7 @@ fn table_test_14() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -332,7 +332,7 @@ fn table_test_15() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -348,7 +348,7 @@ fn table_test_16() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -398,7 +398,7 @@ fn table_test_17() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -436,7 +436,7 @@ fn table_test_18() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -466,7 +466,7 @@ fn table_test_19() { | Not | Enough |

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -480,7 +480,7 @@ fn table_test_20() {

    |

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -494,7 +494,7 @@ fn table_test_21() { | Table | Body |

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -516,7 +516,7 @@ fn table_test_22() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -542,7 +542,7 @@ fn table_test_23() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -564,7 +564,7 @@ A: Interrupting —?

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -578,7 +578,7 @@ fn table_test_25() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -592,7 +592,7 @@ fn table_test_26() { "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -610,7 +610,7 @@ moo | moo "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } #[test] @@ -628,5 +628,5 @@ moo | moo "##; - test_markdown_html(original, expected, false, false, false, false, false, false); + test_markdown_html(original, expected, false, false, false, false, false, false, false); } diff --git a/pulldown-cmark/tests/suite/wikilinks.rs b/pulldown-cmark/tests/suite/wikilinks.rs index e557d1d3..cf9d0574 100644 --- a/pulldown-cmark/tests/suite/wikilinks.rs +++ b/pulldown-cmark/tests/suite/wikilinks.rs @@ -10,7 +10,7 @@ fn wikilinks_test_1() { let expected = r##"

    This is a WikiLink.

    "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } #[test] @@ -20,7 +20,7 @@ fn wikilinks_test_2() { let expected = r##"

    This is a Main/WikiLink.

    "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } #[test] @@ -32,7 +32,7 @@ fn wikilinks_test_3() { let expected = r##"

    This is Ambiguous.

    "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } #[test] @@ -49,7 +49,7 @@ fn wikilinks_test_4() {

    "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } #[test] @@ -59,7 +59,7 @@ fn wikilinks_test_5() { let expected = r##"

    This is [also Ambiguous](https://example.com/).

    "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } #[test] @@ -72,7 +72,7 @@ fn wikilinks_test_6() {

    https://example.org/

    "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } #[test] @@ -82,7 +82,7 @@ fn wikilinks_test_7() { let expected = r##"

    This is a pothole.

    "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } #[test] @@ -92,7 +92,7 @@ fn wikilinks_test_8() { let expected = r##"

    This is a WikiLink.

    "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } #[test] @@ -102,7 +102,7 @@ fn wikilinks_test_9() { let expected = r##"

    This is a strong pothole.

    "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } #[test] @@ -117,7 +117,7 @@ fn wikilinks_test_10() {

    "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } #[test] @@ -127,7 +127,7 @@ fn wikilinks_test_11() { let expected = r##"

    [[WikiLink|Fish]]

    "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } #[test] @@ -137,7 +137,7 @@ fn wikilinks_test_12() { let expected = r##"

    [[WikiLink|cat]]

    "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } #[test] @@ -152,7 +152,7 @@ fn wikilinks_test_13() {

    "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } #[test] @@ -162,7 +162,7 @@ fn wikilinks_test_14() { let expected = r##"

    a cute dog

    "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } #[test] @@ -172,7 +172,7 @@ fn wikilinks_test_15() { let expected = r##"

    ]] [[]] [[|]] [[|Symbol]] [[

    "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } #[test] @@ -182,7 +182,7 @@ fn wikilinks_test_16() { let expected = r##"

    inline link

    "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } #[test] @@ -192,7 +192,7 @@ fn wikilinks_test_17() { let expected = r##"

    inline link]]

    "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } #[test] @@ -202,7 +202,7 @@ fn wikilinks_test_18() { let expected = r##"

    [[code]]

    "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } #[test] @@ -212,7 +212,7 @@ fn wikilinks_test_19() { let expected = r##"

    emphasis **cross over** here

    "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } #[test] @@ -222,7 +222,7 @@ fn wikilinks_test_20() { let expected = r##"

    second

    "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } #[test] @@ -232,5 +232,5 @@ fn wikilinks_test_21() { let expected = r##"

    first&#33;second

    "##; - test_markdown_html(original, expected, false, false, false, false, true, false); + test_markdown_html(original, expected, false, false, false, false, true, false, false); } From a764586faec798f947a92497cfcfab64d5896121 Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Tue, 10 Jun 2025 18:50:38 +0100 Subject: [PATCH 131/180] cli and enable flag --- pulldown-cmark/src/firstpass.rs | 2 +- pulldown-cmark/src/main.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 90f0c58c..34481fa1 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -265,7 +265,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { break; } } - } else if line_start.scan_spoiler_fence() { + } else if self.options.contains(Options::ENABLE_SPOILER) && line_start.scan_spoiler_fence() { let mut summary_start = start_ix + line_start.bytes_scanned(); summary_start += scan_whitespace_no_nl(&bytes[summary_start..]); let line_end = summary_start + scan_nextline(&bytes[summary_start..]); diff --git a/pulldown-cmark/src/main.rs b/pulldown-cmark/src/main.rs index fcb8b3af..f59d1e85 100644 --- a/pulldown-cmark/src/main.rs +++ b/pulldown-cmark/src/main.rs @@ -109,6 +109,7 @@ pub fn main() -> std::io::Result<()> { "enable Commonmark-HS-Extensions compatible definition lists", ); opts.optflag("W", "enable-wikilinks", "enable wikilinks"); + opts.optflag("s", "enable-spoiler", "enable spoiler"); let matches = match opts.parse(&args[1..]) { Ok(m) => m, @@ -165,6 +166,9 @@ pub fn main() -> std::io::Result<()> { if matches.opt_present("enable-wikilinks") { opts.insert(Options::ENABLE_WIKILINKS); } + if matches.opt_present("enable-spoiler") { + opts.insert(Options::ENABLE_SPOILER); + } let mut input = String::new(); let mut broken_links = vec![]; From 06a24f7f407a7f1979ae7c21178d61f1423a597e Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Wed, 11 Jun 2025 08:59:20 +0100 Subject: [PATCH 132/180] fmt --- pulldown-cmark/build.rs | 210 +++++++++++++++++--------------- pulldown-cmark/src/firstpass.rs | 15 ++- pulldown-cmark/src/scanners.rs | 6 +- 3 files changed, 122 insertions(+), 109 deletions(-) diff --git a/pulldown-cmark/build.rs b/pulldown-cmark/build.rs index 72a24ce1..8f950a1d 100644 --- a/pulldown-cmark/build.rs +++ b/pulldown-cmark/build.rs @@ -169,107 +169,115 @@ impl<'a> Iterator for Spec<'a> { let spec = self.spec; let prefix = "```````````````````````````````` example"; - let (i_start, smart_punct, metadata_blocks, old_footnotes, subscript, wikilinks, deflists, spoiler) = - self.spec.find(prefix).and_then(|pos| { - let smartpunct_suffix = "_smartpunct\n"; - let metadata_blocks_suffix = "_metadata_blocks\n"; - let old_footnotes_suffix = "_old_footnotes\n"; - let super_sub_suffix = "_super_sub\n"; - let wikilinks_suffix = "_wikilinks\n"; - let deflists_suffix = "_deflists\n"; - let spoiler_suffix = "_spoiler\n"; - if spec[(pos + prefix.len())..].starts_with(smartpunct_suffix) { - Some(( - pos + prefix.len() + smartpunct_suffix.len(), - true, - false, - false, - false, - false, - false, - false, - )) - } else if spec[(pos + prefix.len())..].starts_with(metadata_blocks_suffix) { - Some(( - pos + prefix.len() + metadata_blocks_suffix.len(), - false, - true, - false, - false, - false, - false, - false, - )) - } else if spec[(pos + prefix.len())..].starts_with(old_footnotes_suffix) { - Some(( - pos + prefix.len() + old_footnotes_suffix.len(), - false, - false, - true, - false, - false, - false, - false, - )) - } else if spec[(pos + prefix.len())..].starts_with(super_sub_suffix) { - Some(( - pos + prefix.len() + super_sub_suffix.len(), - false, - false, - false, - true, - false, - false, - false, - )) - } else if spec[(pos + prefix.len())..].starts_with(wikilinks_suffix) { - Some(( - pos + prefix.len() + wikilinks_suffix.len(), - false, - false, - false, - false, - true, - false, - false, - )) - } else if spec[(pos + prefix.len())..].starts_with(deflists_suffix) { - Some(( - pos + prefix.len() + deflists_suffix.len(), - false, - false, - false, - false, - false, - true, - false, - )) - } else if spec[(pos + prefix.len())..].starts_with(spoiler_suffix) { - Some(( - pos + prefix.len() + spoiler_suffix.len(), - false, - false, - false, - false, - false, - false, - true, - )) - } else if spec[(pos + prefix.len())..].starts_with('\n') { - Some(( - pos + prefix.len() + 1, - false, - false, - false, - false, - false, - false, - false, - )) - } else { - None - } - })?; + let ( + i_start, + smart_punct, + metadata_blocks, + old_footnotes, + subscript, + wikilinks, + deflists, + spoiler, + ) = self.spec.find(prefix).and_then(|pos| { + let smartpunct_suffix = "_smartpunct\n"; + let metadata_blocks_suffix = "_metadata_blocks\n"; + let old_footnotes_suffix = "_old_footnotes\n"; + let super_sub_suffix = "_super_sub\n"; + let wikilinks_suffix = "_wikilinks\n"; + let deflists_suffix = "_deflists\n"; + let spoiler_suffix = "_spoiler\n"; + if spec[(pos + prefix.len())..].starts_with(smartpunct_suffix) { + Some(( + pos + prefix.len() + smartpunct_suffix.len(), + true, + false, + false, + false, + false, + false, + false, + )) + } else if spec[(pos + prefix.len())..].starts_with(metadata_blocks_suffix) { + Some(( + pos + prefix.len() + metadata_blocks_suffix.len(), + false, + true, + false, + false, + false, + false, + false, + )) + } else if spec[(pos + prefix.len())..].starts_with(old_footnotes_suffix) { + Some(( + pos + prefix.len() + old_footnotes_suffix.len(), + false, + false, + true, + false, + false, + false, + false, + )) + } else if spec[(pos + prefix.len())..].starts_with(super_sub_suffix) { + Some(( + pos + prefix.len() + super_sub_suffix.len(), + false, + false, + false, + true, + false, + false, + false, + )) + } else if spec[(pos + prefix.len())..].starts_with(wikilinks_suffix) { + Some(( + pos + prefix.len() + wikilinks_suffix.len(), + false, + false, + false, + false, + true, + false, + false, + )) + } else if spec[(pos + prefix.len())..].starts_with(deflists_suffix) { + Some(( + pos + prefix.len() + deflists_suffix.len(), + false, + false, + false, + false, + false, + true, + false, + )) + } else if spec[(pos + prefix.len())..].starts_with(spoiler_suffix) { + Some(( + pos + prefix.len() + spoiler_suffix.len(), + false, + false, + false, + false, + false, + false, + true, + )) + } else if spec[(pos + prefix.len())..].starts_with('\n') { + Some(( + pos + prefix.len() + 1, + false, + false, + false, + false, + false, + false, + false, + )) + } else { + None + } + })?; let i_end = self.spec[i_start..] .find("\n.\n") diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 34481fa1..7aca4df8 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -265,14 +265,19 @@ impl<'a, 'b> FirstPass<'a, 'b> { break; } } - } else if self.options.contains(Options::ENABLE_SPOILER) && line_start.scan_spoiler_fence() { + } else if self.options.contains(Options::ENABLE_SPOILER) + && line_start.scan_spoiler_fence() + { let mut summary_start = start_ix + line_start.bytes_scanned(); summary_start += scan_whitespace_no_nl(&bytes[summary_start..]); let line_end = summary_start + scan_nextline(&bytes[summary_start..]); - let summary_end = line_end - scan_rev_while(&bytes[summary_start..line_end], is_ascii_whitespace); - let info_string = - unescape(&self.text[summary_start..summary_end], self.tree.is_in_table()); - let cow_ix = self.allocs.allocate_cow(info_string); + let summary_end = + line_end - scan_rev_while(&bytes[summary_start..line_end], is_ascii_whitespace); + let summary = unescape( + &self.text[summary_start..summary_end], + self.tree.is_in_table(), + ); + let cow_ix = self.allocs.allocate_cow(summary); self.tree.append(Item { start: container_start, diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index 9c37631d..480360ec 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -270,7 +270,7 @@ impl<'a> LineStart<'a> { } pub(crate) fn scan_spoiler_fence(&mut self) -> bool { - if self.scan_case_insensitive(b":::") { + if self.scan_case_insensitive(b":::") { if self.scan_case_insensitive(b" spoiler ") { true } else { @@ -282,8 +282,8 @@ impl<'a> LineStart<'a> { } pub(crate) fn scan_closing_spoiler_fence(&mut self) -> bool { - if self.scan_case_insensitive(b":::") { - true + if self.scan_case_insensitive(b":::") { + true } else { false } From 568b4979ef9133fba5fd4f3542c5cf4bfd11a599 Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Wed, 11 Jun 2025 09:22:29 +0100 Subject: [PATCH 133/180] address warning --- fuzz/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuzz/src/lib.rs b/fuzz/src/lib.rs index 488a6bb1..adea8a9b 100644 --- a/fuzz/src/lib.rs +++ b/fuzz/src/lib.rs @@ -112,7 +112,7 @@ pub fn commonmark_js(text: &str) -> anyhow::Result { } /// Parse commonmark.js XML and return Markdown events. -pub fn xml_to_events(xml: &str) -> anyhow::Result> { +pub fn xml_to_events(xml: &str) -> anyhow::Result>> { let mut block_container_stack = Vec::new(); let mut heading_stack = Vec::new(); From bdbb72e0b085f973050813eba84560c15390f647 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Thu, 26 Jun 2025 10:27:59 -0700 Subject: [PATCH 134/180] Fix confusing lifetime syntax in fuzzer Fixes a `mismatched_lifetime_syntaxes` warning. --- fuzz/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuzz/src/lib.rs b/fuzz/src/lib.rs index 488a6bb1..adea8a9b 100644 --- a/fuzz/src/lib.rs +++ b/fuzz/src/lib.rs @@ -112,7 +112,7 @@ pub fn commonmark_js(text: &str) -> anyhow::Result { } /// Parse commonmark.js XML and return Markdown events. -pub fn xml_to_events(xml: &str) -> anyhow::Result> { +pub fn xml_to_events(xml: &str) -> anyhow::Result>> { let mut block_container_stack = Vec::new(); let mut heading_stack = Vec::new(); From 0aaa004c932c5feb994c9ef763a1683b1e006dd9 Mon Sep 17 00:00:00 2001 From: Expyron <5100376+Expyron@users.noreply.github.com> Date: Mon, 30 Jun 2025 19:07:08 +0200 Subject: [PATCH 135/180] Remove unused dependency --- Cargo.lock | 1 - pulldown-cmark/Cargo.toml | 1 - 2 files changed, 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 15da9fea..5b055b0f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1472,7 +1472,6 @@ dependencies = [ "bitflags", "getopts", "hashbrown 0.15.2", - "lazy_static", "memchr", "pulldown-cmark-escape", "regex", diff --git a/pulldown-cmark/Cargo.toml b/pulldown-cmark/Cargo.toml index 85e9dc8f..bbfb6621 100644 --- a/pulldown-cmark/Cargo.toml +++ b/pulldown-cmark/Cargo.toml @@ -72,7 +72,6 @@ pulldown-cmark-escape = { path = "../pulldown-cmark-escape", version = "0.11", o hashbrown = { version = "0.15.2", optional = true } [dev-dependencies] -lazy_static = "1.4" regex = "1.6" serde_json = "1.0.61" bincode = "1.3.1" From 68e521018217d6b9b5881668dd94d15ed7cf9fb8 Mon Sep 17 00:00:00 2001 From: Em Sharnoff Date: Thu, 19 Jun 2025 22:20:12 +0100 Subject: [PATCH 136/180] Extract non-generic ParserInner The current `Parser`'s generics are a source of longer compile times due to each instantiation needing to compile and optimize separate copies of very large and complex functions. There are good reasons to keep the `BrokenLinkCallback` as a generic argument (see #701), so to provide the same API while reducing compile times, extract the non-generic bits of the parser into a separate struct. The new `ParserInner`'s methods take a `dyn BrokenLinkCallback`. And while we're at it, let's unify the iterator impls for `Parser` and `OffsetIter`, so that the logic is not duplicated. --- pulldown-cmark/src/parse.rs | 198 ++++++++++++++++++------------------ 1 file changed, 101 insertions(+), 97 deletions(-) diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 24ff1309..0de8c7c9 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -191,11 +191,17 @@ pub struct BrokenLink<'a> { /// Markdown event iterator. pub struct Parser<'input, F = DefaultBrokenLinkCallback> { + broken_link_callback: Option, + inner: ParserInner<'input>, +} + +// Inner state for `Parser`, extracted so that it can remain generic over the callback without +// re-compiling complex logic for each instantiation of the generic type. +struct ParserInner<'input> { text: &'input str, options: Options, tree: Tree, allocs: Allocations<'input>, - broken_link_callback: Option, html_scan_guard: HtmlScanGuard, // https://github.com/pulldown-cmark/pulldown-cmark/issues/844 @@ -228,8 +234,8 @@ impl<'input, F> core::fmt::Debug for Parser<'input, F> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { // Only print the fields that have public types. f.debug_struct("Parser") - .field("text", &self.text) - .field("options", &self.options) + .field("text", &self.inner.text) + .field("options", &self.inner.options) .field( "broken_link_callback", &self.broken_link_callback.as_ref().map(|_| ..), @@ -281,28 +287,40 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { let wikilink_stack = Default::default(); let html_scan_guard = Default::default(); Parser { - text, - options, - tree, - allocs, broken_link_callback, - inline_stack, - link_stack, - wikilink_stack, - html_scan_guard, - // always allow 100KiB - link_ref_expansion_limit: text.len().max(100_000), - code_delims: CodeDelims::new(), - math_delims: MathDelims::new(), + + inner: ParserInner { + text, + options, + tree, + allocs, + inline_stack, + link_stack, + wikilink_stack, + html_scan_guard, + // always allow 100KiB + link_ref_expansion_limit: text.len().max(100_000), + code_delims: CodeDelims::new(), + math_delims: MathDelims::new(), + }, } } /// Returns a reference to the internal `RefDefs` object, which provides access /// to the internal map of reference definitions. pub fn reference_definitions(&self) -> &RefDefs<'_> { - &self.allocs.refdefs + &self.inner.allocs.refdefs } + /// Consumes the event iterator and produces an iterator that produces + /// `(Event, Range)` pairs, where the `Range` value maps to the corresponding + /// range in the markdown source. + pub fn into_offset_iter(self) -> OffsetIter<'input, F> { + OffsetIter { parser: self } + } +} + +impl<'input> ParserInner<'input> { /// Use a link label to fetch a type, url, and title. /// /// This function enforces the [`link_ref_expansion_limit`]. @@ -327,6 +345,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { link_label: CowStr<'input>, span: Range, link_type: LinkType, + broken_link_callback: &mut Option<&mut dyn BrokenLinkCallback<'input>>, ) -> Option<(LinkType, CowStr<'input>, CowStr<'input>)> { if self.link_ref_expansion_limit == 0 { return None; @@ -347,7 +366,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { (link_type, url, title) }) .or_else(|| { - match self.broken_link_callback.as_mut() { + match broken_link_callback { Some(callback) => { // Construct a BrokenLink struct, which will be passed to the callback let broken_link = BrokenLink { @@ -380,8 +399,11 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { /// inline markup passes are run on the remainder of the chain. /// /// Note: there's some potential for optimization here, but that's future work. - fn handle_inline(&mut self) { - self.handle_inline_pass1(); + fn handle_inline( + &mut self, + broken_link_callback: &mut Option<&mut dyn BrokenLinkCallback<'input>>, + ) { + self.handle_inline_pass1(broken_link_callback); self.handle_emphasis_and_hard_break(); } @@ -390,7 +412,10 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { /// This function handles both inline HTML and code spans, because they have /// the same precedence. It also handles links, even though they have lower /// precedence, because the URL of links must not be processed. - fn handle_inline_pass1(&mut self) { + fn handle_inline_pass1( + &mut self, + broken_link_callback: &mut Option<&mut dyn BrokenLinkCallback<'input>>, + ) { let mut cur = self.tree.cur(); let mut prev = None; @@ -816,6 +841,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { link_label, (self.tree[tos.node].item.start)..end, link_type, + broken_link_callback, ) { let link_ix = @@ -1433,13 +1459,6 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { Some((span, i + ix - 1)) } } - - /// Consumes the event iterator and produces an iterator that produces - /// `(Event, Range)` pairs, where the `Range` value maps to the corresponding - /// range in the markdown source. - pub fn into_offset_iter(self) -> OffsetIter<'input, F> { - OffsetIter { inner: self } - } } /// Returns number of containers scanned. @@ -2174,13 +2193,13 @@ impl<'input> BrokenLinkCallback<'input> for DefaultBrokenLinkCallback { /// [`into_offset_iter`](struct.Parser.html#method.into_offset_iter) method. #[derive(Debug)] pub struct OffsetIter<'a, F = DefaultBrokenLinkCallback> { - inner: Parser<'a, F>, + parser: Parser<'a, F>, } impl<'a, F: BrokenLinkCallback<'a>> OffsetIter<'a, F> { /// Returns a reference to the internal reference definition tracker. pub fn reference_definitions(&self) -> &RefDefs<'_> { - self.inner.reference_definitions() + self.parser.reference_definitions() } } @@ -2188,42 +2207,73 @@ impl<'a, F: BrokenLinkCallback<'a>> Iterator for OffsetIter<'a, F> { type Item = (Event<'a>, Range); fn next(&mut self) -> Option { - match self.inner.tree.cur() { + let broken_link_callback = self + .parser + .broken_link_callback + .as_mut() + .map(|f| f as &mut dyn BrokenLinkCallback<'a>); + + self.parser.inner.next_event_range(broken_link_callback) + } +} + +impl<'a, F: BrokenLinkCallback<'a>> Iterator for Parser<'a, F> { + type Item = Event<'a>; + + fn next(&mut self) -> Option> { + let broken_link_callback = self + .broken_link_callback + .as_mut() + .map(|f| f as &mut dyn BrokenLinkCallback<'a>); + + self.inner + .next_event_range(broken_link_callback) + .map(|(event, _range)| event) + } +} + +impl<'a, F: BrokenLinkCallback<'a>> FusedIterator for Parser<'a, F> {} + +impl<'input> ParserInner<'input> { + fn next_event_range( + &mut self, + mut broken_link_callback: Option<&mut dyn BrokenLinkCallback<'input>>, + ) -> Option<(Event<'input>, Range)> { + match self.tree.cur() { None => { - let ix = self.inner.tree.pop()?; - let ix = if matches!(self.inner.tree[ix].item.body, ItemBody::TightParagraph) { + let ix = self.tree.pop()?; + let ix = if matches!(self.tree[ix].item.body, ItemBody::TightParagraph) { // tight paragraphs emit nothing - self.inner.tree.next_sibling(ix); - return self.next(); + self.tree.next_sibling(ix); + return self.next_event_range(broken_link_callback); } else { ix }; - let tag_end = body_to_tag_end(&self.inner.tree[ix].item.body); - self.inner.tree.next_sibling(ix); - let span = self.inner.tree[ix].item.start..self.inner.tree[ix].item.end; + let tag_end = body_to_tag_end(&self.tree[ix].item.body); + self.tree.next_sibling(ix); + let span = self.tree[ix].item.start..self.tree[ix].item.end; debug_assert!(span.start <= span.end); Some((Event::End(tag_end), span)) } Some(cur_ix) => { - let cur_ix = - if matches!(self.inner.tree[cur_ix].item.body, ItemBody::TightParagraph) { - // tight paragraphs emit nothing - self.inner.tree.push(); - self.inner.tree.cur().unwrap() - } else { - cur_ix - }; - if self.inner.tree[cur_ix].item.body.is_maybe_inline() { - self.inner.handle_inline(); + let cur_ix = if matches!(self.tree[cur_ix].item.body, ItemBody::TightParagraph) { + // tight paragraphs emit nothing + self.tree.push(); + self.tree.cur().unwrap() + } else { + cur_ix + }; + if self.tree[cur_ix].item.body.is_maybe_inline() { + self.handle_inline(&mut broken_link_callback); } - let node = self.inner.tree[cur_ix]; + let node = self.tree[cur_ix]; let item = node.item; - let event = item_to_event(item, self.inner.text, &mut self.inner.allocs); + let event = item_to_event(item, self.text, &mut self.allocs); if let Event::Start(..) = event { - self.inner.tree.push(); + self.tree.push(); } else { - self.inner.tree.next_sibling(cur_ix); + self.tree.next_sibling(cur_ix); } debug_assert!(item.start <= item.end); Some((event, item.start..item.end)) @@ -2355,52 +2405,6 @@ fn item_to_event<'a>(item: Item, text: &'a str, allocs: &mut Allocations<'a>) -> Event::Start(tag) } -impl<'a, F: BrokenLinkCallback<'a>> Iterator for Parser<'a, F> { - type Item = Event<'a>; - - fn next(&mut self) -> Option> { - match self.tree.cur() { - None => { - let ix = self.tree.pop()?; - let ix = if matches!(self.tree[ix].item.body, ItemBody::TightParagraph) { - // tight paragraphs emit nothing - self.tree.next_sibling(ix); - return self.next(); - } else { - ix - }; - let tag_end = body_to_tag_end(&self.tree[ix].item.body); - self.tree.next_sibling(ix); - Some(Event::End(tag_end)) - } - Some(cur_ix) => { - let cur_ix = if matches!(self.tree[cur_ix].item.body, ItemBody::TightParagraph) { - // tight paragraphs emit nothing - self.tree.push(); - self.tree.cur().unwrap() - } else { - cur_ix - }; - if self.tree[cur_ix].item.body.is_maybe_inline() { - self.handle_inline(); - } - - let node = self.tree[cur_ix]; - let item = node.item; - let event = item_to_event(item, self.text, &mut self.allocs); - if let Event::Start(ref _tag) = event { - self.tree.push(); - } else { - self.tree.next_sibling(cur_ix); - } - Some(event) - } - } - } -} - -impl<'a, F: BrokenLinkCallback<'a>> FusedIterator for Parser<'a, F> {} - #[cfg(test)] mod test { use alloc::{borrow::ToOwned, string::ToString, vec::Vec}; From 4e11ca4b7d3a7cce1837af0dde459d819e3a237e Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Wed, 2 Jul 2025 18:40:51 +0100 Subject: [PATCH 137/180] container extension refactor --- pulldown-cmark/build.rs | 16 +++---- .../examples/parser-map-tag-print.rs | 4 +- .../{spoiler.txt => container_extensions.txt} | 39 ++++++++++++--- pulldown-cmark/src/firstpass.rs | 42 ++++++++++++----- pulldown-cmark/src/html.rs | 26 ++++++++-- pulldown-cmark/src/lib.rs | 20 +++++--- pulldown-cmark/src/main.rs | 10 ++-- pulldown-cmark/src/parse.rs | 14 +++--- pulldown-cmark/src/scanners.rs | 18 +++---- pulldown-cmark/tests/lib.rs | 6 +-- .../{spoiler.rs => container_extensions.rs} | 47 ++++++++++++++++--- pulldown-cmark/tests/suite/mod.rs | 2 +- 12 files changed, 178 insertions(+), 66 deletions(-) rename pulldown-cmark/specs/{spoiler.txt => container_extensions.txt} (71%) rename pulldown-cmark/tests/suite/{spoiler.rs => container_extensions.rs} (76%) diff --git a/pulldown-cmark/build.rs b/pulldown-cmark/build.rs index 8f950a1d..8cd7efa6 100644 --- a/pulldown-cmark/build.rs +++ b/pulldown-cmark/build.rs @@ -86,7 +86,7 @@ fn {}_test_{i}() {{ let original = r##"{original}"##; let expected = r##"{expected}"##; - test_markdown_html(original, expected, {smart_punct}, {metadata_blocks}, {old_footnotes}, {subscript}, {wikilinks}, {deflists}, {spoiler}); + test_markdown_html(original, expected, {smart_punct}, {metadata_blocks}, {old_footnotes}, {subscript}, {wikilinks}, {deflists}, {container_extensions}); }} "###, spec_name, @@ -99,7 +99,7 @@ fn {}_test_{i}() {{ subscript = testcase.subscript, wikilinks = testcase.wikilinks, deflists = testcase.deflists, - spoiler = testcase.spoiler, + container_extensions = testcase.container_extensions, )) .unwrap(); @@ -158,7 +158,7 @@ pub struct TestCase { pub subscript: bool, pub wikilinks: bool, pub deflists: bool, - pub spoiler: bool, + pub container_extensions: bool, } #[cfg(feature = "gen-tests")] @@ -177,7 +177,7 @@ impl<'a> Iterator for Spec<'a> { subscript, wikilinks, deflists, - spoiler, + container_extensions, ) = self.spec.find(prefix).and_then(|pos| { let smartpunct_suffix = "_smartpunct\n"; let metadata_blocks_suffix = "_metadata_blocks\n"; @@ -185,7 +185,7 @@ impl<'a> Iterator for Spec<'a> { let super_sub_suffix = "_super_sub\n"; let wikilinks_suffix = "_wikilinks\n"; let deflists_suffix = "_deflists\n"; - let spoiler_suffix = "_spoiler\n"; + let container_extensions_suffix = "_container_extensions\n"; if spec[(pos + prefix.len())..].starts_with(smartpunct_suffix) { Some(( pos + prefix.len() + smartpunct_suffix.len(), @@ -252,9 +252,9 @@ impl<'a> Iterator for Spec<'a> { true, false, )) - } else if spec[(pos + prefix.len())..].starts_with(spoiler_suffix) { + } else if spec[(pos + prefix.len())..].starts_with(container_extensions_suffix) { Some(( - pos + prefix.len() + spoiler_suffix.len(), + pos + prefix.len() + container_extensions_suffix.len(), false, false, false, @@ -298,7 +298,7 @@ impl<'a> Iterator for Spec<'a> { subscript, wikilinks, deflists, - spoiler, + container_extensions, }; Some(test_case) diff --git a/pulldown-cmark/examples/parser-map-tag-print.rs b/pulldown-cmark/examples/parser-map-tag-print.rs index 68316b7e..c3bbdc9c 100644 --- a/pulldown-cmark/examples/parser-map-tag-print.rs +++ b/pulldown-cmark/examples/parser-map-tag-print.rs @@ -73,8 +73,8 @@ fn main() { Tag::CodeBlock(code_block_kind) => { println!("CodeBlock code_block_kind: {:?}", code_block_kind) } - Tag::SpoilerBlock(summary) => { - println!("SpoilerBlock summary: {:?}", summary) + Tag::ContainerBlock(kind, summary) => { + println!("ContainerBlock ({:?}) summary: {:?}", kind, summary) } Tag::Link { link_type, diff --git a/pulldown-cmark/specs/spoiler.txt b/pulldown-cmark/specs/container_extensions.txt similarity index 71% rename from pulldown-cmark/specs/spoiler.txt rename to pulldown-cmark/specs/container_extensions.txt index c55af173..96a9c75d 100644 --- a/pulldown-cmark/specs/spoiler.txt +++ b/pulldown-cmark/specs/container_extensions.txt @@ -1,6 +1,6 @@ # Spoiler tests -```````````````````````````````` example_spoiler +```````````````````````````````` example_container_extensions > Is this **bold**? > Is this **bold**? > ::: spoiler Is this expandable? @@ -16,7 +16,7 @@ Is this bold?

    ```````````````````````````````` -```````````````````````````````` example_spoiler +```````````````````````````````` example_container_extensions ::: spoiler Is this expandable? Is this collapsable? > Is this **bold**? @@ -33,7 +33,7 @@ Is this bold?

    is this seperate and bold

    ```````````````````````````````` -```````````````````````````````` example_spoiler +```````````````````````````````` example_container_extensions ::: spoiler Is this expandable? Is this collapsable? > Is this **bold**? @@ -56,7 +56,7 @@ Is this bold?

    ```````````````````````````````` -```````````````````````````````` example_spoiler +```````````````````````````````` example_container_extensions ::: spoiler Is this expandable? Is this collapsable? > Is this **bold**? @@ -85,7 +85,7 @@ Is this bold?

    is this seperate and bold

    ```````````````````````````````` -```````````````````````````````` example_spoiler +```````````````````````````````` example_container_extensions ::: spoiler Is this expandable? Is this collapsable? ::: @@ -98,7 +98,7 @@ Is this collapsable?

    is this seperate and bold

    ```````````````````````````````` -```````````````````````````````` example_spoiler +```````````````````````````````` example_container_extensions ::: spoiler Is this expandable? Is this collapsable? @@ -111,3 +111,30 @@ Is this **bold**?

    Is this bold?

    ```````````````````````````````` + +```````````````````````````````` example_container_extensions +:::spoiler Is this expandable? +Is this collapsable? + +Is this **bold**? +::: +. +
    +Is this expandable? +

    Is this collapsable?

    +

    Is this bold?

    +
    +```````````````````````````````` + +```````````````````````````````` example_container_extensions +::: example Is this expandable? +Is this collapsable? + +Is this **bold**? +::: +. +
    +

    Is this collapsable?

    +

    Is this bold?

    +
    +```````````````````````````````` diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 7aca4df8..8e7ac8e6 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -15,6 +15,7 @@ use crate::{ scanners::*, strings::CowStr, tree::{Tree, TreeIndex}, + ContainerKind::*, HeadingLevel, MetadataBlockKind, Options, }; @@ -265,10 +266,22 @@ impl<'a, 'b> FirstPass<'a, 'b> { break; } } - } else if self.options.contains(Options::ENABLE_SPOILER) - && line_start.scan_spoiler_fence() + } else if self.options.contains(Options::ENABLE_CONTAINER_EXTENSIONS) + && line_start.scan_container_extensions_fence() { - let mut summary_start = start_ix + line_start.bytes_scanned(); + let mut kind_start = start_ix + line_start.bytes_scanned(); + kind_start += scan_whitespace_no_nl(&bytes[kind_start..]); + + let kind_end = scan_while(&bytes[kind_start..], is_ascii_alphanumeric); + // line_end - scan_rev_while(&bytes[summary_start..line_end], is_ascii_whitespace); + // + let kind = unescape( + &self.text[kind_start..(kind_start + kind_end)], + self.tree.is_in_table(), + ); + + // let mut summary_start = start_ix + line_start.bytes_scanned(); + let mut summary_start = kind_start + kind_end; summary_start += scan_whitespace_no_nl(&bytes[summary_start..]); let line_end = summary_start + scan_nextline(&bytes[summary_start..]); let summary_end = @@ -279,13 +292,20 @@ impl<'a, 'b> FirstPass<'a, 'b> { ); let cow_ix = self.allocs.allocate_cow(summary); - self.tree.append(Item { - start: container_start, - end: 0, // will get set later - body: ItemBody::Spoiler(cow_ix), - }); + if kind.eq_ignore_ascii_case("spoiler") { + self.tree.append(Item { + start: container_start, + end: 0, // will get set later + body: ItemBody::Container(Spoiler, cow_ix), + }); + } else if kind.eq_ignore_ascii_case("example") { + self.tree.append(Item { + start: container_start, + end: 0, // will get set later + body: ItemBody::Container(Example, cow_ix), + }); + } self.tree.push(); - return summary_end + 1; } else { line_start = save; @@ -298,7 +318,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { if let Some(n) = scan_blank_line(&bytes[ix..]) { if let Some(node_ix) = self.tree.peek_up() { match &mut self.tree[node_ix].item.body { - ItemBody::Spoiler(..) => (), + ItemBody::Container(..) => (), ItemBody::BlockQuote(..) => (), ItemBody::ListItem(indent) | ItemBody::DefinitionListDefinition(indent) if self.begin_list_item.is_some() => @@ -2155,7 +2175,7 @@ fn scan_paragraph_interrupt_no_table( || scan_hrule(bytes).is_ok() || scan_atx_heading(bytes).is_some() || scan_code_fence(bytes).is_some() - || scan_closing_spoiler_fence(bytes).is_some() + || scan_closing_container_extensions_fence(bytes).is_some() || scan_blockquote_start(bytes).is_some() || scan_listitem(bytes).map_or(false, |(ix, delim, index, _)| { ! current_container || diff --git a/pulldown-cmark/src/html.rs b/pulldown-cmark/src/html.rs index 4195cfb4..a8f6b828 100644 --- a/pulldown-cmark/src/html.rs +++ b/pulldown-cmark/src/html.rs @@ -31,8 +31,11 @@ use pulldown_cmark_escape::IoWriter; use pulldown_cmark_escape::{escape_href, escape_html, escape_html_body_text, FmtWriter, StrWrite}; use crate::{ - strings::CowStr, Alignment, BlockQuoteKind, CodeBlockKind, Event, Event::*, LinkType, Tag, - TagEnd, + strings::CowStr, + Alignment, BlockQuoteKind, CodeBlockKind, + ContainerKind::*, + Event::{self, *}, + LinkType, Tag, TagEnd, }; enum TableState { @@ -276,7 +279,19 @@ where CodeBlockKind::Indented => self.write("
    "),
                     }
                 }
    -            Tag::SpoilerBlock(summary) => {
    +            Tag::ContainerBlock(Example, _) => {
    +                if !self.end_newline {
    +                    self.write_newline()?;
    +                }
    +                // if summary.is_empty() {
    +                self.write("
    ") + // } else { + // self.write("
    ") + // } + } + Tag::ContainerBlock(Spoiler, summary) => { if !self.end_newline { self.write_newline()?; } @@ -446,9 +461,12 @@ where TagEnd::CodeBlock => { self.write("
    \n")?; } - TagEnd::SpoilerBlock => { + TagEnd::ContainerBlock(Spoiler) => { self.write("\n")?; } + TagEnd::ContainerBlock(Example) => { + self.write("\n")?; + } TagEnd::List(true) => { self.write("\n")?; } diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index 56d7ec0c..170d3fa5 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -158,6 +158,14 @@ pub enum BlockQuoteKind { Caution, } +/// ContainerBlock kind (Spoiler only). +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +pub enum ContainerKind { + Spoiler, + Example, +} + /// Metadata block kind. #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] @@ -200,7 +208,7 @@ pub enum Tag<'a> { BlockQuote(Option), /// A code block. CodeBlock(CodeBlockKind<'a>), - SpoilerBlock(CowStr<'a>), + ContainerBlock(ContainerKind, CowStr<'a>), /// An HTML block. /// @@ -313,7 +321,7 @@ impl<'a> Tag<'a> { Tag::Heading { level, .. } => TagEnd::Heading(*level), Tag::BlockQuote(kind) => TagEnd::BlockQuote(*kind), Tag::CodeBlock(_) => TagEnd::CodeBlock, - Tag::SpoilerBlock(_) => TagEnd::SpoilerBlock, + Tag::ContainerBlock(kind, _) => TagEnd::ContainerBlock(*kind), Tag::HtmlBlock => TagEnd::HtmlBlock, Tag::List(number) => TagEnd::List(number.is_some()), Tag::Item => TagEnd::Item, @@ -355,7 +363,7 @@ impl<'a> Tag<'a> { }, Tag::BlockQuote(k) => Tag::BlockQuote(k), Tag::CodeBlock(kb) => Tag::CodeBlock(kb.into_static()), - Tag::SpoilerBlock(s) => Tag::SpoilerBlock(s.into_static()), + Tag::ContainerBlock(k, s) => Tag::ContainerBlock(k, s.into_static()), Tag::HtmlBlock => Tag::HtmlBlock, Tag::List(v) => Tag::List(v), Tag::Item => Tag::Item, @@ -408,7 +416,7 @@ pub enum TagEnd { BlockQuote(Option), CodeBlock, - SpoilerBlock, + ContainerBlock(ContainerKind), HtmlBlock, @@ -757,8 +765,8 @@ bitflags::bitflags! { const ENABLE_SUBSCRIPT = 1 << 14; /// Obsidian-style Wikilinks. const ENABLE_WIKILINKS = 1 << 15; - /// Colon-style Spoilers. - const ENABLE_SPOILER = 1 << 16; + /// Colon-delimited Container Extension Blocks. + const ENABLE_CONTAINER_EXTENSIONS = 1 << 16; } } diff --git a/pulldown-cmark/src/main.rs b/pulldown-cmark/src/main.rs index f59d1e85..5eb2557f 100644 --- a/pulldown-cmark/src/main.rs +++ b/pulldown-cmark/src/main.rs @@ -109,7 +109,11 @@ pub fn main() -> std::io::Result<()> { "enable Commonmark-HS-Extensions compatible definition lists", ); opts.optflag("W", "enable-wikilinks", "enable wikilinks"); - opts.optflag("s", "enable-spoiler", "enable spoiler"); + opts.optflag( + "C", + "enable-container-extensions", + "enable container extensions", + ); let matches = match opts.parse(&args[1..]) { Ok(m) => m, @@ -166,8 +170,8 @@ pub fn main() -> std::io::Result<()> { if matches.opt_present("enable-wikilinks") { opts.insert(Options::ENABLE_WIKILINKS); } - if matches.opt_present("enable-spoiler") { - opts.insert(Options::ENABLE_SPOILER); + if matches.opt_present("enable-container-extensions") { + opts.insert(Options::ENABLE_CONTAINER_EXTENSIONS); } let mut input = String::new(); diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index ee0d4513..9f42c525 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -40,8 +40,8 @@ use crate::{ scanners::*, strings::CowStr, tree::{Tree, TreeIndex}, - Alignment, BlockQuoteKind, CodeBlockKind, Event, HeadingLevel, LinkType, MetadataBlockKind, - Options, Tag, TagEnd, + Alignment, BlockQuoteKind, CodeBlockKind, ContainerKind, Event, HeadingLevel, LinkType, + MetadataBlockKind, Options, Tag, TagEnd, }; // Allowing arbitrary depth nested parentheses inside link destinations @@ -114,7 +114,7 @@ pub(crate) enum ItemBody { IndentCodeBlock, HtmlBlock, BlockQuote(Option), - Spoiler(CowIndex), + Container(ContainerKind, CowIndex), List(bool, u8, u64), // is_tight, list character, list start index ListItem(usize), // indent level FootnoteDefinition(CowIndex), @@ -1452,8 +1452,8 @@ pub(crate) fn scan_containers( let mut i = 0; for &node_ix in tree.walk_spine() { match tree[node_ix].item.body { - ItemBody::Spoiler(..) => { - if line_start.scan_closing_spoiler_fence() { + ItemBody::Container(..) => { + if line_start.scan_closing_container_extensions_fence() { break; } } @@ -2250,7 +2250,7 @@ fn body_to_tag_end(body: &ItemBody) -> TagEnd { ItemBody::Image(..) => TagEnd::Image, ItemBody::Heading(level, _) => TagEnd::Heading(level), ItemBody::IndentCodeBlock | ItemBody::FencedCodeBlock(..) => TagEnd::CodeBlock, - ItemBody::Spoiler(_) => TagEnd::SpoilerBlock, + ItemBody::Container(kind, _) => TagEnd::ContainerBlock(kind), ItemBody::BlockQuote(kind) => TagEnd::BlockQuote(kind), ItemBody::HtmlBlock => TagEnd::HtmlBlock, ItemBody::List(_, c, _) => { @@ -2331,7 +2331,7 @@ fn item_to_event<'a>(item: Item, text: &'a str, allocs: &mut Allocations<'a>) -> Tag::CodeBlock(CodeBlockKind::Fenced(allocs.take_cow(cow_ix))) } ItemBody::IndentCodeBlock => Tag::CodeBlock(CodeBlockKind::Indented), - ItemBody::Spoiler(cow_ix) => Tag::SpoilerBlock(allocs.take_cow(cow_ix)), + ItemBody::Container(kind, cow_ix) => Tag::ContainerBlock(kind, allocs.take_cow(cow_ix)), ItemBody::BlockQuote(kind) => Tag::BlockQuote(kind), ItemBody::List(_, c, listitem_start) => { if c == b'.' || c == b')' { diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index 480360ec..8c5eddb2 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -269,19 +269,19 @@ impl<'a> LineStart<'a> { } } - pub(crate) fn scan_spoiler_fence(&mut self) -> bool { + pub(crate) fn scan_container_extensions_fence(&mut self) -> bool { if self.scan_case_insensitive(b":::") { - if self.scan_case_insensitive(b" spoiler ") { - true - } else { - false - } + // if self.scan_case_insensitive(b" spoiler ") { + true + // } else { + // false + // } } else { false } } - pub(crate) fn scan_closing_spoiler_fence(&mut self) -> bool { + pub(crate) fn scan_closing_container_extensions_fence(&mut self) -> bool { if self.scan_case_insensitive(b":::") { true } else { @@ -455,7 +455,7 @@ fn is_ascii_alpha(c: u8) -> bool { c.is_ascii_alphabetic() } -fn is_ascii_alphanumeric(c: u8) -> bool { +pub(crate) fn is_ascii_alphanumeric(c: u8) -> bool { matches!(c, b'0'..=b'9' | b'a'..=b'z' | b'A'..=b'Z') } @@ -765,7 +765,7 @@ pub(crate) fn scan_code_fence(data: &[u8]) -> Option<(usize, u8)> { /// Scan closing spoiler fence. /// /// Returns number of bytes scanned and the char that is repeated to make the spoiler fence. -pub(crate) fn scan_closing_spoiler_fence(data: &[u8]) -> Option<(usize, u8)> { +pub(crate) fn scan_closing_container_extensions_fence(data: &[u8]) -> Option<(usize, u8)> { let c = *data.first()?; if !(c == b':') { return None; diff --git a/pulldown-cmark/tests/lib.rs b/pulldown-cmark/tests/lib.rs index a5ddab47..28db823b 100644 --- a/pulldown-cmark/tests/lib.rs +++ b/pulldown-cmark/tests/lib.rs @@ -15,7 +15,7 @@ pub fn test_markdown_html( subscript: bool, wikilinks: bool, deflists: bool, - spoiler: bool, + container_extensions: bool, ) { let mut s = String::new(); @@ -48,8 +48,8 @@ pub fn test_markdown_html( if deflists { opts.insert(Options::ENABLE_DEFINITION_LIST); } - if spoiler { - opts.insert(Options::ENABLE_SPOILER); + if container_extensions { + opts.insert(Options::ENABLE_CONTAINER_EXTENSIONS); } let p = Parser::new_ext(input, opts); diff --git a/pulldown-cmark/tests/suite/spoiler.rs b/pulldown-cmark/tests/suite/container_extensions.rs similarity index 76% rename from pulldown-cmark/tests/suite/spoiler.rs rename to pulldown-cmark/tests/suite/container_extensions.rs index 40c1418d..58d4d70a 100644 --- a/pulldown-cmark/tests/suite/spoiler.rs +++ b/pulldown-cmark/tests/suite/container_extensions.rs @@ -4,7 +4,7 @@ use super::test_markdown_html; #[test] -fn spoiler_test_1() { +fn container_extensions_test_1() { let original = r##"> Is this **bold**? > Is this **bold**? > ::: spoiler Is this expandable? @@ -24,7 +24,7 @@ Is this bold?

    } #[test] -fn spoiler_test_2() { +fn container_extensions_test_2() { let original = r##"::: spoiler Is this expandable? Is this collapsable? > Is this **bold**? @@ -45,7 +45,7 @@ Is this bold?

    } #[test] -fn spoiler_test_3() { +fn container_extensions_test_3() { let original = r##"::: spoiler Is this expandable? Is this collapsable? > Is this **bold**? @@ -72,7 +72,7 @@ Is this bold?

    } #[test] -fn spoiler_test_4() { +fn container_extensions_test_4() { let original = r##"::: spoiler Is this expandable? Is this collapsable? > Is this **bold**? @@ -105,7 +105,7 @@ Is this bold?

    } #[test] -fn spoiler_test_5() { +fn container_extensions_test_5() { let original = r##"::: spoiler Is this expandable? Is this collapsable? ::: @@ -122,7 +122,7 @@ Is this collapsable? } #[test] -fn spoiler_test_6() { +fn container_extensions_test_6() { let original = r##"::: spoiler Is this expandable? Is this collapsable? @@ -138,3 +138,38 @@ Is this **bold**? test_markdown_html(original, expected, false, false, false, false, false, false, true); } + +#[test] +fn container_extensions_test_7() { + let original = r##":::spoiler Is this expandable? +Is this collapsable? + +Is this **bold**? +::: +"##; + let expected = r##"
    +Is this expandable? +

    Is this collapsable?

    +

    Is this bold?

    +
    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, true); +} + +#[test] +fn container_extensions_test_8() { + let original = r##"::: example Is this expandable? +Is this collapsable? + +Is this **bold**? +::: +"##; + let expected = r##"
    +

    Is this collapsable?

    +

    Is this bold?

    +
    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, true); +} diff --git a/pulldown-cmark/tests/suite/mod.rs b/pulldown-cmark/tests/suite/mod.rs index 4e44cdb4..b6f01c44 100644 --- a/pulldown-cmark/tests/suite/mod.rs +++ b/pulldown-cmark/tests/suite/mod.rs @@ -4,6 +4,7 @@ pub use super::test_markdown_html; mod blockquotes_tags; +mod container_extensions; mod definition_lists; mod footnotes; mod gfm_strikethrough; @@ -16,7 +17,6 @@ mod old_footnotes; mod regression; mod smart_punct; mod spec; -mod spoiler; mod strikethrough; mod super_sub; mod table; From 267cce307573257bbe19dd85a6e29a35be35a9ce Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Wed, 2 Jul 2025 18:50:11 +0100 Subject: [PATCH 138/180] tidy --- pulldown-cmark/specs/container_extensions.txt | 2 +- pulldown-cmark/src/firstpass.rs | 8 ++------ pulldown-cmark/src/html.rs | 6 ------ pulldown-cmark/tests/suite/container_extensions.rs | 2 +- 4 files changed, 4 insertions(+), 14 deletions(-) diff --git a/pulldown-cmark/specs/container_extensions.txt b/pulldown-cmark/specs/container_extensions.txt index 96a9c75d..79a75ff2 100644 --- a/pulldown-cmark/specs/container_extensions.txt +++ b/pulldown-cmark/specs/container_extensions.txt @@ -127,7 +127,7 @@ Is this **bold**? ```````````````````````````````` ```````````````````````````````` example_container_extensions -::: example Is this expandable? +::: example Is this collapsable? Is this **bold**? diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 8e7ac8e6..29c99990 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -271,16 +271,12 @@ impl<'a, 'b> FirstPass<'a, 'b> { { let mut kind_start = start_ix + line_start.bytes_scanned(); kind_start += scan_whitespace_no_nl(&bytes[kind_start..]); - let kind_end = scan_while(&bytes[kind_start..], is_ascii_alphanumeric); - // line_end - scan_rev_while(&bytes[summary_start..line_end], is_ascii_whitespace); - // let kind = unescape( &self.text[kind_start..(kind_start + kind_end)], self.tree.is_in_table(), ); - // let mut summary_start = start_ix + line_start.bytes_scanned(); let mut summary_start = kind_start + kind_end; summary_start += scan_whitespace_no_nl(&bytes[summary_start..]); let line_end = summary_start + scan_nextline(&bytes[summary_start..]); @@ -295,13 +291,13 @@ impl<'a, 'b> FirstPass<'a, 'b> { if kind.eq_ignore_ascii_case("spoiler") { self.tree.append(Item { start: container_start, - end: 0, // will get set later + end: 0, body: ItemBody::Container(Spoiler, cow_ix), }); } else if kind.eq_ignore_ascii_case("example") { self.tree.append(Item { start: container_start, - end: 0, // will get set later + end: 0, body: ItemBody::Container(Example, cow_ix), }); } diff --git a/pulldown-cmark/src/html.rs b/pulldown-cmark/src/html.rs index a8f6b828..e269b0c1 100644 --- a/pulldown-cmark/src/html.rs +++ b/pulldown-cmark/src/html.rs @@ -283,13 +283,7 @@ where if !self.end_newline { self.write_newline()?; } - // if summary.is_empty() { self.write("
    ") - // } else { - // self.write("
    ") - // } } Tag::ContainerBlock(Spoiler, summary) => { if !self.end_newline { diff --git a/pulldown-cmark/tests/suite/container_extensions.rs b/pulldown-cmark/tests/suite/container_extensions.rs index 58d4d70a..3d97cb26 100644 --- a/pulldown-cmark/tests/suite/container_extensions.rs +++ b/pulldown-cmark/tests/suite/container_extensions.rs @@ -159,7 +159,7 @@ Is this **bold**? #[test] fn container_extensions_test_8() { - let original = r##"::: example Is this expandable? + let original = r##"::: example Is this collapsable? Is this **bold**? From 72352b22d19966afdbd10be296f84d686b9de5dd Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Thu, 3 Jul 2025 11:10:42 +0100 Subject: [PATCH 139/180] further tidy --- pulldown-cmark/src/scanners.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index 8c5eddb2..5a821387 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -271,11 +271,7 @@ impl<'a> LineStart<'a> { pub(crate) fn scan_container_extensions_fence(&mut self) -> bool { if self.scan_case_insensitive(b":::") { - // if self.scan_case_insensitive(b" spoiler ") { true - // } else { - // false - // } } else { false } @@ -762,9 +758,9 @@ pub(crate) fn scan_code_fence(data: &[u8]) -> Option<(usize, u8)> { } } -/// Scan closing spoiler fence. +/// Scan closing container extension fence. /// -/// Returns number of bytes scanned and the char that is repeated to make the spoiler fence. +/// Returns number of bytes scanned and the char that is repeated to make the container extension fence. pub(crate) fn scan_closing_container_extensions_fence(data: &[u8]) -> Option<(usize, u8)> { let c = *data.first()?; if !(c == b':') { From 4751f42c6aab0463c0d1a22b25a45558e24c2a86 Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Sat, 5 Jul 2025 14:38:43 +0100 Subject: [PATCH 140/180] add default container rendering --- pulldown-cmark/src/firstpass.rs | 9 +++++---- pulldown-cmark/src/html.rs | 8 +++++--- pulldown-cmark/src/lib.rs | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 29c99990..48892d0a 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -286,19 +286,20 @@ impl<'a, 'b> FirstPass<'a, 'b> { &self.text[summary_start..summary_end], self.tree.is_in_table(), ); - let cow_ix = self.allocs.allocate_cow(summary); + let summary_cow_ix = self.allocs.allocate_cow(summary); if kind.eq_ignore_ascii_case("spoiler") { self.tree.append(Item { start: container_start, end: 0, - body: ItemBody::Container(Spoiler, cow_ix), + body: ItemBody::Container(Spoiler, summary_cow_ix), }); - } else if kind.eq_ignore_ascii_case("example") { + } else { + let kind_cow_ix = self.allocs.allocate_cow(kind); self.tree.append(Item { start: container_start, end: 0, - body: ItemBody::Container(Example, cow_ix), + body: ItemBody::Container(Default, kind_cow_ix), }); } self.tree.push(); diff --git a/pulldown-cmark/src/html.rs b/pulldown-cmark/src/html.rs index e269b0c1..9355bb8b 100644 --- a/pulldown-cmark/src/html.rs +++ b/pulldown-cmark/src/html.rs @@ -279,11 +279,13 @@ where CodeBlockKind::Indented => self.write("
    "),
                     }
                 }
    -            Tag::ContainerBlock(Example, _) => {
    +            Tag::ContainerBlock(Default, kind) => {
                     if !self.end_newline {
                         self.write_newline()?;
                     }
    -                self.write("
    ") + self.write("
    ") } Tag::ContainerBlock(Spoiler, summary) => { if !self.end_newline { @@ -458,7 +460,7 @@ where TagEnd::ContainerBlock(Spoiler) => { self.write("\n")?; } - TagEnd::ContainerBlock(Example) => { + TagEnd::ContainerBlock(Default) => { self.write("
    \n")?; } TagEnd::List(true) => { diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index 170d3fa5..390b3f13 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -162,8 +162,8 @@ pub enum BlockQuoteKind { #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub enum ContainerKind { + Default, Spoiler, - Example, } /// Metadata block kind. From 3e11f667e46b99dc5568b99deba1b35a1c376019 Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Thu, 31 Jul 2025 15:35:22 +0100 Subject: [PATCH 141/180] long container fences --- pulldown-cmark/specs/container_extensions.txt | 27 ++++++++++++++ pulldown-cmark/src/firstpass.rs | 19 +++++++--- pulldown-cmark/src/parse.rs | 10 +++--- pulldown-cmark/src/scanners.rs | 11 +++--- .../tests/suite/container_extensions.rs | 35 +++++++++++++++++++ 5 files changed, 87 insertions(+), 15 deletions(-) diff --git a/pulldown-cmark/specs/container_extensions.txt b/pulldown-cmark/specs/container_extensions.txt index 79a75ff2..b7146e14 100644 --- a/pulldown-cmark/specs/container_extensions.txt +++ b/pulldown-cmark/specs/container_extensions.txt @@ -138,3 +138,30 @@ Is this **bold**?

    Is this bold?

    ```````````````````````````````` + +```````````````````````````````` example_container_extensions +:::: example +Is this collapsable? + +Is this **bold**? +:::: +. +
    +

    Is this collapsable?

    +

    Is this bold?

    +
    +```````````````````````````````` + +```````````````````````````````` example_container_extensions +:::::spoiler Is this expandable? +Is this collapsable? + +Is this **bold**? +::::: +. +
    +Is this expandable? +

    Is this collapsable?

    +

    Is this bold?

    +
    +```````````````````````````````` diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 48892d0a..1f6c84ab 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -15,8 +15,7 @@ use crate::{ scanners::*, strings::CowStr, tree::{Tree, TreeIndex}, - ContainerKind::*, - HeadingLevel, MetadataBlockKind, Options, + ContainerKind, HeadingLevel, MetadataBlockKind, Options, }; /// Runs the first pass, which resolves the block structure of the document, @@ -269,7 +268,9 @@ impl<'a, 'b> FirstPass<'a, 'b> { } else if self.options.contains(Options::ENABLE_CONTAINER_EXTENSIONS) && line_start.scan_container_extensions_fence() { - let mut kind_start = start_ix + line_start.bytes_scanned(); + let fence_length = scan_ch_repeat(&bytes[start_ix..], b':'); + + let mut kind_start = start_ix + fence_length; kind_start += scan_whitespace_no_nl(&bytes[kind_start..]); let kind_end = scan_while(&bytes[kind_start..], is_ascii_alphanumeric); let kind = unescape( @@ -292,14 +293,22 @@ impl<'a, 'b> FirstPass<'a, 'b> { self.tree.append(Item { start: container_start, end: 0, - body: ItemBody::Container(Spoiler, summary_cow_ix), + body: ItemBody::Container( + fence_length, + ContainerKind::Spoiler, + summary_cow_ix, + ), }); } else { let kind_cow_ix = self.allocs.allocate_cow(kind); self.tree.append(Item { start: container_start, end: 0, - body: ItemBody::Container(Default, kind_cow_ix), + body: ItemBody::Container( + fence_length, + ContainerKind::Default, + kind_cow_ix, + ), }); } self.tree.push(); diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 05ff9625..35fa53a9 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -114,7 +114,7 @@ pub(crate) enum ItemBody { IndentCodeBlock, HtmlBlock, BlockQuote(Option), - Container(ContainerKind, CowIndex), + Container(usize, ContainerKind, CowIndex), List(bool, u8, u64), // is_tight, list character, list start index ListItem(usize), // indent level FootnoteDefinition(CowIndex), @@ -1471,8 +1471,8 @@ pub(crate) fn scan_containers( let mut i = 0; for &node_ix in tree.walk_spine() { match tree[node_ix].item.body { - ItemBody::Container(..) => { - if line_start.scan_closing_container_extensions_fence() { + ItemBody::Container(length, ..) => { + if line_start.scan_closing_container_extensions_fence(length) { break; } } @@ -2300,7 +2300,7 @@ fn body_to_tag_end(body: &ItemBody) -> TagEnd { ItemBody::Image(..) => TagEnd::Image, ItemBody::Heading(level, _) => TagEnd::Heading(level), ItemBody::IndentCodeBlock | ItemBody::FencedCodeBlock(..) => TagEnd::CodeBlock, - ItemBody::Container(kind, _) => TagEnd::ContainerBlock(kind), + ItemBody::Container(_, kind, _) => TagEnd::ContainerBlock(kind), ItemBody::BlockQuote(kind) => TagEnd::BlockQuote(kind), ItemBody::HtmlBlock => TagEnd::HtmlBlock, ItemBody::List(_, c, _) => { @@ -2381,7 +2381,7 @@ fn item_to_event<'a>(item: Item, text: &'a str, allocs: &mut Allocations<'a>) -> Tag::CodeBlock(CodeBlockKind::Fenced(allocs.take_cow(cow_ix))) } ItemBody::IndentCodeBlock => Tag::CodeBlock(CodeBlockKind::Indented), - ItemBody::Container(kind, cow_ix) => Tag::ContainerBlock(kind, allocs.take_cow(cow_ix)), + ItemBody::Container(_, kind, cow_ix) => Tag::ContainerBlock(kind, allocs.take_cow(cow_ix)), ItemBody::BlockQuote(kind) => Tag::BlockQuote(kind), ItemBody::List(_, c, listitem_start) => { if c == b'.' || c == b')' { diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index 5a821387..2fc001e6 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -277,12 +277,13 @@ impl<'a> LineStart<'a> { } } - pub(crate) fn scan_closing_container_extensions_fence(&mut self) -> bool { - if self.scan_case_insensitive(b":::") { - true - } else { - false + pub(crate) fn scan_closing_container_extensions_fence(&mut self, length: usize) -> bool { + for _ in 0..length { + if !self.scan_ch(b':') { + return false; + } } + true } /// Scan a definition marker. diff --git a/pulldown-cmark/tests/suite/container_extensions.rs b/pulldown-cmark/tests/suite/container_extensions.rs index 3d97cb26..cf8722c3 100644 --- a/pulldown-cmark/tests/suite/container_extensions.rs +++ b/pulldown-cmark/tests/suite/container_extensions.rs @@ -173,3 +173,38 @@ Is this **bold**? test_markdown_html(original, expected, false, false, false, false, false, false, true); } + +#[test] +fn container_extensions_test_9() { + let original = r##":::: example +Is this collapsable? + +Is this **bold**? +:::: +"##; + let expected = r##"
    +

    Is this collapsable?

    +

    Is this bold?

    +
    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, true); +} + +#[test] +fn container_extensions_test_10() { + let original = r##":::::spoiler Is this expandable? +Is this collapsable? + +Is this **bold**? +::::: +"##; + let expected = r##"
    +Is this expandable? +

    Is this collapsable?

    +

    Is this bold?

    +
    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, true); +} From 7e614c8f331b3b59e960adbeb9fcaf46ad6935be Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Fri, 1 Aug 2025 19:21:35 +0100 Subject: [PATCH 142/180] commonmark-hs compatibility --- pulldown-cmark/specs/container_extensions.txt | 42 ++++++++ pulldown-cmark/src/firstpass.rs | 88 ++++++++------- pulldown-cmark/src/scanners.rs | 9 +- .../tests/suite/container_extensions.rs | 100 ++++++++++++++++-- 4 files changed, 180 insertions(+), 59 deletions(-) diff --git a/pulldown-cmark/specs/container_extensions.txt b/pulldown-cmark/specs/container_extensions.txt index b7146e14..e8ab0583 100644 --- a/pulldown-cmark/specs/container_extensions.txt +++ b/pulldown-cmark/specs/container_extensions.txt @@ -165,3 +165,45 @@ Is this **bold**?

    Is this bold?

    ```````````````````````````````` + +```````````````````````````````` example_container_extensions +::: + +content + +::: +. +

    :::

    +

    content

    +

    :::

    +```````````````````````````````` + +```````````````````````````````` example_container_extensions +::: block + +content + +::: end +. +
    +

    content

    +
    + +
    +
    +```````````````````````````````` + +```````````````````````````````` example_container_extensions + ::: block +::: + +::: block + ::: +. +
    + +
    +
    + +
    +```````````````````````````````` diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 1f6c84ab..402be6c4 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -266,53 +266,59 @@ impl<'a, 'b> FirstPass<'a, 'b> { } } } else if self.options.contains(Options::ENABLE_CONTAINER_EXTENSIONS) - && line_start.scan_container_extensions_fence() + && scan_ch_repeat(&bytes[(start_ix + line_start.bytes_scanned())..], b':') > 2 { - let fence_length = scan_ch_repeat(&bytes[start_ix..], b':'); + let fence_length = + //3 + + scan_ch_repeat(&bytes[(start_ix + line_start.bytes_scanned())..], b':'); - let mut kind_start = start_ix + fence_length; + let mut kind_start = start_ix + line_start.bytes_scanned() + fence_length; // - 3; kind_start += scan_whitespace_no_nl(&bytes[kind_start..]); - let kind_end = scan_while(&bytes[kind_start..], is_ascii_alphanumeric); - let kind = unescape( - &self.text[kind_start..(kind_start + kind_end)], - self.tree.is_in_table(), - ); + let kind_length = scan_while(&bytes[kind_start..], is_ascii_alphanumeric); + if kind_length == 0 { + break; + } else { + let kind = unescape( + &self.text[kind_start..(kind_start + kind_length)], + self.tree.is_in_table(), + ); - let mut summary_start = kind_start + kind_end; - summary_start += scan_whitespace_no_nl(&bytes[summary_start..]); - let line_end = summary_start + scan_nextline(&bytes[summary_start..]); - let summary_end = - line_end - scan_rev_while(&bytes[summary_start..line_end], is_ascii_whitespace); - let summary = unescape( - &self.text[summary_start..summary_end], - self.tree.is_in_table(), - ); - let summary_cow_ix = self.allocs.allocate_cow(summary); + let mut summary_start = kind_start + kind_length; + summary_start += scan_whitespace_no_nl(&bytes[summary_start..]); + let line_end = summary_start + scan_nextline(&bytes[summary_start..]); + let summary_end = line_end + - scan_rev_while(&bytes[summary_start..line_end], is_ascii_whitespace); + let summary = unescape( + &self.text[summary_start..summary_end], + self.tree.is_in_table(), + ); + let summary_cow_ix = self.allocs.allocate_cow(summary); - if kind.eq_ignore_ascii_case("spoiler") { - self.tree.append(Item { - start: container_start, - end: 0, - body: ItemBody::Container( - fence_length, - ContainerKind::Spoiler, - summary_cow_ix, - ), - }); - } else { - let kind_cow_ix = self.allocs.allocate_cow(kind); - self.tree.append(Item { - start: container_start, - end: 0, - body: ItemBody::Container( - fence_length, - ContainerKind::Default, - kind_cow_ix, - ), - }); + if kind.eq_ignore_ascii_case("spoiler") { + self.tree.append(Item { + start: container_start, + end: 0, + body: ItemBody::Container( + fence_length, + ContainerKind::Spoiler, + summary_cow_ix, + ), + }); + } else { + let kind_cow_ix = self.allocs.allocate_cow(kind); + self.tree.append(Item { + start: container_start, + end: 0, + body: ItemBody::Container( + fence_length, + ContainerKind::Default, + kind_cow_ix, + ), + }); + } + self.tree.push(); + return summary_end + 1; } - self.tree.push(); - return summary_end + 1; } else { line_start = save; break; diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index 2fc001e6..2fa8e229 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -269,15 +269,8 @@ impl<'a> LineStart<'a> { } } - pub(crate) fn scan_container_extensions_fence(&mut self) -> bool { - if self.scan_case_insensitive(b":::") { - true - } else { - false - } - } - pub(crate) fn scan_closing_container_extensions_fence(&mut self, length: usize) -> bool { + self.scan_all_space(); for _ in 0..length { if !self.scan_ch(b':') { return false; diff --git a/pulldown-cmark/tests/suite/container_extensions.rs b/pulldown-cmark/tests/suite/container_extensions.rs index cf8722c3..d172da2d 100644 --- a/pulldown-cmark/tests/suite/container_extensions.rs +++ b/pulldown-cmark/tests/suite/container_extensions.rs @@ -20,7 +20,9 @@ Is this bold?

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false, true); + test_markdown_html( + original, expected, false, false, false, false, false, false, true, + ); } #[test] @@ -41,7 +43,9 @@ Is this bold?

    is this seperate and bold

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false, true); + test_markdown_html( + original, expected, false, false, false, false, false, false, true, + ); } #[test] @@ -68,7 +72,9 @@ Is this bold?

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false, true); + test_markdown_html( + original, expected, false, false, false, false, false, false, true, + ); } #[test] @@ -101,7 +107,9 @@ Is this bold?

    is this seperate and bold

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false, true); + test_markdown_html( + original, expected, false, false, false, false, false, false, true, + ); } #[test] @@ -118,7 +126,9 @@ Is this collapsable?

    is this seperate and bold

    "##; - test_markdown_html(original, expected, false, false, false, false, false, false, true); + test_markdown_html( + original, expected, false, false, false, false, false, false, true, + ); } #[test] @@ -136,7 +146,9 @@ Is this **bold**? "##; - test_markdown_html(original, expected, false, false, false, false, false, false, true); + test_markdown_html( + original, expected, false, false, false, false, false, false, true, + ); } #[test] @@ -154,7 +166,9 @@ Is this **bold**? "##; - test_markdown_html(original, expected, false, false, false, false, false, false, true); + test_markdown_html( + original, expected, false, false, false, false, false, false, true, + ); } #[test] @@ -171,7 +185,9 @@ Is this **bold**?
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false, true); + test_markdown_html( + original, expected, false, false, false, false, false, false, true, + ); } #[test] @@ -188,7 +204,9 @@ Is this **bold**?
    "##; - test_markdown_html(original, expected, false, false, false, false, false, false, true); + test_markdown_html( + original, expected, false, false, false, false, false, false, true, + ); } #[test] @@ -206,5 +224,67 @@ Is this **bold**? "##; - test_markdown_html(original, expected, false, false, false, false, false, false, true); + test_markdown_html( + original, expected, false, false, false, false, false, false, true, + ); +} + +#[test] +fn container_extensions_test_11() { + let original = r##"::: + +content + +::: +"##; + let expected = r##"

    :::

    +

    content

    +

    :::

    +"##; + + test_markdown_html( + original, expected, false, false, false, false, false, false, true, + ); +} + +#[test] +fn container_extensions_test_12() { + let original = r##"::: block + +content + +::: end +"##; + let expected = r##"
    +

    content

    +
    + +
    +
    +"##; + + test_markdown_html( + original, expected, false, false, false, false, false, false, true, + ); +} + +#[test] +fn container_extensions_test_13() { + let original = r##" ::: block +::: + +::: block + ::: +"##; + let expected = r##"
    + +
    +
    + +
    +"##; + + test_markdown_html( + original, expected, false, false, false, false, false, false, true, + ); } From 7439f9ffb82265c4e4519b4a5aa2cb6699ac6d5e Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Fri, 1 Aug 2025 19:33:06 +0100 Subject: [PATCH 143/180] fix tests --- pulldown-cmark/specs/container_extensions.txt | 14 +--- .../tests/suite/container_extensions.rs | 66 +++++-------------- 2 files changed, 17 insertions(+), 63 deletions(-) diff --git a/pulldown-cmark/specs/container_extensions.txt b/pulldown-cmark/specs/container_extensions.txt index e8ab0583..d2c2bb42 100644 --- a/pulldown-cmark/specs/container_extensions.txt +++ b/pulldown-cmark/specs/container_extensions.txt @@ -185,12 +185,7 @@ content ::: end . -
    -

    content

    -
    - -
    -
    +

    content

    end

    ```````````````````````````````` ```````````````````````````````` example_container_extensions @@ -200,10 +195,5 @@ content ::: block ::: . -
    - -
    -
    - -
    +
    ```````````````````````````````` diff --git a/pulldown-cmark/tests/suite/container_extensions.rs b/pulldown-cmark/tests/suite/container_extensions.rs index d172da2d..daeb4816 100644 --- a/pulldown-cmark/tests/suite/container_extensions.rs +++ b/pulldown-cmark/tests/suite/container_extensions.rs @@ -20,9 +20,7 @@ Is this bold?

    "##; - test_markdown_html( - original, expected, false, false, false, false, false, false, true, - ); + test_markdown_html(original, expected, false, false, false, false, false, false, true); } #[test] @@ -43,9 +41,7 @@ Is this bold?

    is this seperate and bold

    "##; - test_markdown_html( - original, expected, false, false, false, false, false, false, true, - ); + test_markdown_html(original, expected, false, false, false, false, false, false, true); } #[test] @@ -72,9 +68,7 @@ Is this bold?

    "##; - test_markdown_html( - original, expected, false, false, false, false, false, false, true, - ); + test_markdown_html(original, expected, false, false, false, false, false, false, true); } #[test] @@ -107,9 +101,7 @@ Is this bold?

    is this seperate and bold

    "##; - test_markdown_html( - original, expected, false, false, false, false, false, false, true, - ); + test_markdown_html(original, expected, false, false, false, false, false, false, true); } #[test] @@ -126,9 +118,7 @@ Is this collapsable?

    is this seperate and bold

    "##; - test_markdown_html( - original, expected, false, false, false, false, false, false, true, - ); + test_markdown_html(original, expected, false, false, false, false, false, false, true); } #[test] @@ -146,9 +136,7 @@ Is this **bold**? "##; - test_markdown_html( - original, expected, false, false, false, false, false, false, true, - ); + test_markdown_html(original, expected, false, false, false, false, false, false, true); } #[test] @@ -166,9 +154,7 @@ Is this **bold**? "##; - test_markdown_html( - original, expected, false, false, false, false, false, false, true, - ); + test_markdown_html(original, expected, false, false, false, false, false, false, true); } #[test] @@ -185,9 +171,7 @@ Is this **bold**? "##; - test_markdown_html( - original, expected, false, false, false, false, false, false, true, - ); + test_markdown_html(original, expected, false, false, false, false, false, false, true); } #[test] @@ -204,9 +188,7 @@ Is this **bold**? "##; - test_markdown_html( - original, expected, false, false, false, false, false, false, true, - ); + test_markdown_html(original, expected, false, false, false, false, false, false, true); } #[test] @@ -224,9 +206,7 @@ Is this **bold**? "##; - test_markdown_html( - original, expected, false, false, false, false, false, false, true, - ); + test_markdown_html(original, expected, false, false, false, false, false, false, true); } #[test] @@ -242,9 +222,7 @@ content

    :::

    "##; - test_markdown_html( - original, expected, false, false, false, false, false, false, true, - ); + test_markdown_html(original, expected, false, false, false, false, false, false, true); } #[test] @@ -255,17 +233,10 @@ content ::: end "##; - let expected = r##"
    -

    content

    -
    - -
    -
    + let expected = r##"

    content

    end

    "##; - test_markdown_html( - original, expected, false, false, false, false, false, false, true, - ); + test_markdown_html(original, expected, false, false, false, false, false, false, true); } #[test] @@ -276,15 +247,8 @@ fn container_extensions_test_13() { ::: block ::: "##; - let expected = r##"
    - -
    -
    - -
    + let expected = r##"
    "##; - test_markdown_html( - original, expected, false, false, false, false, false, false, true, - ); + test_markdown_html(original, expected, false, false, false, false, false, false, true); } From d5a7b0c051a7207fcf1594b345b0d628723a7a0f Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Fri, 1 Aug 2025 19:40:19 +0100 Subject: [PATCH 144/180] fix node_size body_size --- pulldown-cmark/src/parse.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 35fa53a9..501ddf48 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -2438,14 +2438,14 @@ mod test { #[cfg(target_pointer_width = "64")] fn node_size() { let node_size = core::mem::size_of::>(); - assert_eq!(48, node_size); + assert_eq!(56, node_size); } #[test] #[cfg(target_pointer_width = "64")] fn body_size() { let body_size = core::mem::size_of::(); - assert_eq!(16, body_size); + assert_eq!(24, body_size); } #[test] From 18e4ae1c84ffa3121518e63a0cc7e1f666110f04 Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Thu, 7 Aug 2025 14:30:58 +0100 Subject: [PATCH 145/180] commonmark-hs bug fixes --- pulldown-cmark/specs/container_extensions.txt | 67 +++++++++++++- pulldown-cmark/src/firstpass.rs | 6 +- pulldown-cmark/src/parse.rs | 90 +++++++++++-------- pulldown-cmark/src/scanners.rs | 51 +++++------ .../tests/suite/container_extensions.rs | 87 +++++++++++++++++- 5 files changed, 233 insertions(+), 68 deletions(-) diff --git a/pulldown-cmark/specs/container_extensions.txt b/pulldown-cmark/specs/container_extensions.txt index d2c2bb42..98fb9610 100644 --- a/pulldown-cmark/specs/container_extensions.txt +++ b/pulldown-cmark/specs/container_extensions.txt @@ -185,7 +185,11 @@ content ::: end . -

    content

    end

    +
    +

    content

    +
    +
    +
    ```````````````````````````````` ```````````````````````````````` example_container_extensions @@ -195,5 +199,64 @@ content ::: block ::: . -
    +
    +
    +
    +
    +```````````````````````````````` + +```````````````````````````````` example_container_extensions +::: a +::: b + +::: +::: +. +
    +
    +
    +
    +```````````````````````````````` + +```````````````````````````````` example_container_extensions +::: +Hi +::: +. +

    ::: +Hi +:::

    +```````````````````````````````` + +```````````````````````````````` example_container_extensions +::::: foo +Hi +::: +:::::: +. +
    +

    Hi +:::

    +
    +```````````````````````````````` + +```````````````````````````````` example_container_extensions +> ::: foo +> Hi +. +
    +
    +

    Hi

    +
    +
    +```````````````````````````````` + +```````````````````````````````` example_container_extensions +::: c_d +Hi +::: +. +
    +

    Hi

    +
    ```````````````````````````````` diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 402be6c4..521d1a16 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -274,7 +274,9 @@ impl<'a, 'b> FirstPass<'a, 'b> { let mut kind_start = start_ix + line_start.bytes_scanned() + fence_length; // - 3; kind_start += scan_whitespace_no_nl(&bytes[kind_start..]); - let kind_length = scan_while(&bytes[kind_start..], is_ascii_alphanumeric); + let kind_length = scan_while(&bytes[kind_start..], |c| { + is_ascii_alphanumeric(c) || c == b'_' || c == b'-' || c == b':' || c == b'.' + }); if kind_length == 0 { break; } else { @@ -2187,7 +2189,7 @@ fn scan_paragraph_interrupt_no_table( || scan_hrule(bytes).is_ok() || scan_atx_heading(bytes).is_some() || scan_code_fence(bytes).is_some() - || scan_closing_container_extensions_fence(bytes).is_some() + || scan_interrupting_container_extensions_fence(bytes) || scan_blockquote_start(bytes).is_some() || scan_listitem(bytes).map_or(false, |(ix, delim, index, _)| { ! current_container || diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 501ddf48..977aa099 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -1468,49 +1468,69 @@ pub(crate) fn scan_containers( line_start: &mut LineStart<'_>, options: Options, ) -> usize { - let mut i = 0; - for &node_ix in tree.walk_spine() { - match tree[node_ix].item.body { - ItemBody::Container(length, ..) => { - if line_start.scan_closing_container_extensions_fence(length) { - break; - } - } - ItemBody::BlockQuote(..) => { - let save = line_start.clone(); - let _ = line_start.scan_space(3); - if !line_start.scan_blockquote_marker() { - *line_start = save; - break; - } - } - ItemBody::ListItem(indent) => { - let save = line_start.clone(); - if !line_start.scan_space(indent) && !line_start.is_at_eol() { - *line_start = save; - break; + if tree.spine_len() > 0 { + let mut i = tree.spine_len(); + for &node_ix in tree.walk_spine().rev() { + match tree[node_ix].item.body { + ItemBody::Container(length, ..) => { + if line_start.scan_closing_container_extensions_fence(length) { + break; + } } + _ => (), } - ItemBody::DefinitionListDefinition(indent) => { - let save = line_start.clone(); - if !line_start.scan_space(indent) && !line_start.is_at_eol() { - *line_start = save; - break; + i = i - 1; + } + if i > 0 { + i - 1 + } else { + let mut i = 0; + for &node_ix in tree.walk_spine() { + match tree[node_ix].item.body { + ItemBody::BlockQuote(..) => { + let save = line_start.clone(); + let _ = line_start.scan_space(3); + if !line_start.scan_blockquote_marker() { + *line_start = save; + break; + } + } + ItemBody::ListItem(indent) => { + let save = line_start.clone(); + if !line_start.scan_space(indent) && !line_start.is_at_eol() { + *line_start = save; + break; + } + } + ItemBody::DefinitionListDefinition(indent) => { + let save = line_start.clone(); + if !line_start.scan_space(indent) && !line_start.is_at_eol() { + *line_start = save; + break; + } + } + ItemBody::FootnoteDefinition(..) if options.has_gfm_footnotes() => { + let save = line_start.clone(); + if !line_start.scan_space(4) && !line_start.is_at_eol() { + *line_start = save; + break; + } + } + _ => (), } + i = i + 1; } - ItemBody::FootnoteDefinition(..) if options.has_gfm_footnotes() => { - let save = line_start.clone(); - if !line_start.scan_space(4) && !line_start.is_at_eol() { - *line_start = save; - break; - } + if i < tree.spine_len() { + i + } else { + tree.spine_len() } - _ => (), } - i += 1; + } else { + 0 } - i } + pub(crate) fn skip_container_prefixes(tree: &Tree, bytes: &[u8], options: Options) -> usize { let mut line_start = LineStart::new(bytes); let _ = scan_containers(tree, &mut line_start, options); diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index 2fa8e229..39b9be61 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -270,13 +270,19 @@ impl<'a> LineStart<'a> { } pub(crate) fn scan_closing_container_extensions_fence(&mut self, length: usize) -> bool { - self.scan_all_space(); - for _ in 0..length { - if !self.scan_ch(b':') { - return false; - } + let nl_ix = scan_nextline(&self.bytes[self.ix..]); + let eol_length = scan_rev_while(&self.bytes[self.ix..nl_ix], |c| { + c == b'\n' || c == b'\r' || c == b' ' + }); + let fence_length = + scan_rev_while(&self.bytes[self.ix..(nl_ix - eol_length)], |c| c == b':'); + + if fence_length >= length { + self.ix = self.ix + (nl_ix - eol_length); + true + } else { + false } - true } /// Scan a definition marker. @@ -517,7 +523,9 @@ pub(crate) fn scan_blank_line(bytes: &[u8]) -> Option { } pub(crate) fn scan_nextline(bytes: &[u8]) -> usize { - memchr(b'\n', bytes).map_or(bytes.len(), |x| x + 1) + memchr(b'\n', bytes).map_or(memchr(b'\r', bytes).map_or(bytes.len(), |x| x + 1), |x| { + x + 1 + }) } // return: end byte for closing code fence, or None @@ -752,27 +760,16 @@ pub(crate) fn scan_code_fence(data: &[u8]) -> Option<(usize, u8)> { } } -/// Scan closing container extension fence. -/// -/// Returns number of bytes scanned and the char that is repeated to make the container extension fence. -pub(crate) fn scan_closing_container_extensions_fence(data: &[u8]) -> Option<(usize, u8)> { - let c = *data.first()?; - if !(c == b':') { - return None; - } - let i = 1 + scan_ch_repeat(&data[1..], c); - if i >= 3 { - if c == b':' { - let suffix = &data[i..]; - let next_line = i + scan_nextline(suffix); - // FIXME: make sure this is correct - if suffix[..(next_line - i)].iter().any(|&b| b == b':') { - return None; - } - } - Some((i, c)) +pub(crate) fn scan_interrupting_container_extensions_fence(data: &[u8]) -> bool { + let fence_length = scan_ch_repeat(data, b':'); + let kind_start = fence_length + scan_whitespace_no_nl(&data[fence_length..]); + let kind_length = scan_while(&data[kind_start..], |c| { + is_ascii_alphanumeric(c) || c == b'_' || c == b'-' || c == b':' || c == b'.' + }); + if fence_length > 2 && kind_length > 0 { + true } else { - None + false } } diff --git a/pulldown-cmark/tests/suite/container_extensions.rs b/pulldown-cmark/tests/suite/container_extensions.rs index daeb4816..a76428b2 100644 --- a/pulldown-cmark/tests/suite/container_extensions.rs +++ b/pulldown-cmark/tests/suite/container_extensions.rs @@ -233,7 +233,11 @@ content ::: end "##; - let expected = r##"

    content

    end

    + let expected = r##"
    +

    content

    +
    +
    +
    "##; test_markdown_html(original, expected, false, false, false, false, false, false, true); @@ -247,7 +251,86 @@ fn container_extensions_test_13() { ::: block ::: "##; - let expected = r##"
    + let expected = r##"
    +
    +
    +
    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, true); +} + +#[test] +fn container_extensions_test_14() { + let original = r##"::: a +::: b + +::: +::: +"##; + let expected = r##"
    +
    +
    +
    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, true); +} + +#[test] +fn container_extensions_test_15() { + let original = r##"::: +Hi +::: +"##; + let expected = r##"

    ::: +Hi +:::

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, true); +} + +#[test] +fn container_extensions_test_16() { + let original = r##"::::: foo +Hi +::: +:::::: +"##; + let expected = r##"
    +

    Hi +:::

    +
    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, true); +} + +#[test] +fn container_extensions_test_17() { + let original = r##"> ::: foo +> Hi +"##; + let expected = r##"
    +
    +

    Hi

    +
    +
    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, true); +} + +#[test] +fn container_extensions_test_18() { + let original = r##"::: c_d +Hi +::: +"##; + let expected = r##"
    +

    Hi

    +
    "##; test_markdown_html(original, expected, false, false, false, false, false, false, true); From 9af5e84ab5e17e7d58418cd2514578a1ee0a7aef Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Thu, 7 Aug 2025 14:46:56 +0100 Subject: [PATCH 146/180] tidy --- pulldown-cmark/src/firstpass.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 521d1a16..ffe32d45 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -269,10 +269,9 @@ impl<'a, 'b> FirstPass<'a, 'b> { && scan_ch_repeat(&bytes[(start_ix + line_start.bytes_scanned())..], b':') > 2 { let fence_length = - //3 + scan_ch_repeat(&bytes[(start_ix + line_start.bytes_scanned())..], b':'); - let mut kind_start = start_ix + line_start.bytes_scanned() + fence_length; // - 3; + let mut kind_start = start_ix + line_start.bytes_scanned() + fence_length; kind_start += scan_whitespace_no_nl(&bytes[kind_start..]); let kind_length = scan_while(&bytes[kind_start..], |c| { is_ascii_alphanumeric(c) || c == b'_' || c == b'-' || c == b':' || c == b'.' From 674ae5f0662ec9819156b0db19b9df30d4591611 Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Thu, 7 Aug 2025 14:55:45 +0100 Subject: [PATCH 147/180] couple more tests --- pulldown-cmark/specs/container_extensions.txt | 26 ++++++++++++ .../tests/suite/container_extensions.rs | 40 +++++++++++++++++-- 2 files changed, 63 insertions(+), 3 deletions(-) diff --git a/pulldown-cmark/specs/container_extensions.txt b/pulldown-cmark/specs/container_extensions.txt index 98fb9610..461623e6 100644 --- a/pulldown-cmark/specs/container_extensions.txt +++ b/pulldown-cmark/specs/container_extensions.txt @@ -218,6 +218,32 @@ content ```````````````````````````````` +```````````````````````````````` example_container_extensions +:::: a +::: b + +::: +:::: +. +
    +
    +
    +
    +```````````````````````````````` + +```````````````````````````````` example_container_extensions +::: a +:::: b + +:::: +::: +. +
    +
    +
    +
    +```````````````````````````````` + ```````````````````````````````` example_container_extensions ::: Hi diff --git a/pulldown-cmark/tests/suite/container_extensions.rs b/pulldown-cmark/tests/suite/container_extensions.rs index a76428b2..c26b0d5c 100644 --- a/pulldown-cmark/tests/suite/container_extensions.rs +++ b/pulldown-cmark/tests/suite/container_extensions.rs @@ -279,6 +279,40 @@ fn container_extensions_test_14() { #[test] fn container_extensions_test_15() { + let original = r##":::: a +::: b + +::: +:::: +"##; + let expected = r##"
    +
    +
    +
    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, true); +} + +#[test] +fn container_extensions_test_16() { + let original = r##"::: a +:::: b + +:::: +::: +"##; + let expected = r##"
    +
    +
    +
    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, true); +} + +#[test] +fn container_extensions_test_17() { let original = r##"::: Hi ::: @@ -292,7 +326,7 @@ Hi } #[test] -fn container_extensions_test_16() { +fn container_extensions_test_18() { let original = r##"::::: foo Hi ::: @@ -308,7 +342,7 @@ Hi } #[test] -fn container_extensions_test_17() { +fn container_extensions_test_19() { let original = r##"> ::: foo > Hi "##; @@ -323,7 +357,7 @@ fn container_extensions_test_17() { } #[test] -fn container_extensions_test_18() { +fn container_extensions_test_20() { let original = r##"::: c_d Hi ::: From 57d309571380b32d91a545b2b8db01fb255b363e Mon Sep 17 00:00:00 2001 From: rhysd Date: Sun, 10 Aug 2025 22:41:33 +0900 Subject: [PATCH 148/180] Move benchmark assets to `bench/third_party/` to reduce the number of licenses in the pulldown-cmark package so that users can reduce their audit cost. --- bench/benches/html_rendering.rs | 2 +- bench/benches/markdown-it.rs | 2 +- {pulldown-cmark => bench}/third_party/markdown-it/LICENSE | 0 {pulldown-cmark => bench}/third_party/markdown-it/README.md | 0 .../third_party/markdown-it/block-bq-flat.md | 0 .../third_party/markdown-it/block-bq-nested.md | 0 {pulldown-cmark => bench}/third_party/markdown-it/block-code.md | 0 .../third_party/markdown-it/block-fences.md | 0 .../third_party/markdown-it/block-heading.md | 0 {pulldown-cmark => bench}/third_party/markdown-it/block-hr.md | 0 {pulldown-cmark => bench}/third_party/markdown-it/block-html.md | 0 .../third_party/markdown-it/block-lheading.md | 0 .../third_party/markdown-it/block-list-flat.md | 0 .../third_party/markdown-it/block-list-nested.md | 0 .../third_party/markdown-it/block-ref-flat.md | 0 .../third_party/markdown-it/block-ref-nested.md | 0 .../third_party/markdown-it/inline-autolink.md | 0 .../third_party/markdown-it/inline-backticks.md | 0 .../third_party/markdown-it/inline-em-flat.md | 0 .../third_party/markdown-it/inline-em-nested.md | 0 .../third_party/markdown-it/inline-em-worst.md | 0 .../third_party/markdown-it/inline-entity.md | 0 .../third_party/markdown-it/inline-escape.md | 0 .../third_party/markdown-it/inline-html.md | 0 .../third_party/markdown-it/inline-links-flat.md | 0 .../third_party/markdown-it/inline-links-nested.md | 0 .../third_party/markdown-it/inline-newlines.md | 0 {pulldown-cmark => bench}/third_party/markdown-it/lorem1.md | 0 {pulldown-cmark => bench}/third_party/markdown-it/rawtabs.md | 0 {pulldown-cmark => bench}/third_party/xi-editor/LICENSE | 0 {pulldown-cmark => bench}/third_party/xi-editor/crdt.md | 0 31 files changed, 2 insertions(+), 2 deletions(-) rename {pulldown-cmark => bench}/third_party/markdown-it/LICENSE (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/README.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/block-bq-flat.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/block-bq-nested.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/block-code.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/block-fences.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/block-heading.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/block-hr.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/block-html.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/block-lheading.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/block-list-flat.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/block-list-nested.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/block-ref-flat.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/block-ref-nested.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/inline-autolink.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/inline-backticks.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/inline-em-flat.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/inline-em-nested.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/inline-em-worst.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/inline-entity.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/inline-escape.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/inline-html.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/inline-links-flat.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/inline-links-nested.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/inline-newlines.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/lorem1.md (100%) rename {pulldown-cmark => bench}/third_party/markdown-it/rawtabs.md (100%) rename {pulldown-cmark => bench}/third_party/xi-editor/LICENSE (100%) rename {pulldown-cmark => bench}/third_party/xi-editor/crdt.md (100%) diff --git a/bench/benches/html_rendering.rs b/bench/benches/html_rendering.rs index 5f047050..788866eb 100644 --- a/bench/benches/html_rendering.rs +++ b/bench/benches/html_rendering.rs @@ -2,7 +2,7 @@ use criterion::{criterion_group, criterion_main, Criterion}; use pulldown_cmark::{html, Options, Parser}; use std::str::from_utf8; -static CRDT_BYTES: &[u8] = include_bytes!("../../pulldown-cmark/third_party/xi-editor/crdt.md"); +static CRDT_BYTES: &[u8] = include_bytes!("../third_party/xi-editor/crdt.md"); fn criterion_benchmark(c: &mut Criterion) { let mut full_opts = Options::empty(); diff --git a/bench/benches/markdown-it.rs b/bench/benches/markdown-it.rs index 4599af8e..69cbc2a7 100644 --- a/bench/benches/markdown-it.rs +++ b/bench/benches/markdown-it.rs @@ -3,7 +3,7 @@ use pulldown_cmark::{html, Parser}; use std::fs::{read_dir, read_to_string}; pub fn markdown_it_samples(c: &mut Criterion) { - let folder = read_dir("../pulldown-cmark/third_party/markdown-it").unwrap(); + let folder = read_dir("./third_party/markdown-it").unwrap(); for entry in folder { let entry = entry.unwrap(); diff --git a/pulldown-cmark/third_party/markdown-it/LICENSE b/bench/third_party/markdown-it/LICENSE similarity index 100% rename from pulldown-cmark/third_party/markdown-it/LICENSE rename to bench/third_party/markdown-it/LICENSE diff --git a/pulldown-cmark/third_party/markdown-it/README.md b/bench/third_party/markdown-it/README.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/README.md rename to bench/third_party/markdown-it/README.md diff --git a/pulldown-cmark/third_party/markdown-it/block-bq-flat.md b/bench/third_party/markdown-it/block-bq-flat.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/block-bq-flat.md rename to bench/third_party/markdown-it/block-bq-flat.md diff --git a/pulldown-cmark/third_party/markdown-it/block-bq-nested.md b/bench/third_party/markdown-it/block-bq-nested.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/block-bq-nested.md rename to bench/third_party/markdown-it/block-bq-nested.md diff --git a/pulldown-cmark/third_party/markdown-it/block-code.md b/bench/third_party/markdown-it/block-code.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/block-code.md rename to bench/third_party/markdown-it/block-code.md diff --git a/pulldown-cmark/third_party/markdown-it/block-fences.md b/bench/third_party/markdown-it/block-fences.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/block-fences.md rename to bench/third_party/markdown-it/block-fences.md diff --git a/pulldown-cmark/third_party/markdown-it/block-heading.md b/bench/third_party/markdown-it/block-heading.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/block-heading.md rename to bench/third_party/markdown-it/block-heading.md diff --git a/pulldown-cmark/third_party/markdown-it/block-hr.md b/bench/third_party/markdown-it/block-hr.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/block-hr.md rename to bench/third_party/markdown-it/block-hr.md diff --git a/pulldown-cmark/third_party/markdown-it/block-html.md b/bench/third_party/markdown-it/block-html.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/block-html.md rename to bench/third_party/markdown-it/block-html.md diff --git a/pulldown-cmark/third_party/markdown-it/block-lheading.md b/bench/third_party/markdown-it/block-lheading.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/block-lheading.md rename to bench/third_party/markdown-it/block-lheading.md diff --git a/pulldown-cmark/third_party/markdown-it/block-list-flat.md b/bench/third_party/markdown-it/block-list-flat.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/block-list-flat.md rename to bench/third_party/markdown-it/block-list-flat.md diff --git a/pulldown-cmark/third_party/markdown-it/block-list-nested.md b/bench/third_party/markdown-it/block-list-nested.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/block-list-nested.md rename to bench/third_party/markdown-it/block-list-nested.md diff --git a/pulldown-cmark/third_party/markdown-it/block-ref-flat.md b/bench/third_party/markdown-it/block-ref-flat.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/block-ref-flat.md rename to bench/third_party/markdown-it/block-ref-flat.md diff --git a/pulldown-cmark/third_party/markdown-it/block-ref-nested.md b/bench/third_party/markdown-it/block-ref-nested.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/block-ref-nested.md rename to bench/third_party/markdown-it/block-ref-nested.md diff --git a/pulldown-cmark/third_party/markdown-it/inline-autolink.md b/bench/third_party/markdown-it/inline-autolink.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/inline-autolink.md rename to bench/third_party/markdown-it/inline-autolink.md diff --git a/pulldown-cmark/third_party/markdown-it/inline-backticks.md b/bench/third_party/markdown-it/inline-backticks.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/inline-backticks.md rename to bench/third_party/markdown-it/inline-backticks.md diff --git a/pulldown-cmark/third_party/markdown-it/inline-em-flat.md b/bench/third_party/markdown-it/inline-em-flat.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/inline-em-flat.md rename to bench/third_party/markdown-it/inline-em-flat.md diff --git a/pulldown-cmark/third_party/markdown-it/inline-em-nested.md b/bench/third_party/markdown-it/inline-em-nested.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/inline-em-nested.md rename to bench/third_party/markdown-it/inline-em-nested.md diff --git a/pulldown-cmark/third_party/markdown-it/inline-em-worst.md b/bench/third_party/markdown-it/inline-em-worst.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/inline-em-worst.md rename to bench/third_party/markdown-it/inline-em-worst.md diff --git a/pulldown-cmark/third_party/markdown-it/inline-entity.md b/bench/third_party/markdown-it/inline-entity.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/inline-entity.md rename to bench/third_party/markdown-it/inline-entity.md diff --git a/pulldown-cmark/third_party/markdown-it/inline-escape.md b/bench/third_party/markdown-it/inline-escape.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/inline-escape.md rename to bench/third_party/markdown-it/inline-escape.md diff --git a/pulldown-cmark/third_party/markdown-it/inline-html.md b/bench/third_party/markdown-it/inline-html.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/inline-html.md rename to bench/third_party/markdown-it/inline-html.md diff --git a/pulldown-cmark/third_party/markdown-it/inline-links-flat.md b/bench/third_party/markdown-it/inline-links-flat.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/inline-links-flat.md rename to bench/third_party/markdown-it/inline-links-flat.md diff --git a/pulldown-cmark/third_party/markdown-it/inline-links-nested.md b/bench/third_party/markdown-it/inline-links-nested.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/inline-links-nested.md rename to bench/third_party/markdown-it/inline-links-nested.md diff --git a/pulldown-cmark/third_party/markdown-it/inline-newlines.md b/bench/third_party/markdown-it/inline-newlines.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/inline-newlines.md rename to bench/third_party/markdown-it/inline-newlines.md diff --git a/pulldown-cmark/third_party/markdown-it/lorem1.md b/bench/third_party/markdown-it/lorem1.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/lorem1.md rename to bench/third_party/markdown-it/lorem1.md diff --git a/pulldown-cmark/third_party/markdown-it/rawtabs.md b/bench/third_party/markdown-it/rawtabs.md similarity index 100% rename from pulldown-cmark/third_party/markdown-it/rawtabs.md rename to bench/third_party/markdown-it/rawtabs.md diff --git a/pulldown-cmark/third_party/xi-editor/LICENSE b/bench/third_party/xi-editor/LICENSE similarity index 100% rename from pulldown-cmark/third_party/xi-editor/LICENSE rename to bench/third_party/xi-editor/LICENSE diff --git a/pulldown-cmark/third_party/xi-editor/crdt.md b/bench/third_party/xi-editor/crdt.md similarity index 100% rename from pulldown-cmark/third_party/xi-editor/crdt.md rename to bench/third_party/xi-editor/crdt.md From fdcc28c7b6b961fa59535d45b3e42cbdb9bd8c4d Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Sat, 12 Jul 2025 21:35:11 +0300 Subject: [PATCH 149/180] Rename BrokenLinkCallback -> ParserCallbacks --- pulldown-cmark/src/lib.rs | 4 +- pulldown-cmark/src/parse.rs | 87 ++++++++++++++++--------------------- 2 files changed, 38 insertions(+), 53 deletions(-) diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index 558ad5d3..c8cd0367 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -113,9 +113,7 @@ mod tree; use core::fmt::Display; pub use crate::{ - parse::{ - BrokenLink, BrokenLinkCallback, DefaultBrokenLinkCallback, OffsetIter, Parser, RefDefs, - }, + parse::{BrokenLink, DefaultParserCallbacks, OffsetIter, Parser, ParserCallbacks, RefDefs}, strings::{CowStr, InlineStr}, utils::*, }; diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 0de8c7c9..7eed0ff1 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -190,8 +190,8 @@ pub struct BrokenLink<'a> { } /// Markdown event iterator. -pub struct Parser<'input, F = DefaultBrokenLinkCallback> { - broken_link_callback: Option, +pub struct Parser<'input, CB = DefaultParserCallbacks> { + callbacks: Option, inner: ParserInner<'input>, } @@ -230,16 +230,13 @@ struct ParserInner<'input> { math_delims: MathDelims, } -impl<'input, F> core::fmt::Debug for Parser<'input, F> { +impl<'input, CB> core::fmt::Debug for Parser<'input, CB> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { // Only print the fields that have public types. f.debug_struct("Parser") .field("text", &self.inner.text) .field("options", &self.inner.options) - .field( - "broken_link_callback", - &self.broken_link_callback.as_ref().map(|_| ..), - ) + .field("callbacks", &self.callbacks.as_ref().map(|_| ..)) .finish() } } @@ -257,7 +254,7 @@ impl<'a> BrokenLink<'a> { } } -impl<'input> Parser<'input, DefaultBrokenLinkCallback> { +impl<'input> Parser<'input, DefaultParserCallbacks> { /// Creates a new event iterator for a markdown string without any options enabled. pub fn new(text: &'input str) -> Self { Self::new_ext(text, Options::empty()) @@ -269,7 +266,7 @@ impl<'input> Parser<'input, DefaultBrokenLinkCallback> { } } -impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { +impl<'input, F: ParserCallbacks<'input>> Parser<'input, F> { /// In case the parser encounters any potential links that have a broken /// reference (e.g `[foo]` when there is no `[foo]: ` entry at the bottom) /// the provided callback will be called with the reference name, @@ -287,7 +284,7 @@ impl<'input, F: BrokenLinkCallback<'input>> Parser<'input, F> { let wikilink_stack = Default::default(); let html_scan_guard = Default::default(); Parser { - broken_link_callback, + callbacks: broken_link_callback, inner: ParserInner { text, @@ -329,7 +326,7 @@ impl<'input> ParserInner<'input> { /// /// The URL and title are found in the [`RefDefs`] map. /// If they're not there, and a callback was provided by the user, - /// the [`broken_link_callback`] will be invoked and given the opportunity + /// `handle_broken_link` will be invoked and given the opportunity /// to provide a fallback. /// /// The link type (that's "link" or "image") depends on the usage site, and @@ -339,13 +336,12 @@ impl<'input> ParserInner<'input> { /// /// [mapped to an unknown type]: crate::LinkType::to_unknown /// [`link_ref_expansion_limit`]: Self::link_ref_expansion_limit - /// [`broken_link_callback`]: Self::broken_link_callback fn fetch_link_type_url_title( &mut self, link_label: CowStr<'input>, span: Range, link_type: LinkType, - broken_link_callback: &mut Option<&mut dyn BrokenLinkCallback<'input>>, + callbacks: &mut Option<&mut dyn ParserCallbacks<'input>>, ) -> Option<(LinkType, CowStr<'input>, CowStr<'input>)> { if self.link_ref_expansion_limit == 0 { return None; @@ -366,7 +362,7 @@ impl<'input> ParserInner<'input> { (link_type, url, title) }) .or_else(|| { - match broken_link_callback { + match callbacks { Some(callback) => { // Construct a BrokenLink struct, which will be passed to the callback let broken_link = BrokenLink { @@ -399,11 +395,8 @@ impl<'input> ParserInner<'input> { /// inline markup passes are run on the remainder of the chain. /// /// Note: there's some potential for optimization here, but that's future work. - fn handle_inline( - &mut self, - broken_link_callback: &mut Option<&mut dyn BrokenLinkCallback<'input>>, - ) { - self.handle_inline_pass1(broken_link_callback); + fn handle_inline(&mut self, callbacks: &mut Option<&mut dyn ParserCallbacks<'input>>) { + self.handle_inline_pass1(callbacks); self.handle_emphasis_and_hard_break(); } @@ -412,10 +405,7 @@ impl<'input> ParserInner<'input> { /// This function handles both inline HTML and code spans, because they have /// the same precedence. It also handles links, even though they have lower /// precedence, because the URL of links must not be processed. - fn handle_inline_pass1( - &mut self, - broken_link_callback: &mut Option<&mut dyn BrokenLinkCallback<'input>>, - ) { + fn handle_inline_pass1(&mut self, callbacks: &mut Option<&mut dyn ParserCallbacks<'input>>) { let mut cur = self.tree.cur(); let mut prev = None; @@ -841,7 +831,7 @@ impl<'input> ParserInner<'input> { link_label, (self.tree[tos.node].item.start)..end, link_type, - broken_link_callback, + callbacks, ) { let link_ix = @@ -2139,18 +2129,15 @@ pub(crate) struct HtmlScanGuard { pub comment: usize, } -/// Trait for broken link callbacks. -/// -/// See [Parser::new_with_broken_link_callback]. -/// Automatically implemented for closures with the appropriate signature. -pub trait BrokenLinkCallback<'input> { +/// Trait to customize [`Parser`] behavior with callbacks. +pub trait ParserCallbacks<'input> { fn handle_broken_link( &mut self, link: BrokenLink<'input>, ) -> Option<(CowStr<'input>, CowStr<'input>)>; } -impl<'input, T> BrokenLinkCallback<'input> for T +impl<'input, T> ParserCallbacks<'input> for T where T: FnMut(BrokenLink<'input>) -> Option<(CowStr<'input>, CowStr<'input>)>, { @@ -2162,7 +2149,7 @@ where } } -impl<'input> BrokenLinkCallback<'input> for Box> { +impl<'input> ParserCallbacks<'input> for Box> { fn handle_broken_link( &mut self, link: BrokenLink<'input>, @@ -2173,9 +2160,9 @@ impl<'input> BrokenLinkCallback<'input> for Box> /// Broken link callback that does nothing. #[derive(Debug)] -pub struct DefaultBrokenLinkCallback; +pub struct DefaultParserCallbacks; -impl<'input> BrokenLinkCallback<'input> for DefaultBrokenLinkCallback { +impl<'input> ParserCallbacks<'input> for DefaultParserCallbacks { fn handle_broken_link( &mut self, _link: BrokenLink<'input>, @@ -2192,52 +2179,52 @@ impl<'input> BrokenLinkCallback<'input> for DefaultBrokenLinkCallback { /// Constructed from a `Parser` using its /// [`into_offset_iter`](struct.Parser.html#method.into_offset_iter) method. #[derive(Debug)] -pub struct OffsetIter<'a, F = DefaultBrokenLinkCallback> { - parser: Parser<'a, F>, +pub struct OffsetIter<'a, CB = DefaultParserCallbacks> { + parser: Parser<'a, CB>, } -impl<'a, F: BrokenLinkCallback<'a>> OffsetIter<'a, F> { +impl<'a, CB: ParserCallbacks<'a>> OffsetIter<'a, CB> { /// Returns a reference to the internal reference definition tracker. pub fn reference_definitions(&self) -> &RefDefs<'_> { self.parser.reference_definitions() } } -impl<'a, F: BrokenLinkCallback<'a>> Iterator for OffsetIter<'a, F> { +impl<'a, CB: ParserCallbacks<'a>> Iterator for OffsetIter<'a, CB> { type Item = (Event<'a>, Range); fn next(&mut self) -> Option { - let broken_link_callback = self + let callbacks = self .parser - .broken_link_callback + .callbacks .as_mut() - .map(|f| f as &mut dyn BrokenLinkCallback<'a>); + .map(|f| f as &mut dyn ParserCallbacks<'a>); - self.parser.inner.next_event_range(broken_link_callback) + self.parser.inner.next_event_range(callbacks) } } -impl<'a, F: BrokenLinkCallback<'a>> Iterator for Parser<'a, F> { +impl<'a, CB: ParserCallbacks<'a>> Iterator for Parser<'a, CB> { type Item = Event<'a>; fn next(&mut self) -> Option> { - let broken_link_callback = self - .broken_link_callback + let callback = self + .callbacks .as_mut() - .map(|f| f as &mut dyn BrokenLinkCallback<'a>); + .map(|f| f as &mut dyn ParserCallbacks<'a>); self.inner - .next_event_range(broken_link_callback) + .next_event_range(callback) .map(|(event, _range)| event) } } -impl<'a, F: BrokenLinkCallback<'a>> FusedIterator for Parser<'a, F> {} +impl<'a, CB: ParserCallbacks<'a>> FusedIterator for Parser<'a, CB> {} impl<'input> ParserInner<'input> { fn next_event_range( &mut self, - mut broken_link_callback: Option<&mut dyn BrokenLinkCallback<'input>>, + mut callbacks: Option<&mut dyn ParserCallbacks<'input>>, ) -> Option<(Event<'input>, Range)> { match self.tree.cur() { None => { @@ -2245,7 +2232,7 @@ impl<'input> ParserInner<'input> { let ix = if matches!(self.tree[ix].item.body, ItemBody::TightParagraph) { // tight paragraphs emit nothing self.tree.next_sibling(ix); - return self.next_event_range(broken_link_callback); + return self.next_event_range(callbacks); } else { ix }; @@ -2264,7 +2251,7 @@ impl<'input> ParserInner<'input> { cur_ix }; if self.tree[cur_ix].item.body.is_maybe_inline() { - self.handle_inline(&mut broken_link_callback); + self.handle_inline(&mut callbacks); } let node = self.tree[cur_ix]; From 29fcbc9549044770c6c3d52610198be8f1e1634e Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Sun, 13 Jul 2025 01:55:28 +0300 Subject: [PATCH 150/180] Default implementation in ParserCallbacks --- pulldown-cmark/src/parse.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 7eed0ff1..184060ac 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -2133,8 +2133,10 @@ pub(crate) struct HtmlScanGuard { pub trait ParserCallbacks<'input> { fn handle_broken_link( &mut self, - link: BrokenLink<'input>, - ) -> Option<(CowStr<'input>, CowStr<'input>)>; + #[allow(unused_variables)] link: BrokenLink<'input>, + ) -> Option<(CowStr<'input>, CowStr<'input>)> { + None + } } impl<'input, T> ParserCallbacks<'input> for T @@ -2162,14 +2164,7 @@ impl<'input> ParserCallbacks<'input> for Box> { #[derive(Debug)] pub struct DefaultParserCallbacks; -impl<'input> ParserCallbacks<'input> for DefaultParserCallbacks { - fn handle_broken_link( - &mut self, - _link: BrokenLink<'input>, - ) -> Option<(CowStr<'input>, CowStr<'input>)> { - None - } -} +impl<'input> ParserCallbacks<'input> for DefaultParserCallbacks {} /// Markdown event and source range iterator. /// From 2d934efe393ad7ca15dcd6bf43204ee8f96277c1 Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Sun, 13 Jul 2025 03:00:08 +0300 Subject: [PATCH 151/180] Add Parser::new_with_callbacks Remove blanket impl of ParserCallbacks for closures. Replaced with a wrapper type BrokenLinkCallback to support the old API. --- pulldown-cmark/src/parse.rs | 49 +++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 184060ac..d9d757a7 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -262,21 +262,12 @@ impl<'input> Parser<'input, DefaultParserCallbacks> { /// Creates a new event iterator for a markdown string with given options. pub fn new_ext(text: &'input str, options: Options) -> Self { - Self::new_with_broken_link_callback(text, options, None) + Self::new_with_callbacks(text, options, None) } } -impl<'input, F: ParserCallbacks<'input>> Parser<'input, F> { - /// In case the parser encounters any potential links that have a broken - /// reference (e.g `[foo]` when there is no `[foo]: ` entry at the bottom) - /// the provided callback will be called with the reference name, - /// and the returned pair will be used as the link URL and title if it is not - /// `None`. - pub fn new_with_broken_link_callback( - text: &'input str, - options: Options, - broken_link_callback: Option, - ) -> Self { +impl<'input, CB: ParserCallbacks<'input>> Parser<'input, CB> { + pub fn new_with_callbacks(text: &'input str, options: Options, callbacks: Option) -> Self { let (mut tree, allocs) = run_first_pass(text, options); tree.reset(); let inline_stack = Default::default(); @@ -284,7 +275,7 @@ impl<'input, F: ParserCallbacks<'input>> Parser<'input, F> { let wikilink_stack = Default::default(); let html_scan_guard = Default::default(); Parser { - callbacks: broken_link_callback, + callbacks, inner: ParserInner { text, @@ -312,11 +303,29 @@ impl<'input, F: ParserCallbacks<'input>> Parser<'input, F> { /// Consumes the event iterator and produces an iterator that produces /// `(Event, Range)` pairs, where the `Range` value maps to the corresponding /// range in the markdown source. - pub fn into_offset_iter(self) -> OffsetIter<'input, F> { + pub fn into_offset_iter(self) -> OffsetIter<'input, CB> { OffsetIter { parser: self } } } +impl<'input, F> Parser<'input, BrokenLinkCallback> +where + BrokenLinkCallback: ParserCallbacks<'input>, +{ + /// In case the parser encounters any potential links that have a broken + /// reference (e.g `[foo]` when there is no `[foo]: ` entry at the bottom) + /// the provided callback will be called with the reference name, + /// and the returned pair will be used as the link URL and title if it is not + /// `None`. + pub fn new_with_broken_link_callback( + text: &'input str, + options: Options, + broken_link_callback: Option, + ) -> Self { + Self::new_with_callbacks(text, options, broken_link_callback.map(BrokenLinkCallback)) + } +} + impl<'input> ParserInner<'input> { /// Use a link label to fetch a type, url, and title. /// @@ -2139,15 +2148,19 @@ pub trait ParserCallbacks<'input> { } } -impl<'input, T> ParserCallbacks<'input> for T +/// TODO: doc +#[allow(missing_debug_implementations)] +pub struct BrokenLinkCallback(F); + +impl<'input, F> ParserCallbacks<'input> for BrokenLinkCallback where - T: FnMut(BrokenLink<'input>) -> Option<(CowStr<'input>, CowStr<'input>)>, + F: FnMut(BrokenLink<'input>) -> Option<(CowStr<'input>, CowStr<'input>)>, { fn handle_broken_link( &mut self, link: BrokenLink<'input>, ) -> Option<(CowStr<'input>, CowStr<'input>)> { - self(link) + self.0(link) } } @@ -2161,7 +2174,7 @@ impl<'input> ParserCallbacks<'input> for Box> { } /// Broken link callback that does nothing. -#[derive(Debug)] +#[allow(missing_debug_implementations)] pub struct DefaultParserCallbacks; impl<'input> ParserCallbacks<'input> for DefaultParserCallbacks {} From 296137f32591e1b68fe01499a1e53b8d934d467a Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Sun, 13 Jul 2025 23:01:44 +0300 Subject: [PATCH 152/180] Document --- pulldown-cmark/src/lib.rs | 5 +++- pulldown-cmark/src/parse.rs | 56 +++++++++++++++++++++++++++++++------ 2 files changed, 52 insertions(+), 9 deletions(-) diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index c8cd0367..22aec463 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -113,7 +113,10 @@ mod tree; use core::fmt::Display; pub use crate::{ - parse::{BrokenLink, DefaultParserCallbacks, OffsetIter, Parser, ParserCallbacks, RefDefs}, + parse::{ + BrokenLink, BrokenLinkCallback, DefaultParserCallbacks, OffsetIter, Parser, + ParserCallbacks, RefDefs, + }, strings::{CowStr, InlineStr}, utils::*, }; diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index d9d757a7..e5508548 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -267,6 +267,30 @@ impl<'input> Parser<'input, DefaultParserCallbacks> { } impl<'input, CB: ParserCallbacks<'input>> Parser<'input, CB> { + /// Creates a new event iterator for markdown text with given options and optionally, callbacks. + /// + /// ``` + /// # use pulldown_cmark::{BrokenLink, CowStr, Event, Options, Parser, ParserCallbacks, Tag}; + /// struct CustomCallbacks; + /// impl<'input> ParserCallbacks<'input> for CustomCallbacks { + /// fn handle_broken_link( + /// &mut self, + /// link: BrokenLink<'input>, + /// ) -> Option<(CowStr<'input>, CowStr<'input>)> { + /// Some(("https://target".into(), link.reference)) + /// } + /// } + /// + /// let mut parser = + /// Parser::new_with_callbacks("[broken]", Options::empty(), Some(CustomCallbacks)); + /// + /// assert!(matches!( + /// parser.nth(1), + /// Some(Event::Start(Tag::Link { .. })) + /// )); + /// ``` + /// + /// See the [`ParserCallbacks`] trait for a list of callbacks that can be overridden. pub fn new_with_callbacks(text: &'input str, options: Options, callbacks: Option) -> Self { let (mut tree, allocs) = run_first_pass(text, options); tree.reset(); @@ -308,20 +332,23 @@ impl<'input, CB: ParserCallbacks<'input>> Parser<'input, CB> { } } -impl<'input, F> Parser<'input, BrokenLinkCallback> -where - BrokenLinkCallback: ParserCallbacks<'input>, -{ +impl<'input, F> Parser<'input, BrokenLinkCallback> { /// In case the parser encounters any potential links that have a broken /// reference (e.g `[foo]` when there is no `[foo]: ` entry at the bottom) /// the provided callback will be called with the reference name, /// and the returned pair will be used as the link URL and title if it is not /// `None`. + /// + /// This constructor is provided for backwards compatibility. + /// This and other callbacks can also be customized with [`Parser::new_with_callbacks`]. pub fn new_with_broken_link_callback( text: &'input str, options: Options, broken_link_callback: Option, - ) -> Self { + ) -> Self + where + F: FnMut(BrokenLink<'input>) -> Option<(CowStr<'input>, CowStr<'input>)>, + { Self::new_with_callbacks(text, options, broken_link_callback.map(BrokenLinkCallback)) } } @@ -2138,8 +2165,17 @@ pub(crate) struct HtmlScanGuard { pub comment: usize, } -/// Trait to customize [`Parser`] behavior with callbacks. +/// Trait to customize [`Parser`] behavior with callbacks. See [`Parser::new_with_callbacks`]. +/// +/// All methods have a default implementation, so you can choose which ones to override. pub trait ParserCallbacks<'input> { + /// Potentially provide a custom definition for a broken link. + /// + /// In case the parser encounters any potential links that have a broken + /// reference (e.g `[foo]` when there is no `[foo]: ` entry at the bottom) + /// this callback will be called with information about the reference, + /// and the returned pair will be used as the link URL and title if it is not + /// `None`. fn handle_broken_link( &mut self, #[allow(unused_variables)] link: BrokenLink<'input>, @@ -2148,7 +2184,9 @@ pub trait ParserCallbacks<'input> { } } -/// TODO: doc +/// Wrapper to implement [`ParserCallbacks::handle_broken_link`] with a closure. +/// +/// Used internally by [`Parser::new_with_broken_link_callback`]. #[allow(missing_debug_implementations)] pub struct BrokenLinkCallback(F); @@ -2173,7 +2211,9 @@ impl<'input> ParserCallbacks<'input> for Box> { } } -/// Broken link callback that does nothing. +/// [Parser] callbacks that do nothing. +/// +/// Used when no custom callbacks are provided. #[allow(missing_debug_implementations)] pub struct DefaultParserCallbacks; From 9c7b81ae2444fedca55eac5b2324fce46818ace0 Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Wed, 10 Sep 2025 18:42:54 +0300 Subject: [PATCH 153/180] callbacks field without Option No measurable performance impact in a quick benchmark: https://github.com/pulldown-cmark/pulldown-cmark/pull/1049#discussion_r2312434599 --- pulldown-cmark/src/parse.rs | 70 +++++++++++++++---------------------- 1 file changed, 28 insertions(+), 42 deletions(-) diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index e5508548..3fcfeb47 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -191,7 +191,7 @@ pub struct BrokenLink<'a> { /// Markdown event iterator. pub struct Parser<'input, CB = DefaultParserCallbacks> { - callbacks: Option, + callbacks: CB, inner: ParserInner<'input>, } @@ -236,7 +236,7 @@ impl<'input, CB> core::fmt::Debug for Parser<'input, CB> { f.debug_struct("Parser") .field("text", &self.inner.text) .field("options", &self.inner.options) - .field("callbacks", &self.callbacks.as_ref().map(|_| ..)) + .field("callbacks", &..) .finish() } } @@ -262,12 +262,12 @@ impl<'input> Parser<'input, DefaultParserCallbacks> { /// Creates a new event iterator for a markdown string with given options. pub fn new_ext(text: &'input str, options: Options) -> Self { - Self::new_with_callbacks(text, options, None) + Self::new_with_callbacks(text, options, DefaultParserCallbacks) } } impl<'input, CB: ParserCallbacks<'input>> Parser<'input, CB> { - /// Creates a new event iterator for markdown text with given options and optionally, callbacks. + /// Creates a new event iterator for markdown text with given options and callbacks. /// /// ``` /// # use pulldown_cmark::{BrokenLink, CowStr, Event, Options, Parser, ParserCallbacks, Tag}; @@ -282,7 +282,7 @@ impl<'input, CB: ParserCallbacks<'input>> Parser<'input, CB> { /// } /// /// let mut parser = - /// Parser::new_with_callbacks("[broken]", Options::empty(), Some(CustomCallbacks)); + /// Parser::new_with_callbacks("[broken]", Options::empty(), CustomCallbacks); /// /// assert!(matches!( /// parser.nth(1), @@ -291,7 +291,7 @@ impl<'input, CB: ParserCallbacks<'input>> Parser<'input, CB> { /// ``` /// /// See the [`ParserCallbacks`] trait for a list of callbacks that can be overridden. - pub fn new_with_callbacks(text: &'input str, options: Options, callbacks: Option) -> Self { + pub fn new_with_callbacks(text: &'input str, options: Options, callbacks: CB) -> Self { let (mut tree, allocs) = run_first_pass(text, options); tree.reset(); let inline_stack = Default::default(); @@ -349,7 +349,7 @@ impl<'input, F> Parser<'input, BrokenLinkCallback> { where F: FnMut(BrokenLink<'input>) -> Option<(CowStr<'input>, CowStr<'input>)>, { - Self::new_with_callbacks(text, options, broken_link_callback.map(BrokenLinkCallback)) + Self::new_with_callbacks(text, options, BrokenLinkCallback(broken_link_callback)) } } @@ -377,7 +377,7 @@ impl<'input> ParserInner<'input> { link_label: CowStr<'input>, span: Range, link_type: LinkType, - callbacks: &mut Option<&mut dyn ParserCallbacks<'input>>, + callbacks: &mut dyn ParserCallbacks<'input>, ) -> Option<(LinkType, CowStr<'input>, CowStr<'input>)> { if self.link_ref_expansion_limit == 0 { return None; @@ -398,21 +398,16 @@ impl<'input> ParserInner<'input> { (link_type, url, title) }) .or_else(|| { - match callbacks { - Some(callback) => { - // Construct a BrokenLink struct, which will be passed to the callback - let broken_link = BrokenLink { - span, - link_type, - reference: link_label, - }; + // Construct a BrokenLink struct, which will be passed to the callback + let broken_link = BrokenLink { + span, + link_type, + reference: link_label, + }; - callback - .handle_broken_link(broken_link) - .map(|(url, title)| (link_type.to_unknown(), url, title)) - } - None => None, - } + callbacks + .handle_broken_link(broken_link) + .map(|(url, title)| (link_type.to_unknown(), url, title)) })?; // Limit expansion from link references. @@ -431,7 +426,7 @@ impl<'input> ParserInner<'input> { /// inline markup passes are run on the remainder of the chain. /// /// Note: there's some potential for optimization here, but that's future work. - fn handle_inline(&mut self, callbacks: &mut Option<&mut dyn ParserCallbacks<'input>>) { + fn handle_inline(&mut self, callbacks: &mut dyn ParserCallbacks<'input>) { self.handle_inline_pass1(callbacks); self.handle_emphasis_and_hard_break(); } @@ -441,7 +436,7 @@ impl<'input> ParserInner<'input> { /// This function handles both inline HTML and code spans, because they have /// the same precedence. It also handles links, even though they have lower /// precedence, because the URL of links must not be processed. - fn handle_inline_pass1(&mut self, callbacks: &mut Option<&mut dyn ParserCallbacks<'input>>) { + fn handle_inline_pass1(&mut self, callbacks: &mut dyn ParserCallbacks<'input>) { let mut cur = self.tree.cur(); let mut prev = None; @@ -2188,7 +2183,7 @@ pub trait ParserCallbacks<'input> { /// /// Used internally by [`Parser::new_with_broken_link_callback`]. #[allow(missing_debug_implementations)] -pub struct BrokenLinkCallback(F); +pub struct BrokenLinkCallback(Option); impl<'input, F> ParserCallbacks<'input> for BrokenLinkCallback where @@ -2198,7 +2193,7 @@ where &mut self, link: BrokenLink<'input>, ) -> Option<(CowStr<'input>, CowStr<'input>)> { - self.0(link) + self.0.as_mut().and_then(|cb| cb(link)) } } @@ -2227,7 +2222,7 @@ impl<'input> ParserCallbacks<'input> for DefaultParserCallbacks {} /// Constructed from a `Parser` using its /// [`into_offset_iter`](struct.Parser.html#method.into_offset_iter) method. #[derive(Debug)] -pub struct OffsetIter<'a, CB = DefaultParserCallbacks> { +pub struct OffsetIter<'a, CB> { parser: Parser<'a, CB>, } @@ -2242,13 +2237,9 @@ impl<'a, CB: ParserCallbacks<'a>> Iterator for OffsetIter<'a, CB> { type Item = (Event<'a>, Range); fn next(&mut self) -> Option { - let callbacks = self - .parser - .callbacks - .as_mut() - .map(|f| f as &mut dyn ParserCallbacks<'a>); - - self.parser.inner.next_event_range(callbacks) + self.parser + .inner + .next_event_range(&mut self.parser.callbacks) } } @@ -2256,13 +2247,8 @@ impl<'a, CB: ParserCallbacks<'a>> Iterator for Parser<'a, CB> { type Item = Event<'a>; fn next(&mut self) -> Option> { - let callback = self - .callbacks - .as_mut() - .map(|f| f as &mut dyn ParserCallbacks<'a>); - self.inner - .next_event_range(callback) + .next_event_range(&mut self.callbacks) .map(|(event, _range)| event) } } @@ -2272,7 +2258,7 @@ impl<'a, CB: ParserCallbacks<'a>> FusedIterator for Parser<'a, CB> {} impl<'input> ParserInner<'input> { fn next_event_range( &mut self, - mut callbacks: Option<&mut dyn ParserCallbacks<'input>>, + callbacks: &mut dyn ParserCallbacks<'input>, ) -> Option<(Event<'input>, Range)> { match self.tree.cur() { None => { @@ -2299,7 +2285,7 @@ impl<'input> ParserInner<'input> { cur_ix }; if self.tree[cur_ix].item.body.is_maybe_inline() { - self.handle_inline(&mut callbacks); + self.handle_inline(callbacks); } let node = self.tree[cur_ix]; From 722646f53bf89b2a67d18d0db713f7529ecc0618 Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Sat, 11 Oct 2025 10:47:44 +0100 Subject: [PATCH 154/180] bug fix and container limit --- pulldown-cmark/specs/container_extensions.txt | 34 ++++ pulldown-cmark/src/firstpass.rs | 175 +++++++++++++----- pulldown-cmark/src/parse.rs | 94 ++++------ pulldown-cmark/src/scanners.rs | 8 +- .../tests/suite/container_extensions.rs | 41 ++++ 5 files changed, 244 insertions(+), 108 deletions(-) diff --git a/pulldown-cmark/specs/container_extensions.txt b/pulldown-cmark/specs/container_extensions.txt index 461623e6..27d9732f 100644 --- a/pulldown-cmark/specs/container_extensions.txt +++ b/pulldown-cmark/specs/container_extensions.txt @@ -286,3 +286,37 @@ Hi

    Hi

    ```````````````````````````````` + +```````````````````````````````` example_container_extensions +::: container +> shouldn't close, right? +> ::: +> x +::: +. +
    +
    +

    shouldn't close, right? +::: +x

    +
    +
    +```````````````````````````````` + + +```````````````````````````````` example_container_extensions +::: container +> shouldn't close, right? +> ::: +> x + +::: +. +
    +
    +

    shouldn't close, right? +::: +x

    +
    +
    +```````````````````````````````` diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index ffe32d45..0815fd62 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -2,7 +2,7 @@ //! are in a linear chain with potential inline markup identified. use alloc::{string::String, vec::Vec}; -use core::{cmp::max, ops::Range}; +use core::{cmp::max, ops::Range, u8}; use unicase::UniCase; @@ -35,6 +35,7 @@ pub(crate) fn run_first_pass(text: &str, options: Options) -> (Tree, Alloc lookup_table, brace_context_next: 0, brace_context_stack: Vec::new(), + container_depth: 0, }; first_pass.run() } @@ -59,6 +60,7 @@ struct FirstPass<'a, 'b> { allocs: Allocations<'a>, options: Options, lookup_table: &'b LookupTable, + container_depth: u8, /// Math environment brace nesting. brace_context_stack: Vec, brace_context_next: usize, @@ -133,6 +135,9 @@ impl<'a, 'b> FirstPass<'a, 'b> { end: after_marker_index, // will get updated later if item not empty body: ItemBody::ListItem(indent), }); + if self.container_depth < u8::MAX { + self.container_depth = self.container_depth + 1; + } self.tree.push(); if let Some(n) = scan_blank_line(&bytes[after_marker_index..]) { self.begin_list_item = Some(after_marker_index + n); @@ -221,6 +226,9 @@ impl<'a, 'b> FirstPass<'a, 'b> { self.last_line_blank = false; } } + if self.container_depth < u8::MAX { + self.container_depth = self.container_depth + 1; + } self.tree.push(); if let Some(n) = scan_blank_line(&bytes[after_marker_index..]) { self.begin_list_item = Some(after_marker_index + n); @@ -238,6 +246,9 @@ impl<'a, 'b> FirstPass<'a, 'b> { end: 0, // will get set later body: ItemBody::BlockQuote(kind), }); + if self.container_depth < u8::MAX { + self.container_depth = self.container_depth + 1; + } self.tree.push(); if kind.is_some() { // blockquote tag leaves us at the end of the line @@ -271,54 +282,62 @@ impl<'a, 'b> FirstPass<'a, 'b> { let fence_length = scan_ch_repeat(&bytes[(start_ix + line_start.bytes_scanned())..], b':'); - let mut kind_start = start_ix + line_start.bytes_scanned() + fence_length; - kind_start += scan_whitespace_no_nl(&bytes[kind_start..]); - let kind_length = scan_while(&bytes[kind_start..], |c| { - is_ascii_alphanumeric(c) || c == b'_' || c == b'-' || c == b':' || c == b'.' - }); - if kind_length == 0 { + if fence_length > u8::MAX as usize || self.container_depth == u8::MAX { break; } else { - let kind = unescape( - &self.text[kind_start..(kind_start + kind_length)], - self.tree.is_in_table(), - ); - - let mut summary_start = kind_start + kind_length; - summary_start += scan_whitespace_no_nl(&bytes[summary_start..]); - let line_end = summary_start + scan_nextline(&bytes[summary_start..]); - let summary_end = line_end - - scan_rev_while(&bytes[summary_start..line_end], is_ascii_whitespace); - let summary = unescape( - &self.text[summary_start..summary_end], - self.tree.is_in_table(), - ); - let summary_cow_ix = self.allocs.allocate_cow(summary); - - if kind.eq_ignore_ascii_case("spoiler") { - self.tree.append(Item { - start: container_start, - end: 0, - body: ItemBody::Container( - fence_length, - ContainerKind::Spoiler, - summary_cow_ix, - ), - }); + let mut kind_start = start_ix + line_start.bytes_scanned() + fence_length; + kind_start += scan_whitespace_no_nl(&bytes[kind_start..]); + let kind_length = scan_while(&bytes[kind_start..], |c| { + is_ascii_alphanumeric(c) || c == b'_' || c == b'-' || c == b':' || c == b'.' + }); + if kind_length == 0 { + break; } else { - let kind_cow_ix = self.allocs.allocate_cow(kind); - self.tree.append(Item { - start: container_start, - end: 0, - body: ItemBody::Container( - fence_length, - ContainerKind::Default, - kind_cow_ix, - ), - }); + let kind = unescape( + &self.text[kind_start..(kind_start + kind_length)], + self.tree.is_in_table(), + ); + + let mut summary_start = kind_start + kind_length; + summary_start += scan_whitespace_no_nl(&bytes[summary_start..]); + let line_end = summary_start + scan_nextline(&bytes[summary_start..]); + let summary_end = line_end + - scan_rev_while(&bytes[summary_start..line_end], is_ascii_whitespace); + let summary = unescape( + &self.text[summary_start..summary_end], + self.tree.is_in_table(), + ); + let summary_cow_ix = self.allocs.allocate_cow(summary); + if kind.eq_ignore_ascii_case("spoiler") { + self.tree.append(Item { + start: container_start, + end: 0, + body: ItemBody::Container( + self.container_depth, + fence_length as u8, + ContainerKind::Spoiler, + summary_cow_ix, + ), + }); + } else { + let kind_cow_ix = self.allocs.allocate_cow(kind); + self.tree.append(Item { + start: container_start, + end: 0, + body: ItemBody::Container( + self.container_depth, + fence_length as u8, + ContainerKind::Default, + kind_cow_ix, + ), + }); + } + self.tree.push(); + if self.container_depth < u8::MAX { + self.container_depth = self.container_depth + 1; + } + return summary_end + 1; } - self.tree.push(); - return summary_end + 1; } } else { line_start = save; @@ -326,6 +345,30 @@ impl<'a, 'b> FirstPass<'a, 'b> { } } + if self.options.contains(Options::ENABLE_CONTAINER_EXTENSIONS) && self.container_depth > 0 { + let mut i = self.tree.spine_len(); + for &node_ix in self.tree.walk_spine().rev() { + match self.tree[node_ix].item.body { + ItemBody::Container(depth, length, ..) => { + if depth == (self.container_depth - 1) { + if line_start.scan_closing_container_extensions_fence(length) { + break; + } + } + } + _ => (), + } + i = i - 1; + } + + if i > 0 { + for _ in i..=self.tree.spine_len() { + self.pop(start_ix); + } + } + } + + let ix = start_ix + line_start.bytes_scanned(); if let Some(n) = scan_blank_line(&bytes[ix..]) { @@ -670,6 +713,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { let bytes = self.text.as_bytes(); let mut ix = start_ix; loop { + let scan_mode = if self.options.contains(Options::ENABLE_TABLES) && ix == start_ix { TableParseMode::Scan } else { @@ -702,6 +746,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { let mut line_start = LineStart::new(&bytes[ix..]); let tree_position = scan_containers(&self.tree, &mut line_start, self.options); let current_container = tree_position == self.tree.spine_len(); + let trailing_backslash_pos = match brk { Some(Item { start, @@ -734,6 +779,11 @@ impl<'a, 'b> FirstPass<'a, 'b> { } break; } + if self.options.contains(Options::ENABLE_CONTAINER_EXTENSIONS) && !current_container { + if line_start.scan_closing_container_extensions_fence(3) { + break; + } + } } line_start.scan_all_space(); if line_start.is_at_eol() { @@ -742,10 +792,33 @@ impl<'a, 'b> FirstPass<'a, 'b> { } break; } + + if self.options.contains(Options::ENABLE_CONTAINER_EXTENSIONS) && self.container_depth > 0 { + let mut i = self.tree.spine_len(); + for &node_ix in self.tree.walk_spine().rev() { + match self.tree[node_ix].item.body { + ItemBody::Container(depth, length, ..) => { + if depth == (self.container_depth - 1) { + if line_start.scan_closing_container_extensions_fence(length) { + break; + } + } + } + _ => (), + } + i = i - 1; + } + + if i > 0 { + break; + } + } + ix = next_ix + line_start.bytes_scanned(); if let Some(item) = brk { self.tree.append(item); } + } self.pop(ix); @@ -1562,6 +1635,15 @@ impl<'a, 'b> FirstPass<'a, 'b> { fn pop(&mut self, ix: usize) { let cur_ix = self.tree.pop().unwrap(); self.tree[cur_ix].item.end = ix; + + match self.tree[cur_ix].item.body { + ItemBody::Container(..) | ItemBody::BlockQuote(..) | ItemBody::ListItem(..) | ItemBody::DefinitionListDefinition(..) | ItemBody::FootnoteDefinition(..) => { + self.container_depth = self.container_depth - 1; + } + _ => { + } + } + if let ItemBody::DefinitionList(_) = self.tree[cur_ix].item.body { fixup_end_of_definition_list(&mut self.tree, cur_ix); self.begin_list_item = None; @@ -1790,6 +1872,9 @@ impl<'a, 'b> FirstPass<'a, 'b> { // TODO: check whether the label here is strictly necessary body: ItemBody::FootnoteDefinition(self.allocs.allocate_cow(label)), }); + if self.container_depth < u8::MAX { + self.container_depth = self.container_depth + 1; + } self.tree.push(); Some(i) } diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 977aa099..29729fc3 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -114,7 +114,7 @@ pub(crate) enum ItemBody { IndentCodeBlock, HtmlBlock, BlockQuote(Option), - Container(usize, ContainerKind, CowIndex), + Container(u8, u8, ContainerKind, CowIndex), List(bool, u8, u64), // is_tight, list character, list start index ListItem(usize), // indent level FootnoteDefinition(CowIndex), @@ -1468,67 +1468,43 @@ pub(crate) fn scan_containers( line_start: &mut LineStart<'_>, options: Options, ) -> usize { - if tree.spine_len() > 0 { - let mut i = tree.spine_len(); - for &node_ix in tree.walk_spine().rev() { - match tree[node_ix].item.body { - ItemBody::Container(length, ..) => { - if line_start.scan_closing_container_extensions_fence(length) { - break; - } + let mut i = 0; + for &node_ix in tree.walk_spine() { + match tree[node_ix].item.body { + ItemBody::BlockQuote(..) => { + let save = line_start.clone(); + let _ = line_start.scan_space(3); + if !line_start.scan_blockquote_marker() { + *line_start = save; + break; } - _ => (), } - i = i - 1; - } - if i > 0 { - i - 1 - } else { - let mut i = 0; - for &node_ix in tree.walk_spine() { - match tree[node_ix].item.body { - ItemBody::BlockQuote(..) => { - let save = line_start.clone(); - let _ = line_start.scan_space(3); - if !line_start.scan_blockquote_marker() { - *line_start = save; - break; - } - } - ItemBody::ListItem(indent) => { - let save = line_start.clone(); - if !line_start.scan_space(indent) && !line_start.is_at_eol() { - *line_start = save; - break; - } - } - ItemBody::DefinitionListDefinition(indent) => { - let save = line_start.clone(); - if !line_start.scan_space(indent) && !line_start.is_at_eol() { - *line_start = save; - break; - } - } - ItemBody::FootnoteDefinition(..) if options.has_gfm_footnotes() => { - let save = line_start.clone(); - if !line_start.scan_space(4) && !line_start.is_at_eol() { - *line_start = save; - break; - } - } - _ => (), + ItemBody::ListItem(indent) => { + let save = line_start.clone(); + if !line_start.scan_space(indent) && !line_start.is_at_eol() { + *line_start = save; + break; } - i = i + 1; } - if i < tree.spine_len() { - i - } else { - tree.spine_len() + ItemBody::DefinitionListDefinition(indent) => { + let save = line_start.clone(); + if !line_start.scan_space(indent) && !line_start.is_at_eol() { + *line_start = save; + break; + } + } + ItemBody::FootnoteDefinition(..) if options.has_gfm_footnotes() => { + let save = line_start.clone(); + if !line_start.scan_space(4) && !line_start.is_at_eol() { + *line_start = save; + break; + } } + _ => (), } - } else { - 0 + i += 1; } + i } pub(crate) fn skip_container_prefixes(tree: &Tree, bytes: &[u8], options: Options) -> usize { @@ -2320,7 +2296,7 @@ fn body_to_tag_end(body: &ItemBody) -> TagEnd { ItemBody::Image(..) => TagEnd::Image, ItemBody::Heading(level, _) => TagEnd::Heading(level), ItemBody::IndentCodeBlock | ItemBody::FencedCodeBlock(..) => TagEnd::CodeBlock, - ItemBody::Container(_, kind, _) => TagEnd::ContainerBlock(kind), + ItemBody::Container(_, _, kind, _) => TagEnd::ContainerBlock(kind), ItemBody::BlockQuote(kind) => TagEnd::BlockQuote(kind), ItemBody::HtmlBlock => TagEnd::HtmlBlock, ItemBody::List(_, c, _) => { @@ -2401,7 +2377,7 @@ fn item_to_event<'a>(item: Item, text: &'a str, allocs: &mut Allocations<'a>) -> Tag::CodeBlock(CodeBlockKind::Fenced(allocs.take_cow(cow_ix))) } ItemBody::IndentCodeBlock => Tag::CodeBlock(CodeBlockKind::Indented), - ItemBody::Container(_, kind, cow_ix) => Tag::ContainerBlock(kind, allocs.take_cow(cow_ix)), + ItemBody::Container(_, _, kind, cow_ix) => Tag::ContainerBlock(kind, allocs.take_cow(cow_ix)), ItemBody::BlockQuote(kind) => Tag::BlockQuote(kind), ItemBody::List(_, c, listitem_start) => { if c == b'.' || c == b')' { @@ -2458,14 +2434,14 @@ mod test { #[cfg(target_pointer_width = "64")] fn node_size() { let node_size = core::mem::size_of::>(); - assert_eq!(56, node_size); + assert_eq!(48, node_size); } #[test] #[cfg(target_pointer_width = "64")] fn body_size() { let body_size = core::mem::size_of::(); - assert_eq!(24, body_size); + assert_eq!(16, body_size); } #[test] diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index 39b9be61..4f31332c 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -269,15 +269,15 @@ impl<'a> LineStart<'a> { } } - pub(crate) fn scan_closing_container_extensions_fence(&mut self, length: usize) -> bool { + pub(crate) fn scan_closing_container_extensions_fence(&mut self, length: u8) -> bool { let nl_ix = scan_nextline(&self.bytes[self.ix..]); - let eol_length = scan_rev_while(&self.bytes[self.ix..nl_ix], |c| { + let eol_length = scan_rev_while(&self.bytes[self.ix..(self.ix + nl_ix)], |c| { c == b'\n' || c == b'\r' || c == b' ' }); let fence_length = - scan_rev_while(&self.bytes[self.ix..(nl_ix - eol_length)], |c| c == b':'); + scan_rev_while(&self.bytes[self.ix..(self.ix + nl_ix - eol_length)], |c| c == b':'); - if fence_length >= length { + if fence_length >= length as usize { self.ix = self.ix + (nl_ix - eol_length); true } else { diff --git a/pulldown-cmark/tests/suite/container_extensions.rs b/pulldown-cmark/tests/suite/container_extensions.rs index c26b0d5c..d7bf9ddc 100644 --- a/pulldown-cmark/tests/suite/container_extensions.rs +++ b/pulldown-cmark/tests/suite/container_extensions.rs @@ -369,3 +369,44 @@ Hi test_markdown_html(original, expected, false, false, false, false, false, false, true); } + +#[test] +fn container_extensions_test_21() { + let original = r##"::: container +> shouldn't close, right? +> ::: +> x +::: +"##; + let expected = r##"
    +
    +

    shouldn't close, right? +::: +x

    +
    +
    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, true); +} + +#[test] +fn container_extensions_test_22() { + let original = r##"::: container +> shouldn't close, right? +> ::: +> x + +::: +"##; + let expected = r##"
    +
    +

    shouldn't close, right? +::: +x

    +
    +
    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, true); +} From 9f0dba66dd591c4cd3233be61f9709d0cdfc31a2 Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Sat, 11 Oct 2025 10:54:16 +0100 Subject: [PATCH 155/180] fmt --- pulldown-cmark/src/firstpass.rs | 23 +++++++++++++---------- pulldown-cmark/src/parse.rs | 4 +++- pulldown-cmark/src/scanners.rs | 4 +++- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 0815fd62..9c896b9f 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -368,7 +368,6 @@ impl<'a, 'b> FirstPass<'a, 'b> { } } - let ix = start_ix + line_start.bytes_scanned(); if let Some(n) = scan_blank_line(&bytes[ix..]) { @@ -713,7 +712,6 @@ impl<'a, 'b> FirstPass<'a, 'b> { let bytes = self.text.as_bytes(); let mut ix = start_ix; loop { - let scan_mode = if self.options.contains(Options::ENABLE_TABLES) && ix == start_ix { TableParseMode::Scan } else { @@ -779,7 +777,8 @@ impl<'a, 'b> FirstPass<'a, 'b> { } break; } - if self.options.contains(Options::ENABLE_CONTAINER_EXTENSIONS) && !current_container { + if self.options.contains(Options::ENABLE_CONTAINER_EXTENSIONS) && !current_container + { if line_start.scan_closing_container_extensions_fence(3) { break; } @@ -793,7 +792,9 @@ impl<'a, 'b> FirstPass<'a, 'b> { break; } - if self.options.contains(Options::ENABLE_CONTAINER_EXTENSIONS) && self.container_depth > 0 { + if self.options.contains(Options::ENABLE_CONTAINER_EXTENSIONS) + && self.container_depth > 0 + { let mut i = self.tree.spine_len(); for &node_ix in self.tree.walk_spine().rev() { match self.tree[node_ix].item.body { @@ -818,7 +819,6 @@ impl<'a, 'b> FirstPass<'a, 'b> { if let Some(item) = brk { self.tree.append(item); } - } self.pop(ix); @@ -1637,11 +1637,14 @@ impl<'a, 'b> FirstPass<'a, 'b> { self.tree[cur_ix].item.end = ix; match self.tree[cur_ix].item.body { - ItemBody::Container(..) | ItemBody::BlockQuote(..) | ItemBody::ListItem(..) | ItemBody::DefinitionListDefinition(..) | ItemBody::FootnoteDefinition(..) => { - self.container_depth = self.container_depth - 1; - } - _ => { - } + ItemBody::Container(..) + | ItemBody::BlockQuote(..) + | ItemBody::ListItem(..) + | ItemBody::DefinitionListDefinition(..) + | ItemBody::FootnoteDefinition(..) => { + self.container_depth = self.container_depth - 1; + } + _ => {} } if let ItemBody::DefinitionList(_) = self.tree[cur_ix].item.body { diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 29729fc3..0b7554a2 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -2377,7 +2377,9 @@ fn item_to_event<'a>(item: Item, text: &'a str, allocs: &mut Allocations<'a>) -> Tag::CodeBlock(CodeBlockKind::Fenced(allocs.take_cow(cow_ix))) } ItemBody::IndentCodeBlock => Tag::CodeBlock(CodeBlockKind::Indented), - ItemBody::Container(_, _, kind, cow_ix) => Tag::ContainerBlock(kind, allocs.take_cow(cow_ix)), + ItemBody::Container(_, _, kind, cow_ix) => { + Tag::ContainerBlock(kind, allocs.take_cow(cow_ix)) + } ItemBody::BlockQuote(kind) => Tag::BlockQuote(kind), ItemBody::List(_, c, listitem_start) => { if c == b'.' || c == b')' { diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index 4f31332c..8e8d226d 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -275,7 +275,9 @@ impl<'a> LineStart<'a> { c == b'\n' || c == b'\r' || c == b' ' }); let fence_length = - scan_rev_while(&self.bytes[self.ix..(self.ix + nl_ix - eol_length)], |c| c == b':'); + scan_rev_while(&self.bytes[self.ix..(self.ix + nl_ix - eol_length)], |c| { + c == b':' + }); if fence_length >= length as usize { self.ix = self.ix + (nl_ix - eol_length); From 8bc44c8140353994560d1adda0ebc39c46ce9484 Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Fri, 17 Oct 2025 11:30:08 +0100 Subject: [PATCH 156/180] revert to spine_len nesting logic Co-authored-by: Roope Salmi --- pulldown-cmark/src/firstpass.rs | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 9c896b9f..6f8afcbe 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -345,29 +345,28 @@ impl<'a, 'b> FirstPass<'a, 'b> { } } - if self.options.contains(Options::ENABLE_CONTAINER_EXTENSIONS) && self.container_depth > 0 { - let mut i = self.tree.spine_len(); - for &node_ix in self.tree.walk_spine().rev() { + if self.options.contains(Options::ENABLE_CONTAINER_EXTENSIONS) { + let mut pop_count = None; + for (i, &node_ix) in self.tree.walk_spine().rev().enumerate() { match self.tree[node_ix].item.body { - ItemBody::Container(depth, length, ..) => { - if depth == (self.container_depth - 1) { - if line_start.scan_closing_container_extensions_fence(length) { - break; - } + ItemBody::Container(_, length, ..) => { + if line_start.scan_closing_container_extensions_fence(length) { + pop_count = Some(i + 1); + break; } } - _ => (), + _ => { + break; + } } - i = i - 1; } - if i > 0 { - for _ in i..=self.tree.spine_len() { + if let Some(c) = pop_count { + for _ in 0..c { self.pop(start_ix); } } } - let ix = start_ix + line_start.bytes_scanned(); if let Some(n) = scan_blank_line(&bytes[ix..]) { From 1c4ecfdac15b0b975bf81e3f6dc8b952c15258d9 Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Fri, 17 Oct 2025 11:32:19 +0100 Subject: [PATCH 157/180] revert to spine_len nesting logic Co-authored-by: Roope Salmi --- pulldown-cmark/src/firstpass.rs | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 6f8afcbe..5050be84 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -791,25 +791,23 @@ impl<'a, 'b> FirstPass<'a, 'b> { break; } - if self.options.contains(Options::ENABLE_CONTAINER_EXTENSIONS) - && self.container_depth > 0 - { - let mut i = self.tree.spine_len(); - for &node_ix in self.tree.walk_spine().rev() { + if self.options.contains(Options::ENABLE_CONTAINER_EXTENSIONS) { + let mut closes = false; + for &node_ix in self.tree.walk_spine().rev().skip(1) { match self.tree[node_ix].item.body { - ItemBody::Container(depth, length, ..) => { - if depth == (self.container_depth - 1) { - if line_start.scan_closing_container_extensions_fence(length) { - break; - } + ItemBody::Container(_, length, ..) => { + if line_start.scan_closing_container_extensions_fence(length) { + closes = true; + break; } } - _ => (), + _ => { + break; + } } - i = i - 1; } - if i > 0 { + if closes { break; } } From 0af4b482ec47071a01ce1339afc6f9a581344b4e Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Fri, 17 Oct 2025 11:37:35 +0100 Subject: [PATCH 158/180] revert to spine_len nesting logic Co-authored-by: Roope Salmi --- pulldown-cmark/src/firstpass.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 5050be84..eb4f47bf 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -282,7 +282,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { let fence_length = scan_ch_repeat(&bytes[(start_ix + line_start.bytes_scanned())..], b':'); - if fence_length > u8::MAX as usize || self.container_depth == u8::MAX { + if fence_length > u8::MAX as usize || self.tree.spine_len() > CONTAINER_BLOCK_NEST_LIMIT { break; } else { let mut kind_start = start_ix + line_start.bytes_scanned() + fence_length; From 71efd41e7c22f1e8e7934131abc270b6b74ebc23 Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Mon, 20 Oct 2025 11:07:29 +0100 Subject: [PATCH 159/180] maximum fence length and fence close tests --- pulldown-cmark/specs/container_extensions.txt | 31 ++++++++++- pulldown-cmark/src/firstpass.rs | 53 +++++-------------- pulldown-cmark/src/parse.rs | 12 ++--- pulldown-cmark/src/scanners.rs | 25 ++++----- pulldown-cmark/tests/html.rs | 1 + .../tests/suite/container_extensions.rs | 42 +++++++++++++++ 6 files changed, 105 insertions(+), 59 deletions(-) diff --git a/pulldown-cmark/specs/container_extensions.txt b/pulldown-cmark/specs/container_extensions.txt index 27d9732f..078b985b 100644 --- a/pulldown-cmark/specs/container_extensions.txt +++ b/pulldown-cmark/specs/container_extensions.txt @@ -303,7 +303,6 @@ x

    ```````````````````````````````` - ```````````````````````````````` example_container_extensions ::: container > shouldn't close, right? @@ -320,3 +319,33 @@ x

    ```````````````````````````````` + +```````````````````````````````` example_container_extensions +::: a +:::: b +::::: c +:::: +x +. +
    +
    +
    +
    +
    +

    x

    +
    +```````````````````````````````` + +```````````````````````````````` example_container_extensions +::: a +content ::: +. +

    content :::

    +```````````````````````````````` + +```````````````````````````````` example_container_extensions +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: a +content ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +. +

    content :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    +```````````````````````````````` diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 5050be84..0b024d19 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -35,7 +35,6 @@ pub(crate) fn run_first_pass(text: &str, options: Options) -> (Tree, Alloc lookup_table, brace_context_next: 0, brace_context_stack: Vec::new(), - container_depth: 0, }; first_pass.run() } @@ -60,7 +59,6 @@ struct FirstPass<'a, 'b> { allocs: Allocations<'a>, options: Options, lookup_table: &'b LookupTable, - container_depth: u8, /// Math environment brace nesting. brace_context_stack: Vec, brace_context_next: usize, @@ -135,9 +133,6 @@ impl<'a, 'b> FirstPass<'a, 'b> { end: after_marker_index, // will get updated later if item not empty body: ItemBody::ListItem(indent), }); - if self.container_depth < u8::MAX { - self.container_depth = self.container_depth + 1; - } self.tree.push(); if let Some(n) = scan_blank_line(&bytes[after_marker_index..]) { self.begin_list_item = Some(after_marker_index + n); @@ -226,9 +221,6 @@ impl<'a, 'b> FirstPass<'a, 'b> { self.last_line_blank = false; } } - if self.container_depth < u8::MAX { - self.container_depth = self.container_depth + 1; - } self.tree.push(); if let Some(n) = scan_blank_line(&bytes[after_marker_index..]) { self.begin_list_item = Some(after_marker_index + n); @@ -246,9 +238,6 @@ impl<'a, 'b> FirstPass<'a, 'b> { end: 0, // will get set later body: ItemBody::BlockQuote(kind), }); - if self.container_depth < u8::MAX { - self.container_depth = self.container_depth + 1; - } self.tree.push(); if kind.is_some() { // blockquote tag leaves us at the end of the line @@ -279,13 +268,20 @@ impl<'a, 'b> FirstPass<'a, 'b> { } else if self.options.contains(Options::ENABLE_CONTAINER_EXTENSIONS) && scan_ch_repeat(&bytes[(start_ix + line_start.bytes_scanned())..], b':') > 2 { - let fence_length = - scan_ch_repeat(&bytes[(start_ix + line_start.bytes_scanned())..], b':'); - - if fence_length > u8::MAX as usize || self.container_depth == u8::MAX { + let fence_length = scan_while_max( + &bytes[(start_ix + line_start.bytes_scanned())..], + |c| c == b':', + u8::MAX as usize, + ); + if fence_length > u8::MAX as usize || self.tree.spine_len() > u8::MAX as usize { break; } else { - let mut kind_start = start_ix + line_start.bytes_scanned() + fence_length; + let excess_colons = scan_while( + &bytes[(start_ix + line_start.bytes_scanned() + fence_length)..], + |c| c == b':', + ); + let mut kind_start = + start_ix + line_start.bytes_scanned() + fence_length + excess_colons; kind_start += scan_whitespace_no_nl(&bytes[kind_start..]); let kind_length = scan_while(&bytes[kind_start..], |c| { is_ascii_alphanumeric(c) || c == b'_' || c == b'-' || c == b':' || c == b'.' @@ -297,7 +293,6 @@ impl<'a, 'b> FirstPass<'a, 'b> { &self.text[kind_start..(kind_start + kind_length)], self.tree.is_in_table(), ); - let mut summary_start = kind_start + kind_length; summary_start += scan_whitespace_no_nl(&bytes[summary_start..]); let line_end = summary_start + scan_nextline(&bytes[summary_start..]); @@ -313,7 +308,6 @@ impl<'a, 'b> FirstPass<'a, 'b> { start: container_start, end: 0, body: ItemBody::Container( - self.container_depth, fence_length as u8, ContainerKind::Spoiler, summary_cow_ix, @@ -325,7 +319,6 @@ impl<'a, 'b> FirstPass<'a, 'b> { start: container_start, end: 0, body: ItemBody::Container( - self.container_depth, fence_length as u8, ContainerKind::Default, kind_cow_ix, @@ -333,9 +326,6 @@ impl<'a, 'b> FirstPass<'a, 'b> { }); } self.tree.push(); - if self.container_depth < u8::MAX { - self.container_depth = self.container_depth + 1; - } return summary_end + 1; } } @@ -349,7 +339,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { let mut pop_count = None; for (i, &node_ix) in self.tree.walk_spine().rev().enumerate() { match self.tree[node_ix].item.body { - ItemBody::Container(_, length, ..) => { + ItemBody::Container(length, ..) => { if line_start.scan_closing_container_extensions_fence(length) { pop_count = Some(i + 1); break; @@ -795,7 +785,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { let mut closes = false; for &node_ix in self.tree.walk_spine().rev().skip(1) { match self.tree[node_ix].item.body { - ItemBody::Container(_, length, ..) => { + ItemBody::Container(length, ..) => { if line_start.scan_closing_container_extensions_fence(length) { closes = true; break; @@ -1632,18 +1622,6 @@ impl<'a, 'b> FirstPass<'a, 'b> { fn pop(&mut self, ix: usize) { let cur_ix = self.tree.pop().unwrap(); self.tree[cur_ix].item.end = ix; - - match self.tree[cur_ix].item.body { - ItemBody::Container(..) - | ItemBody::BlockQuote(..) - | ItemBody::ListItem(..) - | ItemBody::DefinitionListDefinition(..) - | ItemBody::FootnoteDefinition(..) => { - self.container_depth = self.container_depth - 1; - } - _ => {} - } - if let ItemBody::DefinitionList(_) = self.tree[cur_ix].item.body { fixup_end_of_definition_list(&mut self.tree, cur_ix); self.begin_list_item = None; @@ -1872,9 +1850,6 @@ impl<'a, 'b> FirstPass<'a, 'b> { // TODO: check whether the label here is strictly necessary body: ItemBody::FootnoteDefinition(self.allocs.allocate_cow(label)), }); - if self.container_depth < u8::MAX { - self.container_depth = self.container_depth + 1; - } self.tree.push(); Some(i) } diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 0b7554a2..637cde70 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -114,9 +114,9 @@ pub(crate) enum ItemBody { IndentCodeBlock, HtmlBlock, BlockQuote(Option), - Container(u8, u8, ContainerKind, CowIndex), - List(bool, u8, u64), // is_tight, list character, list start index - ListItem(usize), // indent level + Container(u8, ContainerKind, CowIndex), // (fence length, specific renderer, descriptor used in renderer) + List(bool, u8, u64), // is_tight, list character, list start index + ListItem(usize), // indent level FootnoteDefinition(CowIndex), MetadataBlock(MetadataBlockKind), @@ -2296,7 +2296,7 @@ fn body_to_tag_end(body: &ItemBody) -> TagEnd { ItemBody::Image(..) => TagEnd::Image, ItemBody::Heading(level, _) => TagEnd::Heading(level), ItemBody::IndentCodeBlock | ItemBody::FencedCodeBlock(..) => TagEnd::CodeBlock, - ItemBody::Container(_, _, kind, _) => TagEnd::ContainerBlock(kind), + ItemBody::Container(_, kind, _) => TagEnd::ContainerBlock(kind), ItemBody::BlockQuote(kind) => TagEnd::BlockQuote(kind), ItemBody::HtmlBlock => TagEnd::HtmlBlock, ItemBody::List(_, c, _) => { @@ -2377,9 +2377,7 @@ fn item_to_event<'a>(item: Item, text: &'a str, allocs: &mut Allocations<'a>) -> Tag::CodeBlock(CodeBlockKind::Fenced(allocs.take_cow(cow_ix))) } ItemBody::IndentCodeBlock => Tag::CodeBlock(CodeBlockKind::Indented), - ItemBody::Container(_, _, kind, cow_ix) => { - Tag::ContainerBlock(kind, allocs.take_cow(cow_ix)) - } + ItemBody::Container(_, kind, cow_ix) => Tag::ContainerBlock(kind, allocs.take_cow(cow_ix)), ItemBody::BlockQuote(kind) => Tag::BlockQuote(kind), ItemBody::List(_, c, listitem_start) => { if c == b'.' || c == b')' { diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index 8e8d226d..691ce799 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -270,17 +270,10 @@ impl<'a> LineStart<'a> { } pub(crate) fn scan_closing_container_extensions_fence(&mut self, length: u8) -> bool { - let nl_ix = scan_nextline(&self.bytes[self.ix..]); - let eol_length = scan_rev_while(&self.bytes[self.ix..(self.ix + nl_ix)], |c| { - c == b'\n' || c == b'\r' || c == b' ' - }); - let fence_length = - scan_rev_while(&self.bytes[self.ix..(self.ix + nl_ix - eol_length)], |c| { - c == b':' - }); + let fence_length = scan_while_max(&self.bytes[self.ix..], |c| c == b':', u8::MAX as usize); if fence_length >= length as usize { - self.ix = self.ix + (nl_ix - eol_length); + self.ix = self.ix + fence_length; true } else { false @@ -488,6 +481,16 @@ where data.iter().take_while(|&&c| f(c)).count() } +pub(crate) fn scan_while_max(data: &[u8], mut f: F, m: usize) -> usize +where + F: FnMut(u8) -> bool, +{ + data.iter() + .enumerate() + .take_while(|(i, c)| *i < m && f(**c)) + .count() +} + pub(crate) fn scan_rev_while(data: &[u8], mut f: F) -> usize where F: FnMut(u8) -> bool, @@ -525,9 +528,7 @@ pub(crate) fn scan_blank_line(bytes: &[u8]) -> Option { } pub(crate) fn scan_nextline(bytes: &[u8]) -> usize { - memchr(b'\n', bytes).map_or(memchr(b'\r', bytes).map_or(bytes.len(), |x| x + 1), |x| { - x + 1 - }) + memchr(b'\n', bytes).map_or(bytes.len(), |x| x + 1) } // return: end byte for closing code fence, or None diff --git a/pulldown-cmark/tests/html.rs b/pulldown-cmark/tests/html.rs index e8c3bc61..b453d76d 100644 --- a/pulldown-cmark/tests/html.rs +++ b/pulldown-cmark/tests/html.rs @@ -346,6 +346,7 @@ fn issue_819() { // Trailing newline doesn't matter. Just the actual HTML. assert_eq!(expected, s.trim_end_matches('\n')); } + for orig in original { let mut s = String::new(); let mut opts = Options::empty(); diff --git a/pulldown-cmark/tests/suite/container_extensions.rs b/pulldown-cmark/tests/suite/container_extensions.rs index d7bf9ddc..4457352a 100644 --- a/pulldown-cmark/tests/suite/container_extensions.rs +++ b/pulldown-cmark/tests/suite/container_extensions.rs @@ -410,3 +410,45 @@ x

    test_markdown_html(original, expected, false, false, false, false, false, false, true); } + +#[test] +fn container_extensions_test_23() { + let original = r##"::: a +:::: b +::::: c +:::: +x +"##; + let expected = r##"
    +
    +
    +
    +
    +

    x

    +
    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, true); +} + +#[test] +fn container_extensions_test_24() { + let original = r##"::: a +content ::: +"##; + let expected = r##"

    content :::

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, true); +} + +#[test] +fn container_extensions_test_25() { + let original = r##":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: a +content ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +"##; + let expected = r##"

    content :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, true); +} From b3771d683d4f7a5fce6b2028639bc274a3d0e51c Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Mon, 20 Oct 2025 11:19:45 +0100 Subject: [PATCH 160/180] remove unnecessary test --- pulldown-cmark/src/firstpass.rs | 2 +- pulldown-cmark/src/scanners.rs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 0b024d19..f8046fe2 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -273,7 +273,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { |c| c == b':', u8::MAX as usize, ); - if fence_length > u8::MAX as usize || self.tree.spine_len() > u8::MAX as usize { + if self.tree.spine_len() > u8::MAX as usize { break; } else { let excess_colons = scan_while( diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index 691ce799..d83c7299 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -271,7 +271,6 @@ impl<'a> LineStart<'a> { pub(crate) fn scan_closing_container_extensions_fence(&mut self, length: u8) -> bool { let fence_length = scan_while_max(&self.bytes[self.ix..], |c| c == b':', u8::MAX as usize); - if fence_length >= length as usize { self.ix = self.ix + fence_length; true From b209351a5bfaa4a807b19a5b7bf978520863cfff Mon Sep 17 00:00:00 2001 From: jim-taylor-business Date: Tue, 21 Oct 2025 08:52:30 +0100 Subject: [PATCH 161/180] only extract summary when spoiler Co-authored-by: Michael Howell --- pulldown-cmark/src/firstpass.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index f8046fe2..ad7db448 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -298,12 +298,12 @@ impl<'a, 'b> FirstPass<'a, 'b> { let line_end = summary_start + scan_nextline(&bytes[summary_start..]); let summary_end = line_end - scan_rev_while(&bytes[summary_start..line_end], is_ascii_whitespace); - let summary = unescape( - &self.text[summary_start..summary_end], - self.tree.is_in_table(), - ); - let summary_cow_ix = self.allocs.allocate_cow(summary); if kind.eq_ignore_ascii_case("spoiler") { + let summary = unescape( + &self.text[summary_start..summary_end], + self.tree.is_in_table(), + ); + let summary_cow_ix = self.allocs.allocate_cow(summary); self.tree.append(Item { start: container_start, end: 0, From 0825d2633299ba5be0d484b7fd89f721b0183805 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Feb 2026 18:38:49 +0000 Subject: [PATCH 162/180] Bump time from 0.3.37 to 0.3.47 Bumps [time](https://github.com/time-rs/time) from 0.3.37 to 0.3.47. - [Release notes](https://github.com/time-rs/time/releases) - [Changelog](https://github.com/time-rs/time/blob/main/CHANGELOG.md) - [Commits](https://github.com/time-rs/time/compare/v0.3.37...v0.3.47) --- updated-dependencies: - dependency-name: time dependency-version: 0.3.47 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Cargo.lock | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5b055b0f..9f73ad2a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -371,9 +371,9 @@ checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" [[package]] name = "deranged" -version = "0.3.11" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" dependencies = [ "powerfmt", ] @@ -1332,9 +1332,9 @@ dependencies = [ [[package]] name = "num-conv" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050" [[package]] name = "num-integer" @@ -1678,18 +1678,28 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.217" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -1795,9 +1805,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.37" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" dependencies = [ "deranged", "itoa", @@ -1805,22 +1815,22 @@ dependencies = [ "num-conv", "num_threads", "powerfmt", - "serde", + "serde_core", "time-core", "time-macros", ] [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" [[package]] name = "time-macros" -version = "0.2.19" +version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" +checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" dependencies = [ "num-conv", "time-core", From fc8fe713f58d7f4495038b48fe76c1f101fb3af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Pozo?= Date: Mon, 23 Feb 2026 09:04:54 +0100 Subject: [PATCH 163/180] chore: cargo update and bump version of pulldown-cmark --- Cargo.lock | 574 +++++++++++++++++++++----------------- pulldown-cmark/Cargo.toml | 2 +- 2 files changed, 322 insertions(+), 254 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9f73ad2a..731f2f71 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,15 +4,15 @@ version = 3 [[package]] name = "adler2" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "aho-corasick" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" dependencies = [ "memchr", ] @@ -31,9 +31,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.18" +version = "0.6.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" dependencies = [ "anstyle", "anstyle-parse", @@ -46,59 +46,59 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.10" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" [[package]] name = "anstyle-parse" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.2" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.7" +version = "3.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", - "once_cell", - "windows-sys 0.59.0", + "once_cell_polyfill", + "windows-sys 0.61.2", ] [[package]] name = "anyhow" -version = "1.0.95" +version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" [[package]] name = "arbitrary" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" +checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" dependencies = [ "derive_arbitrary", ] [[package]] name = "autocfg" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "bincode" @@ -132,27 +132,21 @@ dependencies = [ [[package]] name = "bitflags" -version = "2.8.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" [[package]] name = "bumpalo" -version = "3.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" - -[[package]] -name = "byteorder" -version = "1.5.0" +version = "3.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" [[package]] name = "calendrical_calculations" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27ca2b6e2f7d75f43e001ded6f25e79b80bded5abbe764cbdf78c25a3051f4b" +checksum = "e97f73e95d668625c9b28a3072e6326773785a0cf807de9f3d632778438f3d38" dependencies = [ "core_maths", "displaydoc", @@ -166,10 +160,11 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.2.13" +version = "1.2.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7777341816418c02e033934a09f20dc0ccaf65a5201ef8a450ae0105a573fda" +checksum = "aebf35691d1bfb0ac386a69bac2fde4dd276fb618cf8bf4f5318fe285e821bb2" dependencies = [ + "find-msvc-tools", "jobserver", "libc", "shlex", @@ -186,9 +181,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "ciborium" @@ -230,9 +225,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.29" +version = "4.5.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acebd8ad879283633b343856142139f2da2317c96b05b4dd6181c61e2480184" +checksum = "2797f34da339ce31042b27d23607e051786132987f595b02ba4f6a6dffb7030a" dependencies = [ "clap_builder", "clap_derive", @@ -240,9 +235,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.29" +version = "4.5.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ba32cbda51c7e1dfd49acc1457ba1a7dec5b64fe360e828acb13ca8dc9c2f9" +checksum = "24a241312cea5059b13574bb9b3861cabf758b879c15190b37b6d6fd63ab6876" dependencies = [ "anstream", "anstyle", @@ -252,9 +247,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.28" +version = "4.5.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" +checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5" dependencies = [ "heck", "proc-macro2", @@ -264,15 +259,15 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.4" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +checksum = "3a822ea5bc7590f9d40f1ba12c0dc3c2760f3482c6984db1573ad11031420831" [[package]] name = "colorchoice" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "colored" @@ -295,9 +290,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" dependencies = [ "cfg-if", ] @@ -365,24 +360,24 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] name = "deranged" -version = "0.5.5" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" dependencies = [ "powerfmt", ] [[package]] name = "derive_arbitrary" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" +checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" dependencies = [ "proc-macro2", "quote", @@ -409,9 +404,9 @@ dependencies = [ [[package]] name = "diplomat-runtime" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29f9efe348e178ba77b6035bc6629138486f8b461654e7ac7ad8afaa61bd4d98" +checksum = "53bfcc833b58615b593a6e5c46771cb36b1cfce94899c60823810939fe8ca9d9" dependencies = [ "log", ] @@ -464,9 +459,9 @@ dependencies = [ [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "encoding_c" @@ -503,26 +498,31 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.10" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] name = "filetime" -version = "0.2.25" +version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +checksum = "f98844151eee8917efc50bd9e8318cb963ae8b297431495d3f758616ea5c57db" dependencies = [ "cfg-if", "libc", "libredox", - "windows-sys 0.59.0", ] +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + [[package]] name = "fixed_decimal" version = "0.5.6" @@ -537,9 +537,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.35" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" dependencies = [ "crc32fast", "miniz_oxide", @@ -547,44 +547,57 @@ dependencies = [ [[package]] name = "foldhash" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "getopts" -version = "0.2.21" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5" +checksum = "cfe4fbac503b8d1f88e6676011885f34b7174f46e59956bba534ba83abded4df" dependencies = [ "unicode-width", ] [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" dependencies = [ "cfg-if", "libc", "wasi", ] +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasip2", +] + [[package]] name = "glob" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" [[package]] name = "half" -version = "2.4.1" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" dependencies = [ "cfg-if", "crunchy", + "zerocopy", ] [[package]] @@ -595,9 +608,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.15.2" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ "allocator-api2", "equivalent", @@ -612,23 +625,17 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.9" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "hermit-abi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] name = "home" -version = "0.5.11" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -650,9 +657,9 @@ dependencies = [ [[package]] name = "icu_calendar_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e009b7f0151ee6fb28c40b1283594397e0b7183820793e9ace3dcd13db126d0" +checksum = "820499e77e852162190608b4f444e7b4552619150eafc39a9e39333d9efae9e1" [[package]] name = "icu_capi" @@ -705,9 +712,9 @@ dependencies = [ [[package]] name = "icu_casemap_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d57966d5ab748f74513be4046867f9a20e801e2775d41f91d04a0f560b61f08" +checksum = "02bd9f6276270c85a5cd54611adbbf94e993ec464a2a86a452a6c565b7ded5d9" [[package]] name = "icu_collator" @@ -730,9 +737,9 @@ dependencies = [ [[package]] name = "icu_collator_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ee3f88741364b7d6269cce6827a3e6a8a2cf408a78f766c9224ab479d5e4ae5" +checksum = "7b353986d77d28991eca4dea5ef2b8982f639342ae19ca81edc44f048bc38ebb" [[package]] name = "icu_collections" @@ -771,9 +778,9 @@ dependencies = [ [[package]] name = "icu_datetime_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ba7e7f7a01269b9afb0a39eff4f8676f693b55f509b3120e43a0350a9f88bea" +checksum = "bef5f04076123cab1b7a926a7083db27fe0d7a0e575adb984854aae3f3a6507d" [[package]] name = "icu_decimal" @@ -791,9 +798,9 @@ dependencies = [ [[package]] name = "icu_decimal_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d424c994071c6f5644f999925fc868c85fec82295326e75ad5017bc94b41523" +checksum = "67c95dd97f5ccf6d837a9c115496ec7d36646fa86ca18e7f1412115b4c820ae2" [[package]] name = "icu_experimental" @@ -827,9 +834,9 @@ dependencies = [ [[package]] name = "icu_experimental_data" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c178b9a34083fca5bd70d61f647575335e9c197d0f30c38e8ccd187babc69d0" +checksum = "121df92eafb8f5286d4e8ff401c1e7db8384377f806db3f8db77b91e5b7bd4dd" [[package]] name = "icu_list" @@ -847,9 +854,9 @@ dependencies = [ [[package]] name = "icu_list_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1825170d2c6679cb20dbd96a589d034e49f698aed9a2ef4fafc9a0101ed298f" +checksum = "52b1a7fbdbf3958f1be8354cb59ac73f165b7b7082d447ff2090355c9a069120" [[package]] name = "icu_locid" @@ -880,9 +887,9 @@ dependencies = [ [[package]] name = "icu_locid_transform_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" +checksum = "7515e6d781098bf9f7205ab3fc7e9709d34554ae0b21ddbcb5febfa4bc7df11d" [[package]] name = "icu_normalizer" @@ -904,9 +911,9 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" +checksum = "c5e8338228bdc8ab83303f16b797e177953730f601a96c25d10cb3ab0daa0cb7" [[package]] name = "icu_pattern" @@ -937,9 +944,9 @@ dependencies = [ [[package]] name = "icu_plurals_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3e8f775b215d45838814a090a2227247a7431d74e9156407d9c37f6ef0f208" +checksum = "a483403238cb7d6a876a77a5f8191780336d80fe7b8b00bfdeb20be6abbfd112" [[package]] name = "icu_properties" @@ -959,9 +966,9 @@ dependencies = [ [[package]] name = "icu_properties_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" +checksum = "85fb8799753b75aee8d2a21d7c14d9f38921b54b3dbda10f5a3c7a7b82dba5e2" [[package]] name = "icu_provider" @@ -1023,9 +1030,9 @@ dependencies = [ [[package]] name = "icu_segmenter_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f739ee737260d955e330bc83fdeaaf1631f7fb7ed218761d3c04bb13bb7d79df" +checksum = "a1e52775179941363cc594e49ce99284d13d6948928d8e72c755f55e98caa1eb" [[package]] name = "icu_timezone" @@ -1044,9 +1051,9 @@ dependencies = [ [[package]] name = "icu_timezone_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c588878c508a3e2ace333b3c50296053e6483c6a7541251b546cc59dcd6ced8e" +checksum = "1adcf7b613a268af025bc2a2532b4b9ee294e6051c5c0832d8bff20ac0232e68" [[package]] name = "indexmap" @@ -1060,20 +1067,20 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.15" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19b23d53f35ce9f56aebc7d1bb4e6ac1e9c0db7ac85c8d1760c04379edced37" +checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" dependencies = [ - "hermit-abi 0.4.0", + "hermit-abi", "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] name = "is_terminal_polyfill" -version = "1.70.1" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "itertools" @@ -1095,24 +1102,25 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] name = "jobserver" -version = "0.1.32" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" dependencies = [ + "getrandom 0.3.4", "libc", ] [[package]] name = "js-sys" -version = "0.3.77" +version = "0.3.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +checksum = "c7e709f3e3d22866f9c25b3aff01af289b18422cc8b4262fb19103ee80fe513d" dependencies = [ "once_cell", "wasm-bindgen", @@ -1132,15 +1140,15 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.169" +version = "0.2.182" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" [[package]] name = "libfuzzer-sys" -version = "0.4.9" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf78f52d400cf2d84a3a973a78a592b4adc535739e0a5597a0da6f0c357adc75" +checksum = "f12a681b7dd8ce12bff52488013ba614b869148d54dd79836ab85aafdd53f08d" dependencies = [ "arbitrary", "cc", @@ -1148,25 +1156,25 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.6" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-link", ] [[package]] name = "libm" -version = "0.2.11" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" [[package]] name = "libredox" -version = "0.1.3" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616" dependencies = [ "bitflags", "libc", @@ -1175,9 +1183,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.21" +version = "1.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df9b68e50e6e0b26f672573834882eb57759f6db9b3be2ea3c35c91188bb4eaa" +checksum = "15d118bbf3771060e7311cc7bb0545b01d08a8b4a7de949198dec1fa0ca1c0f7" dependencies = [ "cc", "libc", @@ -1191,23 +1199,29 @@ version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + [[package]] name = "litemap" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" [[package]] name = "log" -version = "0.4.25" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] name = "matrixmultiply" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9380b911e3e96d10c1f415da0876389aaf1b56759054eeb0de7df940c456ba1a" +checksum = "a06de3016e9fae57a36fd14dba131fccf49f74b40b7fbdb472f96e361ec71a08" dependencies = [ "autocfg", "rawpointer", @@ -1215,9 +1229,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.4" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" [[package]] name = "minimal-lexical" @@ -1227,11 +1241,12 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.4" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3b1c9bd4fe1f0f8b387f6eb9eb3b4a1aa26185e5750efb9140301703f62cd1b" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", + "simd-adler32", ] [[package]] @@ -1294,9 +1309,9 @@ dependencies = [ [[package]] name = "noisy_float" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978fe6e6ebc0bf53de533cd456ca2d9de13de13856eda1518a285d7705a213af" +checksum = "c16843be85dd410c6a12251c4eca0dd1d3ee8c5725f746c4d5e0fdcec0a864b2" dependencies = [ "num-traits", ] @@ -1367,11 +1382,11 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi", "libc", ] @@ -1386,21 +1401,27 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.3" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "oorandom" -version = "11.1.4" +version = "11.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" +checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "plotters" @@ -1438,9 +1459,9 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ "zerocopy", ] @@ -1457,21 +1478,21 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] [[package]] name = "pulldown-cmark" -version = "0.13.0" +version = "0.13.1" dependencies = [ "bincode", "bitflags", "getopts", - "hashbrown 0.15.2", + "hashbrown 0.15.5", "memchr", "pulldown-cmark-escape", "regex", @@ -1517,13 +1538,19 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.38" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + [[package]] name = "rand" version = "0.8.5" @@ -1551,7 +1578,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.17", ] [[package]] @@ -1571,9 +1598,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" dependencies = [ "either", "rayon-core", @@ -1581,9 +1608,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -1591,22 +1618,22 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.8" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +checksum = "35985aa610addc02e24fc232012c86fd11f14111180f902b67e2d5331f8ebf2b" dependencies = [ "bitflags", ] [[package]] name = "regex" -version = "1.11.1" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.9", + "regex-automata 0.4.14", "regex-syntax", ] @@ -1621,9 +1648,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.9" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" dependencies = [ "aho-corasick", "memchr", @@ -1632,9 +1659,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.5" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c" [[package]] name = "rustc-hash" @@ -1651,21 +1678,34 @@ dependencies = [ "bitflags", "errno", "libc", - "linux-raw-sys", + "linux-raw-sys 0.4.15", "windows-sys 0.59.0", ] +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.12.1", + "windows-sys 0.61.2", +] + [[package]] name = "rustversion" -version = "1.0.19" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "ryu" -version = "1.0.19" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" [[package]] name = "same-file" @@ -1708,14 +1748,15 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.138" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" dependencies = [ "itoa", "memchr", - "ryu", "serde", + "serde_core", + "zmij", ] [[package]] @@ -1724,6 +1765,12 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "simd-adler32" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" + [[package]] name = "simple_logger" version = "4.3.3" @@ -1738,15 +1785,15 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.2" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "stable_deref_trait" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "strck" @@ -1772,9 +1819,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.98" +version = "2.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" dependencies = [ "proc-macro2", "quote", @@ -1783,9 +1830,9 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", @@ -1794,9 +1841,9 @@ dependencies = [ [[package]] name = "tar" -version = "0.4.43" +version = "0.4.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c65998313f8e17d0d553d28f91a0df93e4dbbbf770279c7bc21ca0f09ea1a1f6" +checksum = "1d863878d212c87a19c1a610eb53bb01fe12951c0501cf5a0d65f724914a667a" dependencies = [ "filetime", "libc", @@ -1858,9 +1905,9 @@ dependencies = [ [[package]] name = "unicase" -version = "2.8.1" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" [[package]] name = "unicode-bidi" @@ -1870,15 +1917,15 @@ checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] name = "unicode-ident" -version = "1.0.16" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "unicode-width" -version = "0.1.14" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" [[package]] name = "urlencoding" @@ -1922,41 +1969,37 @@ dependencies = [ [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] -name = "wasm-bindgen" -version = "0.2.100" +name = "wasip2" +version = "1.0.2+wasi-0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", + "wit-bindgen", ] [[package]] -name = "wasm-bindgen-backend" -version = "0.2.100" +name = "wasm-bindgen" +version = "0.2.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +checksum = "ec1adf1535672f5b7824f817792b1afd731d7e843d2d04ec8f27e8cb51edd8ac" dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn", + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.100" +version = "0.2.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +checksum = "19e638317c08b21663aed4d2b9a2091450548954695ff4efa75bff5fa546b3b1" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1964,31 +2007,31 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.100" +version = "0.2.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +checksum = "2c64760850114d03d5f65457e96fc988f11f01d38fbaa51b254e4ab5809102af" dependencies = [ + "bumpalo", "proc-macro2", "quote", "syn", - "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.100" +version = "0.2.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +checksum = "60eecd4fe26177cfa3339eb00b4a36445889ba3ad37080c2429879718e20ca41" dependencies = [ "unicode-ident", ] [[package]] name = "web-sys" -version = "0.3.77" +version = "0.3.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +checksum = "9d6bb20ed2d9572df8584f6dc81d68a41a625cadc6f15999d649a70ce7e3597a" dependencies = [ "js-sys", "wasm-bindgen", @@ -2003,18 +2046,24 @@ dependencies = [ "either", "home", "once_cell", - "rustix", + "rustix 0.38.44", ] [[package]] name = "winapi-util" -version = "0.1.9" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + [[package]] name = "windows-sys" version = "0.48.0" @@ -2033,6 +2082,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -2154,6 +2212,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" + [[package]] name = "write16" version = "1.0.0" @@ -2171,13 +2235,12 @@ dependencies = [ [[package]] name = "xattr" -version = "1.4.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" +checksum = "32e45ad4206f6d2479085147f02bc2ef834ac85886624a23575ae137c8aa8156" dependencies = [ "libc", - "linux-raw-sys", - "rustix", + "rustix 1.1.4", ] [[package]] @@ -2212,19 +2275,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.35" +version = "0.8.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +checksum = "db6d35d663eadb6c932438e763b262fe1a70987f9ae936e60158176d710cae4a" dependencies = [ - "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.35" +version = "0.8.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +checksum = "4122cd3169e94605190e77839c9a40d40ed048d305bfdc146e7df40ab0f3e517" dependencies = [ "proc-macro2", "quote", @@ -2233,18 +2295,18 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", @@ -2284,3 +2346,9 @@ dependencies = [ "quote", "syn", ] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/pulldown-cmark/Cargo.toml b/pulldown-cmark/Cargo.toml index bbfb6621..e04f02e1 100644 --- a/pulldown-cmark/Cargo.toml +++ b/pulldown-cmark/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pulldown-cmark" -version = "0.13.0" +version = "0.13.1" authors = [ "Raph Levien ", "Marcus Klaas de Vries ", From 87179037122cc994ed54fb9240ed1c3a969977eb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 18:14:39 +0000 Subject: [PATCH 164/180] Bump tar from 0.4.44 to 0.4.45 Bumps [tar](https://github.com/alexcrichton/tar-rs) from 0.4.44 to 0.4.45. - [Commits](https://github.com/alexcrichton/tar-rs/compare/0.4.44...0.4.45) --- updated-dependencies: - dependency-name: tar dependency-version: 0.4.45 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 731f2f71..3d116ab8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -503,7 +503,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -1073,7 +1073,7 @@ checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -1692,7 +1692,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.12.1", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -1841,9 +1841,9 @@ dependencies = [ [[package]] name = "tar" -version = "0.4.44" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d863878d212c87a19c1a610eb53bb01fe12951c0501cf5a0d65f724914a667a" +checksum = "22692a6476a21fa75fdfc11d452fda482af402c008cdbaf3476414e122040973" dependencies = [ "filetime", "libc", @@ -2055,7 +2055,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.48.0", ] [[package]] From 4d1744ad3b2c5cff23e289c673daf27ddbd3ca10 Mon Sep 17 00:00:00 2001 From: Zoo Sky Date: Fri, 10 Apr 2026 15:24:53 +0200 Subject: [PATCH 165/180] fix: allow punctuation content in superscript when preceded by alphanumeric Allow `^` to open with punctuation content (e.g. `+`, `-`) when preceded by an alphanumeric character or a closing delimiter (`~`, `^`). This enables chemical ion notation like `H^+^`, `Ca^2+^`, and `NH~4~^+^` while preventing false positives like standalone `^+^`. The key change is in `delim_run_can_open`: the `^` + punctuation check now runs before the `ix == 0` early return, so start-of-line `^+^` is correctly rejected. Preceding closing delimiters (`~`, `^`) are also accepted to support cases like `NH~4~^+^` where the superscript follows a subscript expression. --- pulldown-cmark/specs/super_sub.txt | 31 +++++++++++++++++++ pulldown-cmark/src/firstpass.rs | 34 +++++++++++++++++---- pulldown-cmark/tests/suite/super_sub.rs | 40 +++++++++++++++++++++++++ 3 files changed, 100 insertions(+), 5 deletions(-) diff --git a/pulldown-cmark/specs/super_sub.txt b/pulldown-cmark/specs/super_sub.txt index 05ec5817..6da3dd61 100644 --- a/pulldown-cmark/specs/super_sub.txt +++ b/pulldown-cmark/specs/super_sub.txt @@ -82,3 +82,34 @@ Emphasis example included for analogy.

    foo^^bar~

    foo__bar*

    ```````````````````````````````` + +Superscript with punctuation content (chemical ions, math). +When preceded by an alphanumeric character, superscript opens +even if the content is punctuation like `+` or `-`. + +```````````````````````````````` example_super_sub +H^+^ + OH^-^ +. +

    H+ + OH-

    +```````````````````````````````` + +```````````````````````````````` example_super_sub +Ca^2+^ + CO~3~^2-^ +. +

    Ca2+ + CO32-

    +```````````````````````````````` + +```````````````````````````````` example_super_sub +NH~4~^+^ +. +

    NH4+

    +```````````````````````````````` + +Standalone punctuation-only superscript without a preceding +alphanumeric does not open (avoids false positives). + +```````````````````````````````` example_super_sub +^+^ not superscript +. +

    ^+^ not superscript

    +```````````````````````````````` diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index ad7db448..da925c7d 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -2386,6 +2386,26 @@ fn delim_run_can_open( if next_char.is_whitespace() { return false; } + let delim = suffix.bytes().next().unwrap(); + // `^` with punctuation content (e.g. `^+^`) requires a preceding alphanumeric + // or delimiter character (e.g. `H^+^`, `NH~4~^+^`). At start of line (ix == 0) + // there is no preceding character, so `^` cannot open with punctuation content. + // This check must run before the `ix == 0` early return below. + if delim == b'^' && is_punctuation(next_char) { + if ix == 0 { + return false; + } + if options.contains(Options::ENABLE_SUPERSCRIPT) { + let prev_char = s[..ix].chars().last(); + // Allow after alphanumeric (H^+^) or after closing delimiters + // like ~ or ^ (NH~4~^+^, x^2^^+^) + if prev_char.is_some_and(|c| c.is_alphanumeric() || c == '~' || c == '^') { + return true; + } + } + // Punctuation content without qualifying predecessor -- don't open + return false; + } if ix == 0 { return true; } @@ -2397,9 +2417,12 @@ fn delim_run_can_open( return false; } } - let delim = suffix.bytes().next().unwrap(); // `*`, `~~`, and `^` can be intraword, `~` can only be interword if it's subscript, `_` cannot - if (delim == b'*' || delim == b'^') && !is_punctuation(next_char) { + if delim == b'*' && !is_punctuation(next_char) { + return true; + } + // `^` with non-punctuation content can open intraword + if delim == b'^' { return true; } if delim == b'~' && run_len > 1 { @@ -2450,9 +2473,10 @@ fn delim_run_can_close( } let delim = suffix.bytes().next().unwrap(); // `*`, `~~`, and `^` can be intraword, `~` can only be interword if it's subscript, `_` cannot - if (delim == b'*' || delim == b'^' || (delim == b'~' && run_len > 1)) - && !is_punctuation(prev_char) - { + if (delim == b'*' || (delim == b'~' && run_len > 1)) && !is_punctuation(prev_char) { + return true; + } + if delim == b'^' && !is_punctuation(prev_char) { return true; } if delim == b'~' && (prev_char == '~' || options.contains(Options::ENABLE_SUBSCRIPT)) { diff --git a/pulldown-cmark/tests/suite/super_sub.rs b/pulldown-cmark/tests/suite/super_sub.rs index ba59aeda..6edebe2a 100644 --- a/pulldown-cmark/tests/suite/super_sub.rs +++ b/pulldown-cmark/tests/suite/super_sub.rs @@ -111,3 +111,43 @@ fn super_sub_test_10() { test_markdown_html(original, expected, false, false, false, true, false, false, false); } + +#[test] +fn super_sub_test_11() { + let original = r##"H^+^ + OH^-^ +"##; + let expected = r##"

    H+ + OH-

    +"##; + + test_markdown_html(original, expected, false, false, false, true, false, false, false); +} + +#[test] +fn super_sub_test_12() { + let original = r##"Ca^2+^ + CO~3~^2-^ +"##; + let expected = r##"

    Ca2+ + CO32-

    +"##; + + test_markdown_html(original, expected, false, false, false, true, false, false, false); +} + +#[test] +fn super_sub_test_13() { + let original = r##"NH~4~^+^ +"##; + let expected = r##"

    NH4+

    +"##; + + test_markdown_html(original, expected, false, false, false, true, false, false, false); +} + +#[test] +fn super_sub_test_14() { + let original = r##"^+^ not superscript +"##; + let expected = r##"

    ^+^ not superscript

    +"##; + + test_markdown_html(original, expected, false, false, false, true, false, false, false); +} From 43fec9f35aab934b4476b3daaada5eca0dc048df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Apr 2026 23:12:26 +0000 Subject: [PATCH 166/180] Bump rand from 0.8.5 to 0.8.6 Bumps [rand](https://github.com/rust-random/rand) from 0.8.5 to 0.8.6. - [Release notes](https://github.com/rust-random/rand/releases) - [Changelog](https://github.com/rust-random/rand/blob/0.8.6/CHANGELOG.md) - [Commits](https://github.com/rust-random/rand/compare/0.8.5...0.8.6) --- updated-dependencies: - dependency-name: rand dependency-version: 0.8.6 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3d116ab8..a0c9bd69 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -503,7 +503,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -1073,7 +1073,7 @@ checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -1553,9 +1553,9 @@ checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "rand" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" dependencies = [ "libc", "rand_chacha", @@ -1692,7 +1692,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.12.1", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -2055,7 +2055,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.61.2", ] [[package]] From c8960aa3ebf62b48dbc23c7e182230ad6c12595f Mon Sep 17 00:00:00 2001 From: gorgonian <10594600+gorgonian@users.noreply.github.com> Date: Thu, 7 May 2026 15:31:49 -0700 Subject: [PATCH 167/180] feat: add ==highlight== inline extension behind ENABLE_HIGHLIGHT --- README.md | 6 +- .../examples/parser-map-tag-print.rs | 1 + pulldown-cmark/specs/highlight.txt | 166 ++++++++++++ pulldown-cmark/src/firstpass.rs | 32 ++- pulldown-cmark/src/html.rs | 4 + pulldown-cmark/src/lib.rs | 13 + pulldown-cmark/src/main.rs | 4 + pulldown-cmark/src/parse.rs | 27 +- pulldown-cmark/tests/lib.rs | 1 + pulldown-cmark/tests/suite/highlight.rs | 240 ++++++++++++++++++ pulldown-cmark/tests/suite/mod.rs | 1 + 11 files changed, 485 insertions(+), 10 deletions(-) create mode 100644 pulldown-cmark/specs/highlight.txt create mode 100644 pulldown-cmark/tests/suite/highlight.rs diff --git a/README.md b/README.md index d111acde..6052da87 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,10 @@ It is designed to be: Further, it optionally supports parsing footnotes, [Github flavored tables](https://github.github.com/gfm/#tables-extension-), -[Github flavored task lists](https://github.github.com/gfm/#task-list-items-extension-) and -[strikethrough](https://github.github.com/gfm/#strikethrough-extension-). +[Github flavored task lists](https://github.github.com/gfm/#task-list-items-extension-), +[strikethrough](https://github.github.com/gfm/#strikethrough-extension-) and +[highlight](https://github.com/markdown-it/markdown-it-mark) (`==marked==`, +rendered as ``). Rustc 1.71.1 or newer is required to build the crate. diff --git a/pulldown-cmark/examples/parser-map-tag-print.rs b/pulldown-cmark/examples/parser-map-tag-print.rs index c3bbdc9c..cb83c691 100644 --- a/pulldown-cmark/examples/parser-map-tag-print.rs +++ b/pulldown-cmark/examples/parser-map-tag-print.rs @@ -69,6 +69,7 @@ fn main() { Tag::Subscript => println!("Subscript (this is a span tag)"), Tag::Strong => println!("Strong (this is a span tag)"), Tag::Strikethrough => println!("Strikethrough (this is a span tag)"), + Tag::Highlight => println!("Highlight (this is a span tag)"), Tag::BlockQuote(kind) => println!("BlockQuote ({:?})", kind), Tag::CodeBlock(code_block_kind) => { println!("CodeBlock code_block_kind: {:?}", code_block_kind) diff --git a/pulldown-cmark/specs/highlight.txt b/pulldown-cmark/specs/highlight.txt new file mode 100644 index 00000000..1712243d --- /dev/null +++ b/pulldown-cmark/specs/highlight.txt @@ -0,0 +1,166 @@ +Highlighted text uses `==` delimiters, mirroring the markdown-it / pandoc +extension. The pairing rules mirror GFM's `~~` strikethrough. + +# Basic + +```````````````````````````````` example +==hi== +. +

    hi

    +```````````````````````````````` + +```````````````````````````````` example +==hello world== +. +

    hello world

    +```````````````````````````````` + +# Nesting with emphasis + +```````````````````````````````` example +==*hi*== +. +

    hi

    +```````````````````````````````` + +```````````````````````````````` example +*==hi==* +. +

    hi

    +```````````````````````````````` + +```````````````````````````````` example +==**bold** and *em*== +. +

    bold and em

    +```````````````````````````````` + +# Single `=` is literal + +```````````````````````````````` example +=hi= +. +

    =hi=

    +```````````````````````````````` + +```````````````````````````````` example +a = b +. +

    a = b

    +```````````````````````````````` + +# Whitespace adjacent to inner edges fails flanking + +```````````````````````````````` example +== hi == +. +

    == hi ==

    +```````````````````````````````` + +```````````````````````````````` example +==hi == +. +

    ==hi ==

    +```````````````````````````````` + +```````````````````````````````` example +== hi== +. +

    == hi==

    +```````````````````````````````` + +# Triple and quadruple runs do not pair + +```````````````````````````````` example +===hi=== +. +

    ===hi===

    +```````````````````````````````` + +```````````````````````````````` example +====hi==== +. +

    ====hi====

    +```````````````````````````````` + +```````````````````````````````` example +==== +. +

    ====

    +```````````````````````````````` + +# Intraword highlight (mirrors `~~`) + +```````````````````````````````` example +a==b==c +. +

    abc

    +```````````````````````````````` + +```````````````````````````````` example +==This==is==highlighted== +. +

    Thisishighlighted

    +```````````````````````````````` + +# Across a soft line break + +```````````````````````````````` example +==a +b== +. +

    a +b

    +```````````````````````````````` + +# Backslash escapes + +```````````````````````````````` example +==hi \== there== +. +

    hi == there

    +```````````````````````````````` + +```````````````````````````````` example +\==not highlighted== +. +

    ==not highlighted==

    +```````````````````````````````` + +# Inside other block contexts + +```````````````````````````````` example +- ==in a list== +. +
      +
    • in a list
    • +
    +```````````````````````````````` + +```````````````````````````````` example +> ==in a quote== +. +
    +

    in a quote

    +
    +```````````````````````````````` + +```````````````````````````````` example +# ==in a heading== +. +

    in a heading

    +```````````````````````````````` + +# Combined with strikethrough + +```````````````````````````````` example +==~~both~~== +. +

    both

    +```````````````````````````````` + +```````````````````````````````` example +~~==both==~~ +. +

    both

    +```````````````````````````````` diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index da925c7d..03cb3bef 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -1032,7 +1032,7 @@ impl<'a, 'b> FirstPass<'a, 'b> { LoopInstruction::ContinueAndSkip(1) } } - c @ b'*' | c @ b'_' | c @ b'~' | c @ b'^' => { + c @ b'*' | c @ b'_' | c @ b'~' | c @ b'^' | c @ b'=' => { let string_suffix = &self.text[ix..]; let count = 1 + scan_ch_repeat(&string_suffix.as_bytes()[1..], c); let can_open = delim_run_can_open( @@ -1051,7 +1051,11 @@ impl<'a, 'b> FirstPass<'a, 'b> { mode, self.options, ); - let is_valid_seq = (c != b'~' || count <= 2) || (c == b'~' && count == 2); + let is_valid_seq = match c { + b'~' => count <= 2, + b'=' => count == 2, + _ => true, + }; if (can_open || can_close) && is_valid_seq { self.tree.append_text(begin_text, ix, backslash_escaped); @@ -2428,6 +2432,9 @@ fn delim_run_can_open( if delim == b'~' && run_len > 1 { return true; } + if delim == b'=' && run_len == 2 { + return true; + } let prev_char = s[..ix].chars().last().unwrap(); if delim == b'~' && (prev_char == '~' || options.contains(Options::ENABLE_SUBSCRIPT)) @@ -2473,7 +2480,11 @@ fn delim_run_can_close( } let delim = suffix.bytes().next().unwrap(); // `*`, `~~`, and `^` can be intraword, `~` can only be interword if it's subscript, `_` cannot - if (delim == b'*' || (delim == b'~' && run_len > 1)) && !is_punctuation(prev_char) { + if (delim == b'*' + || (delim == b'~' && run_len > 1) + || (delim == b'=' && run_len == 2)) + && !is_punctuation(prev_char) + { return true; } if delim == b'^' && !is_punctuation(prev_char) { @@ -2520,6 +2531,9 @@ fn special_bytes(options: &Options) -> [bool; 256] { if options.contains(Options::ENABLE_SUPERSCRIPT) { bytes[b'^' as usize] = true; } + if options.contains(Options::ENABLE_HIGHLIGHT) { + bytes[b'=' as usize] = true; + } if options.contains(Options::ENABLE_MATH) { bytes[b'$' as usize] = true; bytes[b'{' as usize] = true; @@ -2551,8 +2565,13 @@ struct LookupTable { type LookupTable = [bool; 256]; /// This function walks the byte slices from the given index and -/// calls the callback function on all bytes (and their indices) that are in the following set: -/// `` ` ``, `\`, `&`, `*`, `_`, `~`, `!`, `<`, `[`, `]`, `|`, `\r`, `\n` +/// calls the callback function on all bytes (and their indices) that are in the +/// special-bytes set defined by [`special_bytes`]/[`simd::compute_lookup`]. +/// The always-included bytes are +/// `` ` ``, `\`, `&`, `*`, `_`, `!`, `<`, `[`, `]`, `\r`, `\n`; additional bytes +/// are added when their corresponding option is enabled (e.g. `|` with tables, +/// `~` with strikethrough/subscript, `^` with superscript, `=` with highlight, +/// `$`/`{`/`}` with math, and `.`/`-`/`"`/`'` with smart punctuation). /// It is guaranteed not call the callback on other bytes. /// Whenever `callback(ix, byte)` returns a `ContinueAndSkip(n)` value, the callback /// will not be called with an index that is less than `ix + n + 1`. @@ -2766,6 +2785,9 @@ mod simd { if options.contains(Options::ENABLE_SUPERSCRIPT) { add_lookup_byte(&mut lookup, b'^'); } + if options.contains(Options::ENABLE_HIGHLIGHT) { + add_lookup_byte(&mut lookup, b'='); + } if options.contains(Options::ENABLE_MATH) { add_lookup_byte(&mut lookup, b'$'); add_lookup_byte(&mut lookup, b'{'); diff --git a/pulldown-cmark/src/html.rs b/pulldown-cmark/src/html.rs index 9355bb8b..6960f0b4 100644 --- a/pulldown-cmark/src/html.rs +++ b/pulldown-cmark/src/html.rs @@ -355,6 +355,7 @@ where Tag::Emphasis => self.write(""), Tag::Strong => self.write(""), Tag::Strikethrough => self.write(""), + Tag::Highlight => self.write(""), Tag::Link { link_type: LinkType::Email, dest_url, @@ -496,6 +497,9 @@ where TagEnd::Strikethrough => { self.write("")?; } + TagEnd::Highlight => { + self.write("
    ")?; + } TagEnd::Link => { self.write("")?; } diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index 01ffd1d7..ac52e25d 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -278,6 +278,12 @@ pub enum Tag<'a> { /// ~strike through~ /// ``` Strikethrough, + /// Only parsed and emitted with [`Options::ENABLE_HIGHLIGHT`]. + /// + /// ```markdown + /// ==highlighted== + /// ``` + Highlight, /// Only parsed and emitted with [`Options::ENABLE_SUPERSCRIPT`]. /// /// ```markdown @@ -336,6 +342,7 @@ impl<'a> Tag<'a> { Tag::Emphasis => TagEnd::Emphasis, Tag::Strong => TagEnd::Strong, Tag::Strikethrough => TagEnd::Strikethrough, + Tag::Highlight => TagEnd::Highlight, Tag::Link { .. } => TagEnd::Link, Tag::Image { .. } => TagEnd::Image, Tag::MetadataBlock(kind) => TagEnd::MetadataBlock(*kind), @@ -376,6 +383,7 @@ impl<'a> Tag<'a> { Tag::Emphasis => Tag::Emphasis, Tag::Strong => Tag::Strong, Tag::Strikethrough => Tag::Strikethrough, + Tag::Highlight => Tag::Highlight, Tag::Superscript => Tag::Superscript, Tag::Subscript => Tag::Subscript, Tag::Link { @@ -438,6 +446,7 @@ pub enum TagEnd { Emphasis, Strong, Strikethrough, + Highlight, Superscript, Subscript, @@ -768,6 +777,10 @@ bitflags::bitflags! { const ENABLE_WIKILINKS = 1 << 15; /// Colon-delimited Container Extension Blocks. const ENABLE_CONTAINER_EXTENSIONS = 1 << 16; + /// Allow highlighting text via `==highlight==` syntax, rendered as + /// `highlight`. Originates from markdown-it / pandoc; not part + /// of CommonMark or GFM. + const ENABLE_HIGHLIGHT = 1 << 17; } } diff --git a/pulldown-cmark/src/main.rs b/pulldown-cmark/src/main.rs index 5eb2557f..55743d81 100644 --- a/pulldown-cmark/src/main.rs +++ b/pulldown-cmark/src/main.rs @@ -114,6 +114,7 @@ pub fn main() -> std::io::Result<()> { "enable-container-extensions", "enable container extensions", ); + opts.optflag("", "enable-highlight", "enable highlight"); let matches = match opts.parse(&args[1..]) { Ok(m) => m, @@ -173,6 +174,9 @@ pub fn main() -> std::io::Result<()> { if matches.opt_present("enable-container-extensions") { opts.insert(Options::ENABLE_CONTAINER_EXTENSIONS); } + if matches.opt_present("enable-highlight") { + opts.insert(Options::ENABLE_HIGHLIGHT); + } let mut input = String::new(); let mut broken_links = vec![]; diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 2e9f0458..8dc4f7d9 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -79,6 +79,7 @@ pub(crate) enum ItemBody { Emphasis, Strong, Strikethrough, + Highlight, Superscript, Subscript, Math(CowIndex, bool), // true for display math @@ -165,6 +166,7 @@ impl ItemBody { | Emphasis | Strong | Strikethrough + | Highlight | Math(..) | Code(..) | Link(..) @@ -1070,6 +1072,16 @@ impl<'input> ParserInner<'input> { backslash_escaped: false, } } + } else if c == b'=' { + if inc == 2 + && self.options.contains(Options::ENABLE_HIGHLIGHT) + { + ItemBody::Highlight + } else { + ItemBody::Text { + backslash_escaped: false, + } + } } else if inc == 2 { ItemBody::Strong } else { @@ -1596,7 +1608,7 @@ struct InlineStack { // a strikethrough delimiter will never match with any element // in the stack with index smaller than // `lower_bounds[InlineStack::TILDES]`. - lower_bounds: [usize; 10], + lower_bounds: [usize; 11], } impl InlineStack { @@ -1609,6 +1621,7 @@ impl InlineStack { const TILDES: usize = 5; const UNDERSCORE_BASE: usize = 6; const CIRCUMFLEXES: usize = 9; + const EQUALS: usize = 10; fn pop_all(&mut self, tree: &mut Tree) { for el in self.stack.drain(..) { @@ -1618,7 +1631,7 @@ impl InlineStack { }; } } - self.lower_bounds = [0; 10]; + self.lower_bounds = [0; 11]; } fn get_lowerbound(&self, c: u8, count: usize, both: bool) -> usize { @@ -1644,6 +1657,8 @@ impl InlineStack { } } else if c == b'^' { self.lower_bounds[InlineStack::CIRCUMFLEXES] + } else if c == b'=' { + self.lower_bounds[InlineStack::EQUALS] } else { self.lower_bounds[InlineStack::TILDES] } @@ -1663,6 +1678,8 @@ impl InlineStack { } } else if c == b'^' { self.lower_bounds[InlineStack::CIRCUMFLEXES] = new_bound; + } else if c == b'=' { + self.lower_bounds[InlineStack::EQUALS] = new_bound; } else { self.lower_bounds[InlineStack::TILDES] = new_bound; } @@ -1690,7 +1707,7 @@ impl InlineStack { .cloned() .enumerate() .rfind(|(_, el)| { - if (c == b'~' || c == b'^') && run_length != el.run_length { + if (c == b'~' || c == b'^' || c == b'=') && run_length != el.run_length { return false; } el.c == c @@ -1725,6 +1742,8 @@ impl InlineStack { self.trim_lower_bound(InlineStack::TILDES); } else if el.c == b'^' { self.trim_lower_bound(InlineStack::CIRCUMFLEXES); + } else if el.c == b'=' { + self.trim_lower_bound(InlineStack::EQUALS); } self.stack.push(el) } @@ -2313,6 +2332,7 @@ fn body_to_tag_end(body: &ItemBody) -> TagEnd { ItemBody::Subscript => TagEnd::Subscript, ItemBody::Strong => TagEnd::Strong, ItemBody::Strikethrough => TagEnd::Strikethrough, + ItemBody::Highlight => TagEnd::Highlight, ItemBody::Link(..) => TagEnd::Link, ItemBody::Image(..) => TagEnd::Image, ItemBody::Heading(level, _) => TagEnd::Heading(level), @@ -2361,6 +2381,7 @@ fn item_to_event<'a>(item: Item, text: &'a str, allocs: &mut Allocations<'a>) -> ItemBody::Subscript => Tag::Subscript, ItemBody::Strong => Tag::Strong, ItemBody::Strikethrough => Tag::Strikethrough, + ItemBody::Highlight => Tag::Highlight, ItemBody::Link(link_ix) => { let (link_type, dest_url, title, id) = allocs.take_link(link_ix); Tag::Link { diff --git a/pulldown-cmark/tests/lib.rs b/pulldown-cmark/tests/lib.rs index 28db823b..ca89cd6e 100644 --- a/pulldown-cmark/tests/lib.rs +++ b/pulldown-cmark/tests/lib.rs @@ -23,6 +23,7 @@ pub fn test_markdown_html( opts.insert(Options::ENABLE_MATH); opts.insert(Options::ENABLE_TABLES); opts.insert(Options::ENABLE_STRIKETHROUGH); + opts.insert(Options::ENABLE_HIGHLIGHT); opts.insert(Options::ENABLE_SUPERSCRIPT); if wikilinks { opts.insert(Options::ENABLE_WIKILINKS); diff --git a/pulldown-cmark/tests/suite/highlight.rs b/pulldown-cmark/tests/suite/highlight.rs new file mode 100644 index 00000000..33c49afa --- /dev/null +++ b/pulldown-cmark/tests/suite/highlight.rs @@ -0,0 +1,240 @@ +// This file is auto-generated by the build script +// Please, do not modify it manually + +use super::test_markdown_html; + +#[test] +fn highlight_test_1() { + let original = r##"==hi== +"##; + let expected = r##"

    hi

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn highlight_test_2() { + let original = r##"==hello world== +"##; + let expected = r##"

    hello world

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn highlight_test_3() { + let original = r##"==*hi*== +"##; + let expected = r##"

    hi

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn highlight_test_4() { + let original = r##"*==hi==* +"##; + let expected = r##"

    hi

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn highlight_test_5() { + let original = r##"==**bold** and *em*== +"##; + let expected = r##"

    bold and em

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn highlight_test_6() { + let original = r##"=hi= +"##; + let expected = r##"

    =hi=

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn highlight_test_7() { + let original = r##"a = b +"##; + let expected = r##"

    a = b

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn highlight_test_8() { + let original = r##"== hi == +"##; + let expected = r##"

    == hi ==

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn highlight_test_9() { + let original = r##"==hi == +"##; + let expected = r##"

    ==hi ==

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn highlight_test_10() { + let original = r##"== hi== +"##; + let expected = r##"

    == hi==

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn highlight_test_11() { + let original = r##"===hi=== +"##; + let expected = r##"

    ===hi===

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn highlight_test_12() { + let original = r##"====hi==== +"##; + let expected = r##"

    ====hi====

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn highlight_test_13() { + let original = r##"==== +"##; + let expected = r##"

    ====

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn highlight_test_14() { + let original = r##"a==b==c +"##; + let expected = r##"

    abc

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn highlight_test_15() { + let original = r##"==This==is==highlighted== +"##; + let expected = r##"

    Thisishighlighted

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn highlight_test_16() { + let original = r##"==a +b== +"##; + let expected = r##"

    a +b

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn highlight_test_17() { + let original = r##"==hi \== there== +"##; + let expected = r##"

    hi == there

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn highlight_test_18() { + let original = r##"\==not highlighted== +"##; + let expected = r##"

    ==not highlighted==

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn highlight_test_19() { + let original = r##"- ==in a list== +"##; + let expected = r##"
      +
    • in a list
    • +
    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn highlight_test_20() { + let original = r##"> ==in a quote== +"##; + let expected = r##"
    +

    in a quote

    +
    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn highlight_test_21() { + let original = r##"# ==in a heading== +"##; + let expected = r##"

    in a heading

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn highlight_test_22() { + let original = r##"==~~both~~== +"##; + let expected = r##"

    both

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn highlight_test_23() { + let original = r##"~~==both==~~ +"##; + let expected = r##"

    both

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} diff --git a/pulldown-cmark/tests/suite/mod.rs b/pulldown-cmark/tests/suite/mod.rs index b6f01c44..811fdbf7 100644 --- a/pulldown-cmark/tests/suite/mod.rs +++ b/pulldown-cmark/tests/suite/mod.rs @@ -11,6 +11,7 @@ mod gfm_strikethrough; mod gfm_table; mod gfm_tasklist; mod heading_attrs; +mod highlight; mod math; mod metadata_blocks; mod old_footnotes; From 8e9ee3715da3bdebba312441eb14322a901ef05b Mon Sep 17 00:00:00 2001 From: David Tran Date: Thu, 7 May 2026 15:43:44 -0700 Subject: [PATCH 168/180] Recognize lone CR as a line ending in scan_nextline --- pulldown-cmark/src/scanners.rs | 9 +++++++-- pulldown-cmark/tests/html.rs | 12 ++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index d83c7299..8e3c3914 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -23,7 +23,7 @@ use alloc::{string::String, vec::Vec}; use core::char; -use memchr::memchr; +use memchr::{memchr, memchr2}; pub(crate) use crate::puncttable::{is_ascii_punctuation, is_punctuation}; use crate::{ @@ -527,7 +527,12 @@ pub(crate) fn scan_blank_line(bytes: &[u8]) -> Option { } pub(crate) fn scan_nextline(bytes: &[u8]) -> usize { - memchr(b'\n', bytes).map_or(bytes.len(), |x| x + 1) + // Per CommonMark, a line ending is LF, CRLF, or a lone CR. + match memchr2(b'\n', b'\r', bytes) { + Some(x) if bytes[x] == b'\r' && bytes.get(x + 1) == Some(&b'\n') => x + 2, + Some(x) => x + 1, + None => bytes.len(), + } } // return: end byte for closing code fence, or None diff --git a/pulldown-cmark/tests/html.rs b/pulldown-cmark/tests/html.rs index b453d76d..302f1857 100644 --- a/pulldown-cmark/tests/html.rs +++ b/pulldown-cmark/tests/html.rs @@ -356,3 +356,15 @@ fn issue_819() { assert_eq!(expected, s.trim_end_matches('\n')); } } + +// Can't easily use regression.txt due to newline normalization. +#[test] +fn issue_1056() { + let original = "```\rcode\rblock\r\n```\n"; + let expected = "
    code\rblock\n
    \n"; + + let mut s = String::new(); + html::push_html(&mut s, Parser::new(original)); + + assert_eq!(expected, s); +} From 11aa4b3e1ef2c411320a837f493edf845de27b3d Mon Sep 17 00:00:00 2001 From: el-pendeloco Date: Sat, 9 May 2026 07:33:32 -0400 Subject: [PATCH 169/180] fix: update the lifetime of returned RefDefs to match the input - The previous version erroneously ties the *contents* of the RefDefs to the lifetime of the parser/iterator. --- pulldown-cmark/src/parse.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 2e9f0458..ccef815d 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -321,7 +321,7 @@ impl<'input, CB: ParserCallbacks<'input>> Parser<'input, CB> { /// Returns a reference to the internal `RefDefs` object, which provides access /// to the internal map of reference definitions. - pub fn reference_definitions(&self) -> &RefDefs<'_> { + pub fn reference_definitions(&self) -> &RefDefs<'input> { &self.inner.allocs.refdefs } @@ -2230,7 +2230,7 @@ pub struct OffsetIter<'a, CB> { impl<'a, CB: ParserCallbacks<'a>> OffsetIter<'a, CB> { /// Returns a reference to the internal reference definition tracker. - pub fn reference_definitions(&self) -> &RefDefs<'_> { + pub fn reference_definitions(&self) -> &RefDefs<'a> { self.parser.reference_definitions() } } From 78f78343641f66bdbf5c3b9121ed6a9d7317b57f Mon Sep 17 00:00:00 2001 From: el-pendeloco Date: Tue, 12 May 2026 06:53:09 -0400 Subject: [PATCH 170/180] export LinkDef struct - The RefDef struct is exposed, but not its value type (LinkDef). This prevent user code from storing the link definitions in a different data struct or use it in function arguments, for example (without using unsafe). --- pulldown-cmark/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pulldown-cmark/src/lib.rs b/pulldown-cmark/src/lib.rs index 01ffd1d7..83a74805 100644 --- a/pulldown-cmark/src/lib.rs +++ b/pulldown-cmark/src/lib.rs @@ -114,7 +114,7 @@ use core::fmt::Display; pub use crate::{ parse::{ - BrokenLink, BrokenLinkCallback, DefaultParserCallbacks, OffsetIter, Parser, + BrokenLink, BrokenLinkCallback, DefaultParserCallbacks, LinkDef, OffsetIter, Parser, ParserCallbacks, RefDefs, }, strings::{CowStr, InlineStr}, From 7982eea0aa4bb2fd0d2398edd5e0041700721b20 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Fri, 15 May 2026 21:35:17 -0700 Subject: [PATCH 171/180] Avoid skipping backslash-escaped link ref --- pulldown-cmark/specs/regression.txt | 18 ++++++++++++++++++ pulldown-cmark/src/parse.rs | 16 ++++++++-------- pulldown-cmark/tests/suite/regression.rs | 24 ++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 8 deletions(-) diff --git a/pulldown-cmark/specs/regression.txt b/pulldown-cmark/specs/regression.txt index 855ab646..33e70340 100644 --- a/pulldown-cmark/specs/regression.txt +++ b/pulldown-cmark/specs/regression.txt @@ -2836,3 +2836,21 @@ Link refdef split from paragraph with line with spaces. .

    :

    ```````````````````````````````` + + + +```````````````````````````````` example +[link]\[id] + +[id]: https://en.wikipedia.org +. +

    [link][id]

    +```````````````````````````````` + +```````````````````````````````` example +[id]\[] + +[id]: https://en.wikipedia.org +. +

    id[]

    +```````````````````````````````` diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 2e9f0458..7fdc0e54 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -744,7 +744,7 @@ impl<'input> ParserInner<'input> { // ok, so its not an inline link. maybe it is a reference // to a defined link? let scan_result = - scan_reference(&self.tree, block_text, next, self.options); + scan_reference(&self.tree, block_text, cur_ix, self.options); let (node_after_link, link_type) = match scan_result { // [label][reference] RefScan::LinkLabel(_, end_ix) => { @@ -1792,19 +1792,19 @@ fn scan_link_label<'text>( fn scan_reference<'b>( tree: &Tree, text: &'b str, - cur: Option, + cur_ix: TreeIndex, options: Options, ) -> RefScan<'b> { - let cur_ix = match cur { - None => return RefScan::Failed, - Some(cur_ix) => cur_ix, - }; - let start = tree[cur_ix].item.start; + let start = tree[cur_ix].item.end; let tail = &text.as_bytes()[start..]; if tail.starts_with(b"[]") { + let next_ix = match tree[cur_ix].next { + Some(next_ix) if tree[next_ix].item.start == tree[cur_ix].item.end => next_ix, + _ => return RefScan::Failed, + }; // TODO: this unwrap is sus and should be looked at closer - let closing_node = tree[cur_ix].next.unwrap(); + let closing_node = tree[next_ix].next.unwrap(); RefScan::Collapsed(tree[closing_node].next) } else { let label = scan_link_label(tree, &text[start..], options); diff --git a/pulldown-cmark/tests/suite/regression.rs b/pulldown-cmark/tests/suite/regression.rs index 5a3422ac..b0ffce2a 100644 --- a/pulldown-cmark/tests/suite/regression.rs +++ b/pulldown-cmark/tests/suite/regression.rs @@ -3379,3 +3379,27 @@ fn regression_test_211() { test_markdown_html(original, expected, false, false, false, false, false, false, false); } + +#[test] +fn regression_test_212() { + let original = r##"[link]\[id] + +[id]: https://en.wikipedia.org +"##; + let expected = r##"

    [link][id]

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn regression_test_213() { + let original = r##"[id]\[] + +[id]: https://en.wikipedia.org +"##; + let expected = r##"

    id[]

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} From 3d67feabb529c468e84c0170fdbf3fb3d567874a Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Thu, 21 May 2026 08:44:53 -0700 Subject: [PATCH 172/180] math: do not allow closer followed by digit Same change as https://github.com/jgm/commonmark-hs/pull/168 With this change, closing `$` cannot be followed by a decimal digit. For example, `$1$` is fine, but `$1$2` is not. The rule added here is supposed to be the same as Pandoc's Markdown or with Comrak, and it shouldn't hurt any important cases. --- pulldown-cmark/specs/math.txt | 25 +++++++++++ pulldown-cmark/src/firstpass.rs | 3 +- pulldown-cmark/src/scanners.rs | 4 ++ pulldown-cmark/tests/suite/math.rs | 69 ++++++++++++++++++++---------- 4 files changed, 78 insertions(+), 23 deletions(-) diff --git a/pulldown-cmark/specs/math.txt b/pulldown-cmark/specs/math.txt index b16453b8..b908127c 100644 --- a/pulldown-cmark/specs/math.txt +++ b/pulldown-cmark/specs/math.txt @@ -399,6 +399,31 @@ $}$] $$

    $}$] $$

    ```````````````````````````````` +The inline math closer cannot be immediately followed by a digit. +The opener can be, though. +Display math isn't subject to this rule. + +```````````````````````````````` example +$1$2$3 + +$1$2$3$ + +$1{$2$}3$ + +$$1$$2$$3 + +$$1$$2$$3$$ + +$$1{$$2$$}3$$ +. +

    $1$2$3

    +

    $1$23

    +

    1{$2$}3

    +

    12$$3

    +

    123

    +

    1{$$2$$}3

    +```````````````````````````````` + ## Edge case tests comparison with GitHub Test cases diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index da925c7d..aba872df 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -1077,7 +1077,8 @@ impl<'a, 'b> FirstPass<'a, 'b> { && !bytes[..ix] .last() .copied() - .map_or(true, is_ascii_whitespace); + .map_or(true, is_ascii_whitespace) + && !bytes.get(ix + 1).copied().map_or(false, is_ascii_numeric); // 0xFFFF_FFFF... represents the root brace context. Using None would require // storing Option, which is bigger than u8. diff --git a/pulldown-cmark/src/scanners.rs b/pulldown-cmark/src/scanners.rs index d83c7299..65a77631 100644 --- a/pulldown-cmark/src/scanners.rs +++ b/pulldown-cmark/src/scanners.rs @@ -449,6 +449,10 @@ pub(crate) fn is_ascii_alphanumeric(c: u8) -> bool { matches!(c, b'0'..=b'9' | b'a'..=b'z' | b'A'..=b'Z') } +pub(crate) fn is_ascii_numeric(c: u8) -> bool { + matches!(c, b'0'..=b'9') +} + fn is_ascii_letterdigitdash(c: u8) -> bool { c == b'-' || is_ascii_alphanumeric(c) } diff --git a/pulldown-cmark/tests/suite/math.rs b/pulldown-cmark/tests/suite/math.rs index c774c58b..8aa5bedf 100644 --- a/pulldown-cmark/tests/suite/math.rs +++ b/pulldown-cmark/tests/suite/math.rs @@ -439,6 +439,31 @@ $}$] $$ #[test] fn math_test_25() { + let original = r##"$1$2$3 + +$1$2$3$ + +$1{$2$}3$ + +$$1$$2$$3 + +$$1$$2$$3$$ + +$$1{$$2$$}3$$ +"##; + let expected = r##"

    $1$2$3

    +

    $1$23

    +

    1{$2$}3

    +

    12$$3

    +

    123

    +

    1{$$2$$}3

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} + +#[test] +fn math_test_26() { let original = r##"$x$ $`y`$ "##; let expected = r##"

    x `y`

    @@ -448,7 +473,7 @@ fn math_test_25() { } #[test] -fn math_test_26() { +fn math_test_27() { let original = r##"- $a$ ```math @@ -490,7 +515,7 @@ b } #[test] -fn math_test_27() { +fn math_test_28() { let original = r##"- ![node logo](https://nodejs.org/static/images/logo.svg) - $x$ "##; @@ -504,7 +529,7 @@ fn math_test_27() { } #[test] -fn math_test_28() { +fn math_test_29() { let original = r##"
    $A = 5$ @@ -527,7 +552,7 @@ A = 5 } #[test] -fn math_test_29() { +fn math_test_30() { let original = r##"$a @@ -567,7 +592,7 @@ fn math_test_31() { } #[test] -fn math_test_32() { +fn math_test_33() { let original = r##"a$x$ -$x$ @@ -583,7 +608,7 @@ fn math_test_32() { } #[test] -fn math_test_33() { +fn math_test_34() { let original = r##"_$a$ equals $b$_ _$a$ equals $b$_ @@ -599,7 +624,7 @@ _$a$ equals $b$_ } #[test] -fn math_test_34() { +fn math_test_35() { let original = r##"$$ a $$ @@ -622,7 +647,7 @@ a } #[test] -fn math_test_35() { +fn math_test_36() { let original = r##"$\{a\,b\}$ "##; let expected = r##"

    \{a\,b\}

    @@ -632,7 +657,7 @@ fn math_test_35() { } #[test] -fn math_test_36() { +fn math_test_37() { let original = r##"$a c$ $[(a+b)c](d+e)$ @@ -648,7 +673,7 @@ ${a}_b c_{d}$ } #[test] -fn math_test_37() { +fn math_test_38() { let original = r##"When $a \ne 0$, there are two solutions to $(ax^2 + bx + c = 0)$ and they are $$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$ "##; @@ -660,7 +685,7 @@ $$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$ } #[test] -fn math_test_38() { +fn math_test_39() { let original = r##"$x = \$$ "##; let expected = r##"

    x = \$

    @@ -670,7 +695,7 @@ fn math_test_38() { } #[test] -fn math_test_39() { +fn math_test_40() { let original = r##"_Equation $\Omega(69)$ in italic text_ "##; let expected = r##"

    Equation \Omega(69) in italic text

    @@ -680,7 +705,7 @@ fn math_test_39() { } #[test] -fn math_test_40() { +fn math_test_41() { let original = r##"$\pi$ '$\pi$ "$\pi$ @@ -704,7 +729,7 @@ fn math_test_40() { } #[test] -fn math_test_41() { +fn math_test_42() { let original = r##"| first $|$ second | |--------|---------| | a ${ | }$ b | @@ -720,7 +745,7 @@ fn math_test_41() { } #[test] -fn math_test_42() { +fn math_test_43() { let original = r##"| first $\|$ second | |-------------------| | a ${ \| }$ b | @@ -736,7 +761,7 @@ fn math_test_42() { } #[test] -fn math_test_43() { +fn math_test_44() { let original = r##"| Description | Test case | |-------------|-----------| | Single | $\$ | @@ -774,7 +799,7 @@ fn math_test_43() { } #[test] -fn math_test_44() { +fn math_test_45() { let original = r##"This is not an inline math environment: $}{$ But, because it's nested too deeply, this is parsed as an inline math environment: {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{ @@ -794,7 +819,7 @@ But this still isn't, because the braces are still counted: $}{$

    } #[test] -fn math_test_45() { +fn math_test_46() { let original = r##"This is also deeply nested, but, unlike the first example, they don't have an equal number of close braces and open braces, so aren't detected as math. @@ -823,7 +848,7 @@ another improperly nested example } #[test] -fn math_test_46() { +fn math_test_47() { let original = r##"${}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 20 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 40 brace pairs {}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 60 brace pairs @@ -857,7 +882,7 @@ fn math_test_46() { } #[test] -fn math_test_47() { +fn math_test_48() { let original = r##"${{{{{{{{{{{{{{{{{{{{ 20 open braces {{{{{{{{{{{{{{{{{{{{ 40 open braces {{{{{{{{{{{{{{{{{{{{ 60 open braces From b52c787ba916f47e9f9ba0701fb195e9a7a949aa Mon Sep 17 00:00:00 2001 From: gorgonian <10594600+gorgonian@users.noreply.github.com> Date: Fri, 22 May 2026 11:55:30 -0700 Subject: [PATCH 173/180] fix(formatting): run cargo fmt --- pulldown-cmark/src/firstpass.rs | 4 +--- pulldown-cmark/src/parse.rs | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/pulldown-cmark/src/firstpass.rs b/pulldown-cmark/src/firstpass.rs index 03cb3bef..5e9cf0d1 100644 --- a/pulldown-cmark/src/firstpass.rs +++ b/pulldown-cmark/src/firstpass.rs @@ -2480,9 +2480,7 @@ fn delim_run_can_close( } let delim = suffix.bytes().next().unwrap(); // `*`, `~~`, and `^` can be intraword, `~` can only be interword if it's subscript, `_` cannot - if (delim == b'*' - || (delim == b'~' && run_len > 1) - || (delim == b'=' && run_len == 2)) + if (delim == b'*' || (delim == b'~' && run_len > 1) || (delim == b'=' && run_len == 2)) && !is_punctuation(prev_char) { return true; diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 8dc4f7d9..91df2d2e 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -1073,8 +1073,7 @@ impl<'input> ParserInner<'input> { } } } else if c == b'=' { - if inc == 2 - && self.options.contains(Options::ENABLE_HIGHLIGHT) + if inc == 2 && self.options.contains(Options::ENABLE_HIGHLIGHT) { ItemBody::Highlight } else { From 6aa902d06d3cd88709a814e71f81c359f3d9d9df Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Sun, 24 May 2026 14:47:16 -0700 Subject: [PATCH 174/180] Require separation between title quotes and URL --- pulldown-cmark/specs/regression.txt | 25 ++++++++++++++++++++++++ pulldown-cmark/src/parse.rs | 7 ++++++- pulldown-cmark/tests/suite/regression.rs | 25 ++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/pulldown-cmark/specs/regression.txt b/pulldown-cmark/specs/regression.txt index 855ab646..5d397e1d 100644 --- a/pulldown-cmark/specs/regression.txt +++ b/pulldown-cmark/specs/regression.txt @@ -2836,3 +2836,28 @@ Link refdef split from paragraph with line with spaces. .

    :

    ```````````````````````````````` + +https://github.com/pulldown-cmark/pulldown-cmark/issues/1099 + +Link must be separated from title by at least one space + +```````````````````````````````` example +[a](https://example.com"test") +[a]("test") +[a](https://example.com(test)) +[a]((test)) + +[a](https://example.com "test") +[a]( "test") +[a](https://example.com (test)) +[a]( (test)) +. +

    a +[a](https://example.com"test") +a +[a](https://example.com(test))

    +

    a +a +a +a

    +```````````````````````````````` diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 2e9f0458..9b672c0a 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -1189,6 +1189,7 @@ impl<'input> ParserInner<'input> { ix += 1; let scan_separator = |ix: &mut usize| { + let start = *ix; *ix += scan_while(&underlying.as_bytes()[*ix..], is_ascii_whitespace_no_nl); if let Some(bl) = scan_eol(&underlying.as_bytes()[*ix..]) { *ix += bl; @@ -1199,6 +1200,7 @@ impl<'input> ParserInner<'input> { ); } *ix += scan_while(&underlying.as_bytes()[*ix..], is_ascii_whitespace_no_nl); + *ix - start }; scan_separator(&mut ix); @@ -1207,9 +1209,12 @@ impl<'input> ParserInner<'input> { let dest = unescape(dest, self.tree.is_in_table()); ix += dest_length; - scan_separator(&mut ix); + let title_sep = scan_separator(&mut ix); let title = if let Some((bytes_scanned, t)) = self.scan_link_title(underlying, ix, node) { + if title_sep == 0 { + return None; + } ix += bytes_scanned; scan_separator(&mut ix); t diff --git a/pulldown-cmark/tests/suite/regression.rs b/pulldown-cmark/tests/suite/regression.rs index 5a3422ac..a91b9eac 100644 --- a/pulldown-cmark/tests/suite/regression.rs +++ b/pulldown-cmark/tests/suite/regression.rs @@ -3379,3 +3379,28 @@ fn regression_test_211() { test_markdown_html(original, expected, false, false, false, false, false, false, false); } + +#[test] +fn regression_test_212() { + let original = r##"[a](https://example.com"test") +[a]("test") +[a](https://example.com(test)) +[a]((test)) + +[a](https://example.com "test") +[a]( "test") +[a](https://example.com (test)) +[a]( (test)) +"##; + let expected = r##"

    a +[a](https://example.com"test") +a +[a](https://example.com(test))

    +

    a +a +a +a

    +"##; + + test_markdown_html(original, expected, false, false, false, false, false, false, false); +} From 967d260d4c309eca8b7ad1242e0295da5897fb32 Mon Sep 17 00:00:00 2001 From: Wes Chow Date: Tue, 26 May 2026 09:44:38 -0400 Subject: [PATCH 175/180] Fix: wikilink with pipe separator leaks child node's next chain into sibling content --- pulldown-cmark/src/parse.rs | 83 +++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 9e7af723..85d7cc49 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -958,6 +958,29 @@ impl<'input> ParserInner<'input> { // break node so passes can actually format // the display text self.tree[body_node].item.start = rest; + + // Terminate the child chain so it does not extend + // past the closing `]]` into sibling content. + let mut scan = body_node; + loop { + if scan == cur_ix { + // body_node is the closing delimiter node + // (empty display text after `|`); cut here. + self.tree[scan].next = None; + break; + } + match self.tree[scan].next { + Some(n) if n == cur_ix => { + // scan is the last display-text node; + // cut before cur_ix. + self.tree[scan].next = None; + break; + } + Some(n) => scan = n, + None => break, + } + } + Some((true, body_node, wikitext)) } else { None @@ -2957,4 +2980,64 @@ text ]; assert_eq!(&events, &expected); } + + #[test] + fn wikilink_no_event_blowup() { + // Regression: handle_wikilink reused an existing tree node as + // the wikilink's child without terminating that node's `next` + // chain. The `next` chain threaded through the closing `]]` + // into the content after the wikilink, so the EventIter + // visited that tail content both as children (via child ptr) + // and as siblings (via next ptr). Adversarial repeated + // `[[|]]` patterns compounded exponentially. + let one = "[[[[^(\n|]]]]=]]]]]]]]\n".repeat(1); + let eight = "[[[[^(\n|]]]]=]]]]]]]]\n".repeat(8); + + let n1 = Parser::new_ext(&one, Options::ENABLE_WIKILINKS).count(); + let n8 = Parser::new_ext(&eight, Options::ENABLE_WIKILINKS).count(); + + assert!( + n8 <= n1 * 20, + "Event count should scale linearly with input length; \ + got {n1} events for 1× and {n8} events for 8× ({}× ratio, expected ≤20×)", + n8 / n1.max(1) + ); + } + + #[test] + fn wikilink_pipe_no_duplicate_siblings() { + // `[[[[name|]]]]` + // The outer `[[` become Text; the inner `[[` form a wikilink. + // After the wikilink the remaining `]]` must appear exactly + // once as siblings. + let input = "[[[[^(\n|]]]]"; + let events: Vec<_> = Parser::new_ext(input, Options::ENABLE_WIKILINKS) + .into_offset_iter() + .collect(); + + // Collect non-structural events (excluding Start/End wrappers + // whose ranges legitimately repeat). Each Text event's byte + // range must appear at most once. + let text_ranges: Vec<_> = events + .iter() + .filter_map(|(e, r)| matches!(e, Event::Text(_)).then_some(r.clone())) + .collect(); + + let mut seen = std::collections::HashMap::new(); + for r in &text_ranges { + *seen.entry(r.clone()).or_insert(0usize) += 1; + } + let dups: Vec<_> = seen.iter().filter(|(_, &c)| c > 1).collect(); + assert!( + dups.is_empty(), + "Text events for byte ranges {:?} were emitted more than once.\n\ + Full event list:\n{}", + dups.iter().map(|(r, _)| r).collect::>(), + events + .iter() + .map(|(e, r)| format!(" {r:6?} {e:?}")) + .collect::>() + .join("\n") + ); + } } From 85758ac238abe05d5468ee2dcc3e0b7f899aae84 Mon Sep 17 00:00:00 2001 From: Wes Chow Date: Tue, 26 May 2026 15:41:40 -0400 Subject: [PATCH 176/180] Use hashbrown for wikilink test. --- pulldown-cmark/src/parse.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 85d7cc49..7cf4fadb 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -3023,7 +3023,7 @@ text .filter_map(|(e, r)| matches!(e, Event::Text(_)).then_some(r.clone())) .collect(); - let mut seen = std::collections::HashMap::new(); + let mut seen = HashMap::new(); for r in &text_ranges { *seen.entry(r.clone()).or_insert(0usize) += 1; } From 18f5389b564a79d98b72b36b85cce2612bd49bf7 Mon Sep 17 00:00:00 2001 From: Wes Chow Date: Tue, 26 May 2026 15:57:09 -0400 Subject: [PATCH 177/180] Move wikilink_pipe_no_duplicate_siblings test to wikilinks.txt. --- pulldown-cmark/specs/wikilinks.txt | 9 ++++++ pulldown-cmark/src/parse.rs | 37 ------------------------- pulldown-cmark/tests/suite/wikilinks.rs | 20 +++++++++---- 3 files changed, 24 insertions(+), 42 deletions(-) diff --git a/pulldown-cmark/specs/wikilinks.txt b/pulldown-cmark/specs/wikilinks.txt index 210e431c..d5f07da0 100644 --- a/pulldown-cmark/specs/wikilinks.txt +++ b/pulldown-cmark/specs/wikilinks.txt @@ -146,6 +146,15 @@ Wikilinks cannot be empty. They will render as-is.

    ]] [[]] [[|]] [[|Symbol]] [[

    ```````````````````````````````` +When a wikilink with a pipe separator is nested inside extra brackets, the +trailing `]]` after the wikilink must appear exactly once. + +```````````````````````````````` example_wikilinks +[[[[link|]]]] +. +

    [[]]]

    +```````````````````````````````` + Other interactions wikilinks have with other Markdown syntax: ```````````````````````````````` example_wikilinks diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 7cf4fadb..b50e5deb 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -3003,41 +3003,4 @@ text n8 / n1.max(1) ); } - - #[test] - fn wikilink_pipe_no_duplicate_siblings() { - // `[[[[name|]]]]` - // The outer `[[` become Text; the inner `[[` form a wikilink. - // After the wikilink the remaining `]]` must appear exactly - // once as siblings. - let input = "[[[[^(\n|]]]]"; - let events: Vec<_> = Parser::new_ext(input, Options::ENABLE_WIKILINKS) - .into_offset_iter() - .collect(); - - // Collect non-structural events (excluding Start/End wrappers - // whose ranges legitimately repeat). Each Text event's byte - // range must appear at most once. - let text_ranges: Vec<_> = events - .iter() - .filter_map(|(e, r)| matches!(e, Event::Text(_)).then_some(r.clone())) - .collect(); - - let mut seen = HashMap::new(); - for r in &text_ranges { - *seen.entry(r.clone()).or_insert(0usize) += 1; - } - let dups: Vec<_> = seen.iter().filter(|(_, &c)| c > 1).collect(); - assert!( - dups.is_empty(), - "Text events for byte ranges {:?} were emitted more than once.\n\ - Full event list:\n{}", - dups.iter().map(|(r, _)| r).collect::>(), - events - .iter() - .map(|(e, r)| format!(" {r:6?} {e:?}")) - .collect::>() - .join("\n") - ); - } } diff --git a/pulldown-cmark/tests/suite/wikilinks.rs b/pulldown-cmark/tests/suite/wikilinks.rs index cf9d0574..c1c959fd 100644 --- a/pulldown-cmark/tests/suite/wikilinks.rs +++ b/pulldown-cmark/tests/suite/wikilinks.rs @@ -177,6 +177,16 @@ fn wikilinks_test_15() { #[test] fn wikilinks_test_16() { + let original = r##"[[[[link|]]]] +"##; + let expected = r##"

    [[]]]

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true, false, false); +} + +#[test] +fn wikilinks_test_17() { let original = r##"[inline link]([[url]]) "##; let expected = r##"

    inline link

    @@ -186,7 +196,7 @@ fn wikilinks_test_16() { } #[test] -fn wikilinks_test_17() { +fn wikilinks_test_18() { let original = r##"[inline link]([[url)]] "##; let expected = r##"

    inline link]]

    @@ -196,7 +206,7 @@ fn wikilinks_test_17() { } #[test] -fn wikilinks_test_18() { +fn wikilinks_test_19() { let original = r##"`[[code]]` "##; let expected = r##"

    [[code]]

    @@ -206,7 +216,7 @@ fn wikilinks_test_18() { } #[test] -fn wikilinks_test_19() { +fn wikilinks_test_20() { let original = r##"emphasis **cross [[over** here]] "##; let expected = r##"

    emphasis **cross over** here

    @@ -216,7 +226,7 @@ fn wikilinks_test_19() { } #[test] -fn wikilinks_test_20() { +fn wikilinks_test_21() { let original = r##"[[first\|second]] "##; let expected = r##"

    second

    @@ -226,7 +236,7 @@ fn wikilinks_test_20() { } #[test] -fn wikilinks_test_21() { +fn wikilinks_test_22() { let original = r##"[[first!second]] "##; let expected = r##"

    first&#33;second

    From e978fd03b575b0d2ef04fa16fa668e7f684772a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 29 May 2026 21:34:10 +0000 Subject: [PATCH 178/180] Bump tar from 0.4.45 to 0.4.46 Bumps [tar](https://github.com/composefs/tar-rs) from 0.4.45 to 0.4.46. - [Release notes](https://github.com/composefs/tar-rs/releases) - [Commits](https://github.com/composefs/tar-rs/compare/0.4.45...0.4.46) --- updated-dependencies: - dependency-name: tar dependency-version: 0.4.46 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a0c9bd69..a6213bc5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -503,7 +503,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -1073,7 +1073,7 @@ checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -1692,7 +1692,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.12.1", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -1841,9 +1841,9 @@ dependencies = [ [[package]] name = "tar" -version = "0.4.45" +version = "0.4.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22692a6476a21fa75fdfc11d452fda482af402c008cdbaf3476414e122040973" +checksum = "3f6221d9a6003c78398e3b239969f352578258df48c8eb051caadae0015bc840" dependencies = [ "filetime", "libc", @@ -2055,7 +2055,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.48.0", ] [[package]] From 65e5fd6c2e072fbc7d50c6935dd0d0685b159127 Mon Sep 17 00:00:00 2001 From: Wes Chow Date: Tue, 2 Jun 2026 09:55:19 -0400 Subject: [PATCH 179/180] Guard against wikilinks that have empty display parts. --- pulldown-cmark/specs/wikilinks.txt | 12 ++++- pulldown-cmark/src/parse.rs | 65 ++++++++++++++----------- pulldown-cmark/tests/suite/wikilinks.rs | 24 ++++++--- 3 files changed, 64 insertions(+), 37 deletions(-) diff --git a/pulldown-cmark/specs/wikilinks.txt b/pulldown-cmark/specs/wikilinks.txt index d5f07da0..0404346d 100644 --- a/pulldown-cmark/specs/wikilinks.txt +++ b/pulldown-cmark/specs/wikilinks.txt @@ -146,13 +146,21 @@ Wikilinks cannot be empty. They will render as-is.

    ]] [[]] [[|]] [[|Symbol]] [[

    ```````````````````````````````` +If the display text is empty then we omit it from the output anchor. + +```````````````````````````````` example_wikilinks +[[link|]] +. +

    +```````````````````````````````` + When a wikilink with a pipe separator is nested inside extra brackets, the trailing `]]` after the wikilink must appear exactly once. ```````````````````````````````` example_wikilinks -[[[[link|]]]] +[[[[link|display]]]] . -

    [[]]]

    +

    [[display]]

    ```````````````````````````````` Other interactions wikilinks have with other Markdown syntax: diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index b50e5deb..391717a2 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -953,37 +953,46 @@ impl<'input> ParserInner<'input> { return None; } // [[WikiName|rest]] - let body_node = scan_nodes_to_ix(&self.tree, Some(body_node), rest); - if let Some(body_node) = body_node { - // break node so passes can actually format - // the display text - self.tree[body_node].item.start = rest; - - // Terminate the child chain so it does not extend - // past the closing `]]` into sibling content. - let mut scan = body_node; - loop { - if scan == cur_ix { - // body_node is the closing delimiter node - // (empty display text after `|`); cut here. - self.tree[scan].next = None; - break; - } - match self.tree[scan].next { - Some(n) if n == cur_ix => { - // scan is the last display-text node; - // cut before cur_ix. - self.tree[scan].next = None; - break; + if rest >= end_ix { + // Empty display text: the `|` is immediately followed + // by `]]`. Create a zero-length synthetic node so the + // anchor has no content, rather than accidentally + // capturing the closing `]` delimiter. + let body_node = self.tree.create_node(Item { + start: rest, + end: rest, + body: ItemBody::Text { + backslash_escaped: false, + }, + }); + Some((true, body_node, wikitext)) + } else { + let body_node = scan_nodes_to_ix(&self.tree, Some(body_node), rest); + if let Some(body_node) = body_node { + // break node so passes can actually format + // the display text + self.tree[body_node].item.start = rest; + + // Terminate the child chain so it does not extend + // past the closing `]]` into sibling content. + let mut scan = body_node; + loop { + match self.tree[scan].next { + Some(n) if n == cur_ix => { + // scan is the last display-text node; + // cut before cur_ix. + self.tree[scan].next = None; + break; + } + Some(n) => scan = n, + None => break, } - Some(n) => scan = n, - None => break, } - } - Some((true, body_node, wikitext)) - } else { - None + Some((true, body_node, wikitext)) + } else { + None + } } } None => { diff --git a/pulldown-cmark/tests/suite/wikilinks.rs b/pulldown-cmark/tests/suite/wikilinks.rs index c1c959fd..1dcbbc11 100644 --- a/pulldown-cmark/tests/suite/wikilinks.rs +++ b/pulldown-cmark/tests/suite/wikilinks.rs @@ -177,9 +177,9 @@ fn wikilinks_test_15() { #[test] fn wikilinks_test_16() { - let original = r##"[[[[link|]]]] + let original = r##"[[link|]] "##; - let expected = r##"

    [[]]]

    + let expected = r##"

    "##; test_markdown_html(original, expected, false, false, false, false, true, false, false); @@ -187,6 +187,16 @@ fn wikilinks_test_16() { #[test] fn wikilinks_test_17() { + let original = r##"[[[[link|display]]]] +"##; + let expected = r##"

    [[display]]

    +"##; + + test_markdown_html(original, expected, false, false, false, false, true, false, false); +} + +#[test] +fn wikilinks_test_18() { let original = r##"[inline link]([[url]]) "##; let expected = r##"

    inline link

    @@ -196,7 +206,7 @@ fn wikilinks_test_17() { } #[test] -fn wikilinks_test_18() { +fn wikilinks_test_19() { let original = r##"[inline link]([[url)]] "##; let expected = r##"

    inline link]]

    @@ -206,7 +216,7 @@ fn wikilinks_test_18() { } #[test] -fn wikilinks_test_19() { +fn wikilinks_test_20() { let original = r##"`[[code]]` "##; let expected = r##"

    [[code]]

    @@ -216,7 +226,7 @@ fn wikilinks_test_19() { } #[test] -fn wikilinks_test_20() { +fn wikilinks_test_21() { let original = r##"emphasis **cross [[over** here]] "##; let expected = r##"

    emphasis **cross over** here

    @@ -226,7 +236,7 @@ fn wikilinks_test_20() { } #[test] -fn wikilinks_test_21() { +fn wikilinks_test_22() { let original = r##"[[first\|second]] "##; let expected = r##"

    second

    @@ -236,7 +246,7 @@ fn wikilinks_test_21() { } #[test] -fn wikilinks_test_22() { +fn wikilinks_test_23() { let original = r##"[[first!second]] "##; let expected = r##"

    first&#33;second

    From 30ea58093e279da5475d7b84fce3b3e70b9f8a4d Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Tue, 2 Jun 2026 21:50:15 -0700 Subject: [PATCH 180/180] Clean up unneeded extra code I was confused about this for awhile, and didn't get why that loop was needed. It turns out, it's needed because the prev link wasn't set up right. With the prev link set up right, it can be left out. --- pulldown-cmark/src/parse.rs | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/pulldown-cmark/src/parse.rs b/pulldown-cmark/src/parse.rs index 391717a2..1347d7a7 100644 --- a/pulldown-cmark/src/parse.rs +++ b/pulldown-cmark/src/parse.rs @@ -695,6 +695,7 @@ impl<'input> ParserInner<'input> { .unwrap_or(false) { if let Some(node) = self.handle_wikilink(block_text, cur_ix, prev) { + prev = Some(node); cur = self.tree[node].next; continue; } @@ -973,22 +974,6 @@ impl<'input> ParserInner<'input> { // the display text self.tree[body_node].item.start = rest; - // Terminate the child chain so it does not extend - // past the closing `]]` into sibling content. - let mut scan = body_node; - loop { - match self.tree[scan].next { - Some(n) if n == cur_ix => { - // scan is the last display-text node; - // cut before cur_ix. - self.tree[scan].next = None; - break; - } - Some(n) => scan = n, - None => break, - } - } - Some((true, body_node, wikitext)) } else { None