diff --git a/lib/textile/lexer.ex b/lib/textile/lexer.ex index b9f2705c..f55f8f41 100644 --- a/lib/textile/lexer.ex +++ b/lib/textile/lexer.ex @@ -122,23 +122,22 @@ defmodule Textile.Lexer do {link_markup_start, link_markup_element} = markup_ending_in(string("\"")) - link_stop = - repeat( - choice([ - string("*"), - string("_"), - string("@"), - string("+"), - string("^"), - string("-"), - string("~"), - string("."), - string("?"), - string("!"), - string(","), - ]) - ) - |> choice([space(), eos()]) + link_url_stop = + choice([ + string("*"), + string("_"), + string("@"), + string("+"), + string("^"), + string("-"), + string("~"), + string("."), + string("?"), + string("!"), + string(","), + space(), + eos() + ]) link_contents_start = choice([ @@ -175,7 +174,7 @@ defmodule Textile.Lexer do string("\":") |> unwrap_and_tag(:link_end) |> concat( - url_ending_in(link_stop) + url_ending_in(link_url_stop) |> unwrap_and_tag(:link_url) ) diff --git a/lib/textile/url_lexer.ex b/lib/textile/url_lexer.ex index 212224de..c99e7544 100644 --- a/lib/textile/url_lexer.ex +++ b/lib/textile/url_lexer.ex @@ -19,7 +19,7 @@ defmodule Textile.UrlLexer do ]) scheme_and_domain - |> repeat(utf8_char([]) |> lookahead_not(ending_sequence)) + |> repeat(lookahead_not(ending_sequence) |> utf8_char([])) |> reduce({List, :to_string, []}) end end \ No newline at end of file