From 5d4e94575bc73d96c1ab8424f2f601538ec0d88a Mon Sep 17 00:00:00 2001 From: trisua Date: Fri, 25 Jul 2025 23:01:45 -0400 Subject: [PATCH] fix: content_font compatibility --- src/model.rs | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/model.rs b/src/model.rs index 8babf56..166d908 100644 --- a/src/model.rs +++ b/src/model.rs @@ -477,12 +477,21 @@ impl EntryMetadata { } if !self.content_font.is_empty() { + let s: Vec<&str> = self.content_font.split(" ").collect(); + output.push_str(&format!( - " - - ", - self.content_font.replace(" ", "+").replace("_", "+"), + "", + s[0].replace("_", "+"), )); + + if let Some(headings) = s.get(1) { + output.push_str(&format!( + " + + ", + headings.replace("_", "+"), + )); + } } if self.option_disable_search_engine { @@ -571,10 +580,19 @@ impl EntryMetadata { } if !self.content_font.is_empty() { + let s: Vec<&str> = self.content_font.split(" ").collect(); + output.push_str(&format!( ".container {{ font-family: \"{}\", system-ui; }}", - self.content_font.replace("_", " ") + s[0].replace("_", " ") )); + + if let Some(headings) = s.get(1) { + output.push_str(&format!( + ".container h1, .container h2, .container h3, .container h4, .container h5, .container h6 {{ font-family: \"{}\", system-ui; }}", + headings.replace("_", " ") + )); + } } if self.content_font_weight != 0 {