hopefully more correct fix for textile shenanigans

This commit is contained in:
byte[] 2019-11-27 16:38:53 -05:00
parent fa6be88874
commit 9dbdad0d49
2 changed files with 18 additions and 19 deletions

View file

@ -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)
)

View file

@ -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