diff options
| author | Ben Bridle <bridle.benjamin@gmail.com> | 2026-03-02 15:17:32 +1300 |
|---|---|---|
| committer | Ben Bridle <bridle.benjamin@gmail.com> | 2026-03-02 15:19:02 +1300 |
| commit | e88199551b5d2beba0fbaa054d0f2209b66627c6 (patch) | |
| tree | 0c7d528ed846521ff00e8d886b5993fb65f22c6a | |
| parent | 35b89decebe3b55ae636bff09d922af08d2164cb (diff) | |
| download | toaster-e88199551b5d2beba0fbaa054d0f2209b66627c6.zip | |
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.
| -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 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!("<li class='l1'><a href='#title'>{page_name}</a></li>\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", |
