mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-19 22:27:59 +01:00
hopefully more correct fix for textile shenanigans
This commit is contained in:
parent
fa6be88874
commit
9dbdad0d49
2 changed files with 18 additions and 19 deletions
|
@ -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)
|
||||
)
|
||||
|
||||
|
|
|
@ -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
|
Loading…
Reference in a new issue