From e88199551b5d2beba0fbaa054d0f2209b66627c6 Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Mon, 2 Mar 2026 15:17:32 +1300 Subject: Sanitize heading names in table of contents Heading names in the table of contents are now sanitised and fancified, so that quotes and em-dashes and the likes are shown properly. --- src/generate_html.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generate_html.rs b/src/generate_html.rs index 60e956b..6887f37 100644 --- a/src/generate_html.rs +++ b/src/generate_html.rs @@ -129,7 +129,7 @@ pub fn get_table_of_contents(page: &Page) -> String { toc.push_str(&format!("
  • {page_name}
  • \n")); for heading in &page.headings { - let name = &heading.name; + let name = sanitize_text(&heading.name.plain(), true); let url = &heading.slug(); let class = match heading.level { Level::Heading1 => "l1", -- cgit v1.2.3-70-g09d2