Skip to content

fix: support custom matrix.to base URL via config#314

Merged
Just-Insane merged 7 commits intodevfrom
fix/matrix-to-custom-base
Mar 17, 2026
Merged

fix: support custom matrix.to base URL via config#314
Just-Insane merged 7 commits intodevfrom
fix/matrix-to-custom-base

Conversation

@Just-Insane
Copy link
Collaborator

Adds matrixToBaseUrl to config.json support so deployments can override the default https://matrix.to base for generated links.

What changed:

  • matrix-to.tssetMatrixToBase() sets the base; parse regexes are now built lazily and match both matrix.to and the custom base (for cross-client incoming link compat)
  • editor/output.ts — mention links use getMatrixToRoom/getMatrixToRoomEvent instead of hardcoding the base
  • room.tsparseReplyFormattedBody does the same

Closes #67

…ors (#67)

- matrix-to.ts: replace static hardcoded regexes with a lazily-built
  cached set that matches both https://matrix.to (cross-client compat)
  and the configured custom base URL (if matrixToBaseUrl is set in
  config.json)
- editor/output.ts: Mention block now calls getMatrixToRoom /
  getMatrixToRoomEvent instead of hardcoding the matrix.to base
- room.ts: parseReplyFormattedBody uses getMatrixToRoomEvent /
  getMatrixToRoom for the same reason
@Just-Insane Just-Insane requested review from 7w1 and hazre as code owners March 17, 2026 01:19
@Just-Insane Just-Insane changed the title fix: support custom matrix.to base URL via config (#67) fix: support custom matrix.to base URL via config Mar 17, 2026
Outgoing links embedded in Matrix events (mention HTML, reply quotes)
must use https://matrix.to so other clients (Element, FluffyChat, etc.)
can parse them as Matrix permalinks. Custom base applies only to UI
navigation links (copy-to-clipboard buttons).
@github-actions
Copy link
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

Status Preview URL Commit Alias Updated (UTC)
✅ Deployment successful! https://pr-314-sable.raspy-dream-bb1d.workers.dev f65f126 pr-314 Tue, 17 Mar 2026 02:21:11 GMT

@Just-Insane Just-Insane enabled auto-merge March 17, 2026 02:21
@Just-Insane Just-Insane added this pull request to the merge queue Mar 17, 2026
Merged via the queue into dev with commit 2ee7270 Mar 17, 2026
8 checks passed
@Just-Insane Just-Insane deleted the fix/matrix-to-custom-base branch March 17, 2026 03:43
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.

allow changing base of matrix.to plugin

2 participants