Summary
Make line numbers clickable, producing shareable GitHub-style deep links (#wzcbh-1-L12) that scroll to and highlight the target line.
Details
- Assign each code block a stable per-post index/id; line-number elements become anchors.
- Small frontend script (shared by both modes) handles hash parsing on load, scroll-into-view, and applying a temporary highlight class (reuse
.wzcbh-highlighted-line styling).
- Support ranges (
L5-L10) like GitHub; copy-link affordance on click.
- Requires line numbers enabled; interplay with expand/collapse (
aria-expanded button) — auto-expand a collapsed block when its hash is targeted.
Why
Lets readers and support staff link to an exact line in documentation/KB articles — invaluable for long snippets.
Speed to implement: Medium · Usefulness: Medium · Rank: 7
Summary
Make line numbers clickable, producing shareable GitHub-style deep links (
#wzcbh-1-L12) that scroll to and highlight the target line.Details
.wzcbh-highlighted-linestyling).L5-L10) like GitHub; copy-link affordance on click.aria-expandedbutton) — auto-expand a collapsed block when its hash is targeted.Why
Lets readers and support staff link to an exact line in documentation/KB articles — invaluable for long snippets.
Speed to implement: Medium · Usefulness: Medium · Rank: 7