todos
This commit is contained in:
parent
67926e312b
commit
519236a561
2 changed files with 18 additions and 6 deletions
|
@ -203,12 +203,19 @@ fn fix_headers_ids(html: &str) -> String {
|
|||
rewrite_str(
|
||||
html,
|
||||
RewriteStrSettings {
|
||||
element_content_handlers: vec![element!("a[href^='#']", |el| {
|
||||
if let Some(id) = el.get_attribute("id") {
|
||||
el.set_attribute("href", &format!("#{id}")).unwrap();
|
||||
};
|
||||
Ok(())
|
||||
})],
|
||||
// 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^='#']",
|
||||
|el| {
|
||||
// TODO: Link without IDs are link manually created to a header
|
||||
// Currently, this breaks them
|
||||
if let Some(id) = el.get_attribute("id") {
|
||||
el.set_attribute("href", &format!("#{id}")).unwrap();
|
||||
};
|
||||
Ok(())
|
||||
}
|
||||
)],
|
||||
..RewriteStrSettings::default()
|
||||
},
|
||||
)
|
||||
|
|
|
@ -151,6 +151,11 @@ section.footnotes * {
|
|||
font-size: calc(var(--font-size) * 0.8);
|
||||
}
|
||||
|
||||
/* TODO: Hightlight targeted link, change by css theme */
|
||||
/* section.footnotes :target {
|
||||
background-color: yellowgreen;
|
||||
} */
|
||||
|
||||
/* When multiple ref */
|
||||
a.footnote-backref sup {
|
||||
font-size: calc(var(--font-size) * 0.6);
|
||||
|
|
Loading…
Reference in a new issue