fixup! block attributes

This commit is contained in:
Noah Hellman 2023-01-12 17:28:21 +01:00
parent c0183d4524
commit 666e9cfd40
2 changed files with 5 additions and 8 deletions

View file

@ -710,7 +710,7 @@ mod test {
} }
#[test] #[test]
fn typeset_basic() { fn container_basic() {
test_parse!( test_parse!(
"_abc_", "_abc_",
(Enter(Emphasis), "_"), (Enter(Emphasis), "_"),
@ -726,7 +726,7 @@ mod test {
} }
#[test] #[test]
fn typeset_nest() { fn container_nest() {
test_parse!( test_parse!(
"{_{_abc_}_}", "{_{_abc_}_}",
(Enter(Emphasis), "{_"), (Enter(Emphasis), "{_"),
@ -746,12 +746,12 @@ mod test {
} }
#[test] #[test]
fn typeset_unopened() { fn container_unopened() {
test_parse!("*}abc", (Str, "*}abc")); test_parse!("*}abc", (Str, "*}abc"));
} }
#[test] #[test]
fn typeset_close_parent() { fn container_close_parent() {
test_parse!( test_parse!(
"{*{_abc*}", "{*{_abc*}",
(Enter(Strong), "{*"), (Enter(Strong), "{*"),
@ -761,7 +761,7 @@ mod test {
} }
#[test] #[test]
fn typeset_close_block() { fn container_close_block() {
test_parse!("{_abc", (Str, "{_abc")); test_parse!("{_abc", (Str, "{_abc"));
test_parse!("{_{*{_abc", (Str, "{_{*{_abc")); test_parse!("{_{*{_abc", (Str, "{_{*{_abc"));
} }

View file

@ -352,7 +352,6 @@ impl<'s> InlineSpans<'s> {
} }
fn set_spans(&mut self, spans: impl Iterator<Item = Span>) { fn set_spans(&mut self, spans: impl Iterator<Item = Span>) {
// avoid allocating new vec if size is sufficient
self.spans.clear(); self.spans.clear();
self.spans.extend(spans); self.spans.extend(spans);
} }
@ -449,7 +448,6 @@ impl<'s> Iterator for Parser<'s> {
fn next(&mut self) -> Option<Self::Item> { fn next(&mut self) -> Option<Self::Item> {
if let Some(parser) = &mut self.inline_parser { if let Some(parser) = &mut self.inline_parser {
if let Some(inline) = parser.next() { if let Some(inline) = parser.next() {
// SAFETY: cannot set lifetime 's on self due to trait
return Some(self.inline(inline)); return Some(self.inline(inline));
} }
self.inline_parser = None; self.inline_parser = None;
@ -463,7 +461,6 @@ impl<'s> Iterator for Parser<'s> {
block::Atom::ThematicBreak => Event::Atom(Atom::ThematicBreak), block::Atom::ThematicBreak => Event::Atom(Atom::ThematicBreak),
block::Atom::Attributes => { block::Atom::Attributes => {
self.block_attributes.parse(&content); self.block_attributes.parse(&content);
dbg!(&self.block_attributes);
continue; continue;
} }
}, },