preserve textile newlines

This commit is contained in:
Luna D 2021-09-23 15:51:09 +02:00
parent a603961a8a
commit 8ec16757e4
No known key found for this signature in database
GPG key ID: 81AF416F2CC36FC8

View file

@ -509,13 +509,14 @@ defmodule Philomena.Textile.ParserMarkdown do
{:ok, [{:markup, "\n" <> String.duplicate("> ", level)}], r_tokens} {:ok, [{:markup, "\n" <> String.duplicate("> ", level)}], r_tokens}
end end
# &nbsp;
defp block_textile_element(_parser, [{:double_newline, _} | r_tokens], level) defp block_textile_element(_parser, [{:double_newline, _} | r_tokens], level)
when level == 0 do when level == 0 do
{:ok, [{:markup, "\n\n"}], r_tokens} {:ok, [{:markup, "\n\u00a0\n"}], r_tokens}
end end
defp block_textile_element(_parser, [{:newline, _} | r_tokens], level) when level == 0 do defp block_textile_element(_parser, [{:newline, _} | r_tokens], level) when level == 0 do
{:ok, [{:markup, "\n"}], r_tokens} {:ok, [{:markup, "\u00a0\n"}], r_tokens}
end end
defp block_textile_element(parser, tokens, level) do defp block_textile_element(parser, tokens, level) do