From 4476a2ed495b712449987299aab8453456c5a748 Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Wed, 15 Jan 2025 09:57:16 +1300 Subject: 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. --- src/generate_html.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/generate_html.rs') 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!("
{content}
"), + "math" => html!("
{}
", content.replace("\n", " \\\\\n")), "embed-html" => html!("{content}"), "embed-css" => wrap!("style", html!("{content}")), "embed-javascript"|"embed-js" => wrap!("script", html!("{content}")), -- cgit v1.2.3-70-g09d2