fix crash
This commit is contained in:
parent
c200cbe07a
commit
d0caa08819
1 changed files with 3 additions and 2 deletions
|
@ -203,8 +203,9 @@ fn fix_headers_ids(html: &str) -> String {
|
||||||
html,
|
html,
|
||||||
RewriteStrSettings {
|
RewriteStrSettings {
|
||||||
element_content_handlers: vec![element!("a[href^='#']", |el| {
|
element_content_handlers: vec![element!("a[href^='#']", |el| {
|
||||||
el.set_attribute("href", &format!("#{}", el.get_attribute("id").unwrap()))
|
if let Some(id) = el.get_attribute("id") {
|
||||||
.unwrap();
|
el.set_attribute("href", &format!("#{id}")).unwrap();
|
||||||
|
};
|
||||||
Ok(())
|
Ok(())
|
||||||
})],
|
})],
|
||||||
..RewriteStrSettings::default()
|
..RewriteStrSettings::default()
|
||||||
|
|
Loading…
Reference in a new issue