mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
fix: use placeholder in comments for empty component names (#1850)
This commit is contained in:
parent
0676348bd4
commit
c080c2cbca
1 changed files with 7 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue