Skip to content

feat: Auto-link cross-references in statute text#125

Merged
williamzujkowski merged 1 commit intomainfrom
feat/121-cross-references
Mar 31, 2026
Merged

feat: Auto-link cross-references in statute text#125
williamzujkowski merged 1 commit intomainfrom
feat/121-cross-references

Conversation

@williamzujkowski
Copy link
Copy Markdown
Collaborator

Auto-links 'section N' mentions to in-page anchors (chapter pages) or chapter page anchors (section pages). Inspired by legislation.gov.uk. Closes #121.

Chapter pages:
- "section 1114" text auto-linked to #section-1114 anchor
- Only links when target section exists on the same page
- Teal underline styling matches link convention

Section detail pages:
- "section N of this title" linked to chapter page with anchor
- Links to /browse/title-N/chapter-M/#section-N

Both use lightweight inline scripts that walk text nodes and replace
"section N" mentions with anchor links. Skips headings and existing
links to avoid nesting.

Inspired by legislation.gov.uk's cross-reference linking pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@williamzujkowski williamzujkowski merged commit e94d629 into main Mar 31, 2026
@williamzujkowski williamzujkowski deleted the feat/121-cross-references branch March 31, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Auto-link cross-references in statute text (Gov.uk pattern)

1 participant