Skip to content

Commit

Permalink
fix: use placeholder in comments for empty component names (#1850)
Browse files Browse the repository at this point in the history
  • Loading branch information
flosse authored Oct 9, 2023
1 parent 0676348 commit c080c2c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion leptos_dom/src/ssr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -735,10 +735,16 @@ impl ToMarker for HydrationKey {
fn to_marker(
&self,
closing: bool,
#[cfg(debug_assertions)] component_name: &str,
#[cfg(debug_assertions)] mut component_name: &str,
) -> Oco<'static, str> {
#[cfg(debug_assertions)]
{
if component_name.is_empty() {
// NOTE:
// If the name is left empty, this will lead to invalid comments,
// so a placeholder is used here.
component_name = "<>";
}
if closing || component_name == "unit" {
format!("<!--hk={self}c|leptos-{component_name}-end-->").into()
} else {
Expand Down

0 comments on commit c080c2c

Please sign in to comment.