add: better layout

This commit is contained in:
trisua 2025-07-25 15:12:15 -04:00
parent 2cc9ed7445
commit dbd70d9592
19 changed files with 451 additions and 87 deletions

View file

@ -76,7 +76,7 @@ fn parse_text_color_line(output: &mut String, buffer: &mut String, line: &str) {
// by this point, we have: !
// %color_buffer%main_buffer%%
output.push_str(&format!(
"<span style=\"color: {color_buffer}\">{buffer}</span>"
"<span style=\"color: {color_buffer}\" class=\"color_block\">{buffer}</span>"
));
color_buffer.clear();
@ -468,7 +468,14 @@ fn parse_image_line(output: &mut String, buffer: &mut String, line: &str) {
if in_image {
// end
output.push_str(&format!(
"<img loading=\"lazy\" alt=\"{alt}\" src=\"{buffer}\" />"
"<img loading=\"lazy\" alt=\"{alt}\" src=\"{buffer}\" style=\"float: {}\" />",
if buffer.ends_with("#left") {
"left"
} else if buffer.ends_with("#right") {
"right"
} else {
"unset"
}
));
alt = String::new();