Skip to content

Commit

Permalink
fix heading layout mangling
Browse files Browse the repository at this point in the history
  • Loading branch information
frostu8 committed Jan 8, 2025
1 parent ec7e424 commit dd8d0a5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/page/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ pub mod view;

pub use crate::slug::Slug;

pub const HEADING_ID_PREFIX: &str = "heading-";

use leptos::prelude::*;
use leptos::Params;
use leptos_meta::{Meta, Title};
Expand Down Expand Up @@ -296,7 +298,8 @@ where
return id;
}

let mut result = String::with_capacity(id.len());
let mut result = String::with_capacity(id.len() + HEADING_ID_PREFIX.len());
result.push_str(HEADING_ID_PREFIX);
let mut i = 0;
let mut mark = 0;
let mut in_whitespace = false;
Expand Down

0 comments on commit dd8d0a5

Please sign in to comment.