diff options
| author | Fuwn <[email protected]> | 2023-02-04 07:10:41 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-02-04 07:10:41 +0000 |
| commit | 0c858189da17869bf0a4fbb7ab00366f9f86e3f4 (patch) | |
| tree | 4217a9fa60f617f8dbb711ec8e075e31bc13418b /src/response.rs | |
| parent | feat: markdown to html (diff) | |
| download | september-0c858189da17869bf0a4fbb7ab00366f9f86e3f4.tar.xz september-0c858189da17869bf0a4fbb7ab00366f9f86e3f4.zip | |
feat: mathjax
Diffstat (limited to 'src/response.rs')
| -rw-r--r-- | src/response.rs | 6 |
1 files changed, 6 insertions, 0 deletions
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>"); |