mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +01:00
bunch of small fixes
This commit is contained in:
parent
625c0e4556
commit
e88e27ccfd
4 changed files with 19 additions and 56 deletions
|
@ -65,9 +65,8 @@ h6 {
|
||||||
|
|
||||||
p {
|
p {
|
||||||
hyphens: none;
|
hyphens: none;
|
||||||
margin-top: 4px;
|
margin: 0.75rem 2px;
|
||||||
margin-bottom: 6px;
|
margin-right: 0;
|
||||||
margin-left: 2px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pre {
|
pre {
|
||||||
|
@ -282,23 +281,27 @@ blockquote blockquote blockquote blockquote blockquote blockquote {
|
||||||
}
|
}
|
||||||
|
|
||||||
img[alt=tiny] {
|
img[alt=tiny] {
|
||||||
max-height: $image_tiny_size;
|
max-height: $image_tiny_size !important;
|
||||||
max-width: $image_tiny_size;
|
max-width: $image_tiny_size !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
img[alt=small] {
|
img[alt=small] {
|
||||||
max-height: $image_small_size;
|
max-height: $image_small_size !important;
|
||||||
max-width: $image_small_size;
|
max-width: $image_small_size !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
img[alt=medium] {
|
img[alt=medium] {
|
||||||
max-height: $image_medium_size;
|
max-height: $image_medium_size !important;
|
||||||
max-width: $image_medium_size;
|
max-width: $image_medium_size !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
img[alt=large] {
|
img[alt=large] {
|
||||||
max-height: $image_large_size;
|
max-height: $image_large_size !important;
|
||||||
max-width: $image_large_size;
|
max-width: $image_large_size !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.communication__body__text > table {
|
||||||
|
@extend .table;
|
||||||
}
|
}
|
||||||
|
|
||||||
//donations
|
//donations
|
||||||
|
|
|
@ -14,12 +14,6 @@
|
||||||
defmodule Philomena.Textile.ParserMarkdown do
|
defmodule Philomena.Textile.ParserMarkdown do
|
||||||
alias Philomena.Textile.Lexer
|
alias Philomena.Textile.Lexer
|
||||||
alias Philomena.Markdown
|
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
|
def parse(parser, input) do
|
||||||
parser = Map.put(parser, :state, %{})
|
parser = Map.put(parser, :state, %{})
|
||||||
|
@ -95,32 +89,6 @@ defmodule Philomena.Textile.ParserMarkdown do
|
||||||
#
|
#
|
||||||
# open_token callback* close_token
|
# 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(
|
defp simple_recursive(
|
||||||
open_token,
|
open_token,
|
||||||
close_token,
|
close_token,
|
||||||
|
@ -504,14 +472,6 @@ defmodule Philomena.Textile.ParserMarkdown do
|
||||||
end
|
end
|
||||||
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
|
defp inline_textile_element_not_opening_markup(parser, tokens, level) do
|
||||||
[
|
[
|
||||||
{:spoiler_open, :spoiler_close, "||", "||"},
|
{:spoiler_open, :spoiler_close, "||", "||"},
|
||||||
|
@ -566,11 +526,11 @@ defmodule Philomena.Textile.ParserMarkdown do
|
||||||
inline_textile_element(parser, tokens, level)
|
inline_textile_element(parser, tokens, level)
|
||||||
end
|
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}
|
{:ok, [{:markup, "\n\n"}], r_tokens}
|
||||||
end
|
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}
|
{:ok, [{:markup, "\n"}], r_tokens}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
2
mix.exs
2
mix.exs
|
@ -12,7 +12,7 @@ defmodule Philomena.MixProject do
|
||||||
aliases: aliases(),
|
aliases: aliases(),
|
||||||
deps: deps(),
|
deps: deps(),
|
||||||
dialyzer: [plt_add_apps: [:mix]],
|
dialyzer: [plt_add_apps: [:mix]],
|
||||||
rustler_crates: [philomena_markdown: []]
|
rustler_crates: [philomena: []]
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,8 @@ fn untrusted_host(url: Url, camo_host: String, camo_key: String) -> Option<Strin
|
||||||
|
|
||||||
pub fn image_url(uri: String) -> Option<String> {
|
pub fn image_url(uri: String) -> Option<String> {
|
||||||
let cdn_host = env::var("CDN_HOST").ok()?;
|
let cdn_host = env::var("CDN_HOST").ok()?;
|
||||||
let camo_host = env::var("CAMO_HOST").ok()?;
|
let camo_host = env::var("CAMO_HOST").unwrap_or_else(|_| String::from(""));
|
||||||
let camo_key = env::var("CAMO_KEY").ok()?;
|
let camo_key = env::var("CAMO_KEY").unwrap_or_else(|_| String::from(""));
|
||||||
|
|
||||||
if camo_key.is_empty() {
|
if camo_key.is_empty() {
|
||||||
return Some(uri);
|
return Some(uri);
|
||||||
|
|
Loading…
Reference in a new issue