mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-24 04:27:59 +01:00
Break precedence for newlines
This commit is contained in:
parent
fa2024764c
commit
9ed5652aad
1 changed files with 8 additions and 10 deletions
|
@ -227,7 +227,7 @@ defmodule FastTextile.Parser do
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
# bq_cite_text = literal | char | quicktxt;
|
# bq_cite_text = literal | char | space | quicktxt;
|
||||||
#
|
#
|
||||||
|
|
||||||
# Note that text is not escaped here because it will be escaped
|
# Note that text is not escaped here because it will be escaped
|
||||||
|
@ -250,20 +250,15 @@ defmodule FastTextile.Parser do
|
||||||
|
|
||||||
#
|
#
|
||||||
# inline_textile_element_not_opening_markup =
|
# inline_textile_element_not_opening_markup =
|
||||||
# literal inline_textile_element |
|
# literal | space | char |
|
||||||
# newline inline_textile_element |
|
# quicktxt opening_markup quicktxt |
|
||||||
# space inline_textile_element |
|
# quicktxt |
|
||||||
# char inline_textile_element |
|
|
||||||
# quicktxt inline_textile_element_not_opening_markup |
|
|
||||||
# opening_block_tag block_textile_element* closing_block_tag;
|
# opening_block_tag block_textile_element* closing_block_tag;
|
||||||
#
|
#
|
||||||
|
|
||||||
defp inline_textile_element_not_opening_markup(_parser, [{:literal, lit} | r_tokens]) do
|
defp inline_textile_element_not_opening_markup(_parser, [{:literal, lit} | r_tokens]) do
|
||||||
{:ok, [{:markup, "<span class=\"literal\">"}, {:markup, escape(lit)}, {:markup, "</span>"}], r_tokens}
|
{:ok, [{:markup, "<span class=\"literal\">"}, {:markup, escape(lit)}, {:markup, "</span>"}], r_tokens}
|
||||||
end
|
end
|
||||||
defp inline_textile_element_not_opening_markup(_parser, [{:newline, _} | r_tokens]) do
|
|
||||||
{:ok, [{:markup, "<br/>"}], r_tokens}
|
|
||||||
end
|
|
||||||
defp inline_textile_element_not_opening_markup(_parser, [{:space, _} | r_tokens]) do
|
defp inline_textile_element_not_opening_markup(_parser, [{:space, _} | r_tokens]) do
|
||||||
{:ok, [{:text, " "}], r_tokens}
|
{:ok, [{:text, " "}], r_tokens}
|
||||||
end
|
end
|
||||||
|
@ -340,12 +335,15 @@ defmodule FastTextile.Parser do
|
||||||
|
|
||||||
#
|
#
|
||||||
# block_textile_element =
|
# block_textile_element =
|
||||||
# double_newline | inline_textile_element;
|
# double_newline | newline | inline_textile_element;
|
||||||
#
|
#
|
||||||
|
|
||||||
defp block_textile_element(_parser, [{:double_newline, _} | r_tokens]) do
|
defp block_textile_element(_parser, [{:double_newline, _} | r_tokens]) do
|
||||||
{:ok, [{:markup, "<br/><br/>"}], r_tokens}
|
{:ok, [{:markup, "<br/><br/>"}], r_tokens}
|
||||||
end
|
end
|
||||||
|
defp block_textile_element(_parser, [{:newline, _} | r_tokens]) do
|
||||||
|
{:ok, [{:markup, "<br/>"}], r_tokens}
|
||||||
|
end
|
||||||
defp block_textile_element(parser, tokens) do
|
defp block_textile_element(parser, tokens) do
|
||||||
inline_textile_element(parser, tokens)
|
inline_textile_element(parser, tokens)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue