correctly exclude footnotes from header id rewrite
This commit is contained in:
parent
8de0c4ca04
commit
d18b9639d7
1 changed files with 3 additions and 3 deletions
|
@ -209,11 +209,11 @@ fn fix_headers_ids(html: &str, path: Option<&FilePath>) -> String {
|
|||
rewrite_str(
|
||||
html,
|
||||
RewriteStrSettings {
|
||||
// TODO: footnotes are broken
|
||||
// This should be: a:not(.footnote-ref a, a.footnote-backref)[href^='#']
|
||||
element_content_handlers: vec![element!(
|
||||
"a:not(.footnote-ref):not(.footnote-backref)[href^='#']",
|
||||
"a:not([data-footnote-ref]):not(.footnote-backref)[href^='#']",
|
||||
|el| {
|
||||
println!("{el:?}");
|
||||
|
||||
let id = el.get_attribute("id").unwrap_or(
|
||||
path_to_hid(path) + remove_first_letter(&el.get_attribute("href").unwrap()),
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue