fixup! stuuoestnhunoestuh

This commit is contained in:
Noah Hellman 2023-01-28 16:37:35 +01:00
parent 9fd10683c5
commit 6cf5aca1e3

View file

@ -45,7 +45,7 @@ pub enum Container {
InlineLink, InlineLink,
/// Span is the URL. /// Span is the URL.
InlineImage, InlineImage,
/// Open delimiter span is URL, closing is '>'.
Autolink, Autolink,
} }
@ -327,11 +327,11 @@ impl<I: Iterator<Item = char> + Clone> Parser<I> {
.count(); .count();
(end && is_url).then(|| { (end && is_url).then(|| {
self.lexer = lex::Lexer::new(ahead); self.lexer = lex::Lexer::new(ahead);
self.span = self.span.after(len);
self.events.push_back(Event { self.events.push_back(Event {
kind: EventKind::Enter(Autolink), kind: EventKind::Enter(Autolink),
span: self.span, span: self.span,
}); });
self.span = self.span.after(len);
self.events.push_back(Event { self.events.push_back(Event {
kind: EventKind::Str, kind: EventKind::Str,
span: self.span, span: self.span,
@ -1070,22 +1070,22 @@ mod test {
fn autolink() { fn autolink() {
test_parse!( test_parse!(
"<https://example.com>", "<https://example.com>",
(Enter(Autolink), "<"), (Enter(Autolink), "https://example.com"),
(Str, "https://example.com"), (Str, "https://example.com"),
(Exit(Autolink), ">") (Exit(Autolink), ">")
); );
test_parse!( test_parse!(
"<a@b.c>", "<a@b.c>",
(Enter(Autolink), "<"), (Enter(Autolink), "a@b.c"),
(Str, "a@b.c"), (Str, "a@b.c"),
(Exit(Autolink), ">"), (Exit(Autolink), ">"),
); );
test_parse!( test_parse!(
"<http://a.b><http://c.d>", "<http://a.b><http://c.d>",
(Enter(Autolink), "<"), (Enter(Autolink), "http://a.b"),
(Str, "http://a.b"), (Str, "http://a.b"),
(Exit(Autolink), ">"), (Exit(Autolink), ">"),
(Enter(Autolink), "<"), (Enter(Autolink), "http://c.d"),
(Str, "http://c.d"), (Str, "http://c.d"),
(Exit(Autolink), ">") (Exit(Autolink), ">")
); );