diff options
author | Ben Bridle <ben@derelict.engineering> | 2025-01-15 09:57:16 +1300 |
---|---|---|
committer | Ben Bridle <ben@derelict.engineering> | 2025-01-15 09:57:16 +1300 |
commit | 4476a2ed495b712449987299aab8453456c5a748 (patch) | |
tree | 563f26bb59a359fde07fd292d78db7454a5c47d3 | |
parent | bf40ff75a7bb428af30b9377f013df3d6bbe641b (diff) | |
download | toaster-4476a2ed495b712449987299aab8453456c5a748.zip |
Add line breaks to math blocks
Math blocks are used when you have multiple lines of equations. Instead
of requiring the user to insert a `\\` line break after every line,
line breaks are now added automatically.
-rw-r--r-- | src/generate_html.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/generate_html.rs b/src/generate_html.rs index 7b12b30..d6624b8 100644 --- a/src/generate_html.rs +++ b/src/generate_html.rs @@ -175,7 +175,7 @@ pub fn document_to_html(document: &MarkdownDocument, page: &Page, website: &Webs } Block::Fragment { language, content } => { match language.as_str() { - "math" => html!("<div class='math'>{content}</div>"), + "math" => html!("<div class='math'>{}</div>", content.replace("\n", " \\\\\n")), "embed-html" => html!("{content}"), "embed-css" => wrap!("style", html!("{content}")), "embed-javascript"|"embed-js" => wrap!("script", html!("{content}")), |