web: style improvements for figure captions
This commit is contained in:
parent
fb754469ce
commit
5c813e7350
@ -150,8 +150,16 @@ impl Transformer for FrameImages {
|
|||||||
let alt = el.get_attribute("alt");
|
let alt = el.get_attribute("alt");
|
||||||
let title = el.get_attribute("title");
|
let title = el.get_attribute("title");
|
||||||
let mut frags = vec!["<figure>".to_string(), format!(r#"<img src="{src}">"#)];
|
let mut frags = vec!["<figure>".to_string(), format!(r#"<img src="{src}">"#)];
|
||||||
alt.map(|t| frags.push(format!("<figcaption>Alt: {t}</figcaption>")));
|
alt.map(|t| {
|
||||||
title.map(|t| frags.push(format!("<figcaption>Title: {t}</figcaption>")));
|
if !t.is_empty() {
|
||||||
|
frags.push(format!("<figcaption>Alt: {t}</figcaption>"))
|
||||||
|
}
|
||||||
|
});
|
||||||
|
title.map(|t| {
|
||||||
|
if !t.is_empty() {
|
||||||
|
frags.push(format!("<figcaption>Title: {t}</figcaption>"))
|
||||||
|
}
|
||||||
|
});
|
||||||
frags.push("</figure>".to_string());
|
frags.push("</figure>".to_string());
|
||||||
el.replace(&frags.join("\n"), ContentType::Html);
|
el.replace(&frags.join("\n"), ContentType::Html);
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,7 @@
|
|||||||
|
.body figcaption {
|
||||||
|
color: var(--color-text) !important;
|
||||||
|
}
|
||||||
|
|
||||||
.body.news-post.site-saturday-morning-breakfast-cereal {
|
.body.news-post.site-saturday-morning-breakfast-cereal {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user