aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-02-04 07:10:41 +0000
committerFuwn <[email protected]>2023-02-04 07:10:41 +0000
commitbcc092454d52f4e96569bff7dcfd824fb52f040d (patch)
treeac4d5435bea82ee5299f818b78ed75c2e1457545 /src
parentfeat: markdown to html (diff)
downloadseptember-bcc092454d52f4e96569bff7dcfd824fb52f040d.tar.xz
september-bcc092454d52f4e96569bff7dcfd824fb52f040d.zip
feat: mathjax
Diffstat (limited to 'src')
-rw-r--r--src/gemini_to_html.rs2
-rw-r--r--src/response.rs6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/gemini_to_html.rs b/src/gemini_to_html.rs
index ea09336..ec19cec 100644
--- a/src/gemini_to_html.rs
+++ b/src/gemini_to_html.rs
@@ -64,7 +64,7 @@ pub fn gemini_to_html(
href = link_from_host_href(url, &href);
}
- if var("PROXY_BY_DEFAULT").unwrap_or_else(|_| "true".to_string())
+ if var("PROXY_BY_DEFAULT").unwrap_or_else(|_| "true".to_string()).to_lowercase()
== "true"
&& href.contains("gemini://")
&& !surface
diff --git a/src/response.rs b/src/response.rs
index bd79024..ce1ad4c 100644
--- a/src/response.rs
+++ b/src/response.rs
@@ -156,6 +156,12 @@ pub async fn default(
));
}
+ if var("MATHJAX").unwrap_or_else(|_| "true".to_string()).to_lowercase() == "true" {
+ html_context.push_str(
+ "<script type=\"#text/javascript\" id=\"MathJax-script\" async src=\"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js\"></script>",
+ );
+ }
+
// Add a title to HTML response
html_context.push_str(&format!("<title>{gemini_title}</title>"));
html_context.push_str("</head><body>");