diff --git a/server/src/client/assets/css/style.css b/server/src/client/assets/css/style.css index a6be426..5a3c92f 100644 --- a/server/src/client/assets/css/style.css +++ b/server/src/client/assets/css/style.css @@ -71,10 +71,12 @@ input, label, a, blockquote, +figcaption, aside, ol, ul { font-size: calc(var(--font-size) * 1.33); + line-height: 1.5em; } h1, @@ -87,26 +89,22 @@ h6 { } aside, -blockquote { - border: var(--border); -} - -blockquote, -aside { +figure { padding: var(--default-padding) calc(var(--default-padding) * 2); + border: var(--border); max-inline-size: 100%; margin-inline: 0; } blockquote { - &::before { - content: '“'; - font-weight: 600; - } + margin: 0; +} - &::after { - content: '”'; - font-weight: 600; +figure { + & figcaption { + font-style: italic; + margin-inline-start: var(--default-padding); + margin-block-start: var(--default-padding); } } diff --git a/server/src/server/routes/api/editor.rs b/server/src/server/routes/api/editor.rs index 7d76487..b83e7c9 100644 --- a/server/src/server/routes/api/editor.rs +++ b/server/src/server/routes/api/editor.rs @@ -34,6 +34,7 @@ pub(crate) enum Block { }, quote { text: String, + caption: String, }, embed { service: String, @@ -78,7 +79,13 @@ impl Block { } }, Block::warning { title } => [""].concat(), - Block::quote { text } => ["
", text, ""].concat(), + Block::quote { text, caption } => { + if caption.is_empty() { + [""].concat() + } else { + [""].concat() + } + }, Block::embed { embed, width, @@ -109,7 +116,7 @@ impl Block { Block::header { text, level: _ } => text, Block::list { style: _, items } => &items.join("\n"), Block::warning { title } => title, - Block::quote { text } => text, + Block::quote { text, caption } => &[text, caption.as_str()].concat(), _ => &"".to_string(), }; let text = [text, "\n"].concat(); @@ -241,14 +248,17 @@ impl Blocks { Block::paragraph { text: _ } => true, Block::header { text: _, level } => *level > 1, Block::warning { title: _ } => true, - Block::quote { text: _ } => true, + Block::quote { + text: _, + caption: _, + } => true, _ => false, }) .map(|block| match block { Block::paragraph { text } => text, Block::header { text, level: _ } => text, Block::warning { title } => title, - Block::quote { text } => text, + Block::quote { text, caption: _ } => text, _ => "...", }) .unwrap_or("No description"),