Add back-to-the-top link to readme (#2707)

This commit is contained in:
Віктор Дуйко 2025-04-14 19:18:31 +03:00 committed by GitHub
parent 6ac3c703bb
commit 515e806b51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -4582,3 +4582,5 @@ I hope you enjoy using `just` and find great success and satisfaction in all
your computational endeavors!
😸
[🔼 Back to the top!](#just)

View file

@ -161,7 +161,9 @@ fn main() -> Result {
for event in &mut chapter.events {
if let Event::Start(Tag::Link(_, dest, _)) | Event::End(Tag::Link(_, dest, _)) = event {
if let Some(anchor) = dest.clone().strip_prefix('#') {
*dest = CowStr::Borrowed(&links[anchor]);
if anchor != "just" {
*dest = CowStr::Borrowed(&links[anchor]);
}
}
}
}