Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sadiqui
Copy link
Contributor

@sadiqui sadiqui commented Jul 25, 2025

Previously, URLs used the highlight= parameter to emphasize specific sentences in shared documentation links. However, this approach highlighted every individual occurrence of each word, rather than treating phrases as a single unit, leading to cluttered and imprecise highlights on the page.

This PR replaces the highlight= parameter with the #:~:text= fragment syntax, enabling exact phrase-level highlighting in supported browsers (Chrome, Edge, and others), while keeping source URLs the same.

@pedrodesu
Copy link
Contributor

Hello @sadiqui! Thank you for the PR.

I have a question, couldn't one just make use of the fact that in the docs each one of those headers have anchors?
Can't we just replace those links with these:
https://doc.rust-lang.org/stable/book/ch03-02-data-types.html#the-tuple-type
https://doc.rust-lang.org/stable/book/ch05-01-defining-structs.html#using-tuple-structs-without-named-fields-to-create-different-types
https://doc.rust-lang.org/stable/book/ch05-02-example-structs.html#adding-useful-functionality-with-derived-traits

I believe it should work in every browser just as well as we're simply pointing to valid elements with ids. Do let me know. If so, you can make the change yourself if you so desire. Thank you!

@pedrodesu pedrodesu self-requested a review July 28, 2025 10:48
@pedrodesu pedrodesu self-assigned this Jul 28, 2025
@pedrodesu pedrodesu added 📕 Rust Rust 🗂️ docs Documentation labels Jul 28, 2025
@pedrodesu pedrodesu changed the title docs(matrix-transposition): precise title highlighting in notions links [EXTERNAL] docs(matrix-transposition): precise title highlighting in notions links Jul 28, 2025
@sadiqui
Copy link
Contributor Author

sadiqui commented Jul 28, 2025

@pedrodesu You're absolutely right, using anchor links is a much simpler and more broadly compatible solution. My initial goal was to improve the accuracy of highlights, but I agree that pointing directly to headers via anchors is cleaner and more maintainable. I'll go ahead and update the PR to use anchor links instead. Thanks for the suggestion!

Copy link
Contributor

@pedrodesu pedrodesu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@pedrodesu pedrodesu merged commit 18ef3cb into 01-edu:master Jul 31, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🗂️ docs Documentation 📕 Rust Rust

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants