Repository navigation
fix(editor): allow tel: and sms: links in URL property control (#689) - #691
Merged
DavidBabinec merged 2 commits intoNov 16, 2026
Merged
Conversation
ghazy2001
marked this pull request as ready for review
November 14, 2026 13:56
The link field and the publisher kept separate scheme lists, which is how tel: and sms: drifted apart in CoreBunch#689. isValidUrl now delegates the scheme decision to isSafeUrl and still requires an absolute, parseable URL. A parity test pins the two together.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The URL field in the Properties panel (
UrlControl.tsx) previously rejectedtel:andsms:hrefs with"Invalid URL", preventing users from configuring click-to-call or SMS links in Link and Button modules through the visual editor.This occurred because
isValidUrl()insrc/core/utils/urlValidation.tsonly permittedhttps:,http:, andmailto:, despite the publisher and sanitization engine (SAFE_URL_SCHEMESinsrc/core/html-sanitize/index.ts) already treatingtel:andsms:as safe protocols. This created a discrepancy wheretel:/sms:links imported via HTML were published correctly, but could not be typed or edited directly in the editor.What Changed
src/core/utils/urlValidation.ts:isValidUrl()to accepttel:andsms:schemes alongsidehttps:,http:, andmailto:.src/__tests__/utils/urlValidation.test.ts:isValidUrl > allowed protocolsfortel:(both international and dashed numbers) andsms:(including optional query parameters like?body=...).tel:andsms:are permitted byisValidUrlbut rejected byisValidImageUrl.Verification
bun test src/__tests__/utils/urlValidation.test.tspassed (39 tests passing, 0 failing).bunx tsc --noEmitpassed with 0 errors.bunx eslint src/core/utils/urlValidation.ts src/__tests__/utils/urlValidation.test.tspassed with 0 errors.Fixes #689.