From 6cf5aca1e3dc4d7888dbbc48339713501c6dad42 Mon Sep 17 00:00:00 2001 From: Noah Hellman Date: Sat, 28 Jan 2023 16:37:35 +0100 Subject: [PATCH] fixup! stuuoestnhunoestuh --- src/inline.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/inline.rs b/src/inline.rs index 3f8173a..88006d1 100644 --- a/src/inline.rs +++ b/src/inline.rs @@ -45,7 +45,7 @@ pub enum Container { InlineLink, /// Span is the URL. InlineImage, - + /// Open delimiter span is URL, closing is '>'. Autolink, } @@ -327,11 +327,11 @@ impl + Clone> Parser { .count(); (end && is_url).then(|| { self.lexer = lex::Lexer::new(ahead); + self.span = self.span.after(len); self.events.push_back(Event { kind: EventKind::Enter(Autolink), span: self.span, }); - self.span = self.span.after(len); self.events.push_back(Event { kind: EventKind::Str, span: self.span, @@ -1070,22 +1070,22 @@ mod test { fn autolink() { test_parse!( "", - (Enter(Autolink), "<"), + (Enter(Autolink), "https://example.com"), (Str, "https://example.com"), (Exit(Autolink), ">") ); test_parse!( "", - (Enter(Autolink), "<"), + (Enter(Autolink), "a@b.c"), (Str, "a@b.c"), (Exit(Autolink), ">"), ); test_parse!( "", - (Enter(Autolink), "<"), + (Enter(Autolink), "http://a.b"), (Str, "http://a.b"), (Exit(Autolink), ">"), - (Enter(Autolink), "<"), + (Enter(Autolink), "http://c.d"), (Str, "http://c.d"), (Exit(Autolink), ">") );