Fix #340: autolink issue/PR refs #354
No reviewers
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub!354
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/issue-340"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements Forgejo #340:
#N → /{o}/{r}/issues/NandPRN(any case) →/{o}/{r}/pull/Nin comment and issue/PR bodies, boundary-delimited only (never in-word, in URLs, or in existing markdown links;#3.2excluded, sentence-final#3.links).\n\n- Pure string layer over marked HTML insiderenderMarkdownHtml(linkifyIssueRefs, corelinkifyRefTextinweb/src/lib/render-md.js), running AFTERresolveMarkdownUrlsso the #182/#185 resolver can never mangle the fresh hrefs; skips<a>/<code>/<pre>contents, so code spans/fences, existing links, and URL fragments pass through untouched.\n- Thread pages (Issue.jsx,Pull.jsx) passmdCtx={{ owner, repo }}— everyrenderBodyconsumer gets refs for free.\n- Decisions: leading zeros link as written with numeric hrefs (#003 → /issues/3); dead refs still link (honest 404, pipeline is sync/headless);&excluded from the leading boundary so entities never corrupt; zero sanitizer changes (bare relative href, allowlist pin in test).\n- Follow-up flagged, out of scope: commit bodies (linkifyBody,diff.js) —linkifyRefTextis exported reusable for exactly that.\n- Tests:web/test/unit/refs-autolink.test.js(21 cases, full match table); related suites 80/80 green; full suite 685/688 (3smoke.test.jsfailures are environmental — they fetch a live :8080, unrelated to this diff);vite build+ esbuild SDK bundle green. Doc decision appended todocs/go/12_web_ui.md(law 12).\n\nNo new deps. Browser proof open (shared-daemon loopback guard).#N links to /{o}/{r}/issues/N, PRN (any case) to /{o}/{r}/pull/N, boundary-delimited only. Pure string layer over marked HTML inside renderMarkdownHtml (after resolveMarkdownUrls, skipping a/code/pre), so every renderBody consumer gets it; thread pages pass {owner, repo} mdCtx. Leading zeros link as written with numeric hrefs; dead refs still link; zero sanitizer changes. Headless cover: web/test/unit/refs-autolink.test.js (21 cases). Doc decision in docs/go/12_web_ui.md (diff.js linkifyBody flagged as follow-up).The IssueNew preview placeholder advertises '(markdown; #N links issues)' but rendered without ctx, so refs stayed plain until posted. Pass the same { owner, repo } mdCtx the thread pages use (no ref/dir — relative URLs stay verbatim). Wiring pin added to refs-autolink.test.js; doc decision clause updated (law 12).