From 1f471fe33db8676e4cbcc2d95d3c6d4b9361cb4b Mon Sep 17 00:00:00 2001 From: zyl Date: Fri, 21 Jun 2024 13:52:19 -0700 Subject: [PATCH] fix bug in the link handler --- src/builder.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index c470c8f..2bd8e30 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -133,7 +133,7 @@ impl<'a> SiteBuilder<'a> { }), element!("a", |el| { if let Some(mut href) = el.get_attribute("href") { - if let Some((command, new_href)) = href.split_once('$') { + if let Some((command, mut new_href)) = href.split_once('$') { #[allow(clippy::single_match)] match command { "me" => { @@ -142,7 +142,9 @@ impl<'a> SiteBuilder<'a> { &(el.get_attribute("rel").unwrap_or_default() + " me"), )?; } - _ => {} + _ => { + new_href = &href; + } } href = new_href.to_string(); el.set_attribute("href", &href)?;