diff --git a/assets/css/common/_base.scss b/assets/css/common/_base.scss index 3e1fe060..e31f62ea 100644 --- a/assets/css/common/_base.scss +++ b/assets/css/common/_base.scss @@ -65,9 +65,8 @@ h6 { p { hyphens: none; - margin-top: 4px; - margin-bottom: 6px; - margin-left: 2px; + margin: 0.75rem 2px; + margin-right: 0; } pre { @@ -282,23 +281,27 @@ blockquote blockquote blockquote blockquote blockquote blockquote { } img[alt=tiny] { - max-height: $image_tiny_size; - max-width: $image_tiny_size; + max-height: $image_tiny_size !important; + max-width: $image_tiny_size !important; } img[alt=small] { - max-height: $image_small_size; - max-width: $image_small_size; + max-height: $image_small_size !important; + max-width: $image_small_size !important; } img[alt=medium] { - max-height: $image_medium_size; - max-width: $image_medium_size; + max-height: $image_medium_size !important; + max-width: $image_medium_size !important; } img[alt=large] { - max-height: $image_large_size; - max-width: $image_large_size; + max-height: $image_large_size !important; + max-width: $image_large_size !important; +} + +.communication__body__text > table { + @extend .table; } //donations diff --git a/lib/philomena/textile/parser_markdown.ex b/lib/philomena/textile/parser_markdown.ex index a6e1e80e..dc9e6d98 100644 --- a/lib/philomena/textile/parser_markdown.ex +++ b/lib/philomena/textile/parser_markdown.ex @@ -14,12 +14,6 @@ defmodule Philomena.Textile.ParserMarkdown do alias Philomena.Textile.Lexer alias Philomena.Markdown - alias Phoenix.HTML - - defp markdown_quote(text) do - result = Regexp.replace(~r/\n/, text, "\\0> ") - "> #{result}" - end def parse(parser, input) do parser = Map.put(parser, :state, %{}) @@ -95,32 +89,6 @@ defmodule Philomena.Textile.ParserMarkdown do # # open_token callback* close_token # - defp simple_recursive( - :bq_open, - :bq_close, - open_tag, - close_tag, - callback, - parser, - [ - {:bq_open, open} | r_tokens - ], - level - ) do - case repeat(callback, parser, r_tokens, true, level) do - {:ok, tree, [{:bq_close, _} | r2_tokens], level} -> - {:ok, - [ - {:markup, "\n" <> String.duplicate(open_tag, level)}, - tree, - {:markup, "\n" <> String.duplicate(close_tag, level - 1)} - ], r2_tokens} - - {:ok, tree, r2_tokens, level} -> - {:ok, [{:text, open}, tree], r2_tokens} - end - end - defp simple_recursive( open_token, close_token, @@ -504,14 +472,6 @@ defmodule Philomena.Textile.ParserMarkdown do end end - defp inline_textile_element_not_opening_markup( - _parser, - [{:bq_open, tok} | r_tokens], - level - ) do - {:ok, [{:text, tok}], r_tokens} - end - defp inline_textile_element_not_opening_markup(parser, tokens, level) do [ {:spoiler_open, :spoiler_close, "||", "||"}, @@ -566,11 +526,11 @@ defmodule Philomena.Textile.ParserMarkdown do inline_textile_element(parser, tokens, level) end - defp block_textile_element(_parser, [{:double_newline, _} | r_tokens]) do + defp block_textile_element(_parser, [{:double_newline, _} | r_tokens], _level) do {:ok, [{:markup, "\n\n"}], r_tokens} end - defp block_textile_element(_parser, [{:newline, _} | r_tokens]) do + defp block_textile_element(_parser, [{:newline, _} | r_tokens], _level) do {:ok, [{:markup, "\n"}], r_tokens} end diff --git a/mix.exs b/mix.exs index 4d3864fa..94f384a9 100644 --- a/mix.exs +++ b/mix.exs @@ -12,7 +12,7 @@ defmodule Philomena.MixProject do aliases: aliases(), deps: deps(), dialyzer: [plt_add_apps: [:mix]], - rustler_crates: [philomena_markdown: []] + rustler_crates: [philomena: []] ] end diff --git a/native/philomena/src/camo.rs b/native/philomena/src/camo.rs index 882db6fe..213d893a 100644 --- a/native/philomena/src/camo.rs +++ b/native/philomena/src/camo.rs @@ -27,8 +27,8 @@ fn untrusted_host(url: Url, camo_host: String, camo_key: String) -> Option Option { let cdn_host = env::var("CDN_HOST").ok()?; - let camo_host = env::var("CAMO_HOST").ok()?; - let camo_key = env::var("CAMO_KEY").ok()?; + let camo_host = env::var("CAMO_HOST").unwrap_or_else(|_| String::from("")); + let camo_key = env::var("CAMO_KEY").unwrap_or_else(|_| String::from("")); if camo_key.is_empty() { return Some(uri);