summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBen Bridle <ben@derelict.engineering>2025-03-21 14:44:28 +1300
committerBen Bridle <ben@derelict.engineering>2025-03-21 14:44:28 +1300
commitfb9b3dfdd3d9edce96ca6f61b00d241f0429462b (patch)
treef0eb9399a378cd5423efacfecbb65583ab1a9e7b /src
parentd3dc0830e5a35fb7af4d14218ffabb62e2411f16 (diff)
downloadtoaster-fb9b3dfdd3d9edce96ca6f61b00d241f0429462b.zip
Fix IDs generated for styled headings
Headings that contained line elements other than Normal were being stringified with the line_to_html function, which was causing the generated ID for such a heading to contain HTML tags. This was fixed by instead stringifying using the basic to_string() method of Line.
Diffstat (limited to 'src')
-rw-r--r--src/generate_html.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/generate_html.rs b/src/generate_html.rs
index 55bd8ef..806c4bc 100644
--- a/src/generate_html.rs
+++ b/src/generate_html.rs
@@ -112,7 +112,7 @@ pub fn document_to_html(document: &MarkdownDocument, page: &Page, website: &Webs
for block in &document.blocks {
match block {
Block::Heading { level, line } => {
- let id = make_url_safe(strip_appendix(&line_to_html!(line)));
+ let id = make_url_safe(strip_appendix(&line.to_string()));
match level {
Level::Heading1 => tag!("h1", line, format!("id='{id}'")),
Level::Heading2 => tag!("h2", line, format!("id='{id}'")),