add: parse_image_line, parse_link_line
This commit is contained in:
parent
d8167aa06f
commit
9fe5735127
9 changed files with 234 additions and 25 deletions
13
src/model.rs
13
src/model.rs
|
@ -364,7 +364,7 @@ impl EntryMetadata {
|
|||
"<link rel=\"preconnect\" href=\"https://fonts.googleapis.com\">
|
||||
<link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin>
|
||||
<link href=\"https://fonts.googleapis.com/css2?family={}&display=swap\" rel=\"stylesheet\">",
|
||||
self.content_font.replace(" ", "+").replace(" ", "_"),
|
||||
self.content_font.replace(" ", "+").replace("_", "+"),
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -416,6 +416,15 @@ impl EntryMetadata {
|
|||
}
|
||||
|
||||
for (element, size) in &self.content_text_size {
|
||||
if element == "*" {
|
||||
output.push_str(&format!(
|
||||
".container, .container * {{ font-size: {}; }}\n",
|
||||
EntryMetadata::css_escape(&size)
|
||||
));
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
output.push_str(&format!(
|
||||
".container {} {{ font-size: {}; }}\n",
|
||||
element,
|
||||
|
@ -426,7 +435,7 @@ impl EntryMetadata {
|
|||
if !self.content_font.is_empty() {
|
||||
output.push_str(&format!(
|
||||
".container {{ font-family: \"{}\", system-ui; }}",
|
||||
self.content_font
|
||||
self.content_font.replace("_", " ")
|
||||
));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue