Harden markdown link rendering #15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/markdown-link-rendering"
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?
Harden markdown link rendering in job descriptions, from the Taskuler Security review of
df205df(H1, M5).What someone using the app notices:
Links in job text work as before for
https:andmailto:.Other kinds of links show as plain text.
Links to other sites always open in a new tab and show a small ↗ marker.
Only links to a job on this site (
/jobs/<id>) open inside the app.Links with a user name or password in them (
https://name@host/…) show as plain text.Behind the scenes:
new URL()against the app origin and compared by origin.src/job-note/links.ts).Checked:
npm test153/153.tscpasses andvite buildpass./,/post,/jobs/1,/jobs/2,/withdrawand/history, and job text renders.Merging with #14: #14 and this PR each add one import line in the same spot in
src/pages/PostJob.tsx. Rebasing would need a force-push, so this branch stays onmain. When merging after #14, keep both lines:Nothing else conflicts. The full order #14 → #15 → #16 → #17 → #18 merged locally with that resolution passes 185/185 tests, both
tscpasses and the testnet build.No deploy.
- Job text is parsed into tokens and rendered as React elements. - Links: https and mailto only; in-app links only for same-origin /jobs/<id> paths, compared with new URL() against the app origin. Everything else external opens in a new tab with a cue. - Code fence labels limited to [A-Za-z0-9_-]{0,20}. - One link policy shared by the job page, the live preview and the post page. - Tests for link targets and rendering.New commits pushed, approval review dismissed automatically according to repository settings