mirror of
https://github.com/zyllian/webdog.git
synced 2025-05-10 02:26:42 -07:00
fix bug in the link handler
This commit is contained in:
parent
d07eab6f37
commit
1f471fe33d
1 changed files with 4 additions and 2 deletions
|
@ -133,7 +133,7 @@ impl<'a> SiteBuilder<'a> {
|
||||||
}),
|
}),
|
||||||
element!("a", |el| {
|
element!("a", |el| {
|
||||||
if let Some(mut href) = el.get_attribute("href") {
|
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)]
|
#[allow(clippy::single_match)]
|
||||||
match command {
|
match command {
|
||||||
"me" => {
|
"me" => {
|
||||||
|
@ -142,7 +142,9 @@ impl<'a> SiteBuilder<'a> {
|
||||||
&(el.get_attribute("rel").unwrap_or_default() + " me"),
|
&(el.get_attribute("rel").unwrap_or_default() + " me"),
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {
|
||||||
|
new_href = &href;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
href = new_href.to_string();
|
href = new_href.to_string();
|
||||||
el.set_attribute("href", &href)?;
|
el.set_attribute("href", &href)?;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue