From fac01d5209781ea61597941366c8fbc4514dad94 Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Sun, 19 Jan 2025 22:10:32 +1300 Subject: Expand list of recognised checkbox formats Checkboxes on list lines no longer have to be inside a monospace line element. --- src/generate_html.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/generate_html.rs') diff --git a/src/generate_html.rs b/src/generate_html.rs index 47dc5bf..c0026fb 100644 --- a/src/generate_html.rs +++ b/src/generate_html.rs @@ -146,6 +146,15 @@ pub fn document_to_html(document: &MarkdownDocument, page: &Page, website: &Webs } else if let Some(stripped) = output.strip_prefix("[X]") { output = format!("{stripped}"); class.push_str(" checkbox"); + }else if let Some(stripped) = output.strip_prefix("[ ]") { + output = format!("{stripped}"); + class.push_str(" checkbox"); + } else if let Some(stripped) = output.strip_prefix("[x]") { + output = format!("{stripped}"); + class.push_str(" checkbox"); + } else if let Some(stripped) = output.strip_prefix("[X]") { + output = format!("{stripped}"); + class.push_str(" checkbox"); } let class = class.trim(); html!("
  • {output}
  • ") -- cgit v1.2.3-70-g09d2