Skip to content

fix: Preserve resource URL expression formatting#5916

Merged
kof merged 4 commits into
mainfrom
fix/expression-auto-format
Jul 20, 2026
Merged

fix: Preserve resource URL expression formatting#5916
kof merged 4 commits into
mainfrom
fix/expression-auto-format

Conversation

@kof

@kof kof commented Jul 18, 2026

Copy link
Copy Markdown
Member

What changed

  • preserve the user’s original whitespace and newlines in resource URL binding expressions

Change of plan

Automatic expression formatting is not needed. Prop binding expressions already preserve user-entered formatting; only resource URL bindings were losing their newlines. This PR aligns resource URL bindings with the existing prop binding behavior and does not add a formatter or change expression formatting rules.

Root cause

The resource URL expression was stored in an input hidden with the HTML hidden attribute. Because its input type still defaulted to text, the browser value-sanitization algorithm removed newline characters before the form was serialized.

The URL form field now uses type="hidden", which preserves the original expression during form submission.

Validation

  • pnpm --filter @webstudio-is/builder typecheck
  • pnpm lint
  • git diff --check

Closes #5858

@kof kof changed the title feat: Auto-format expressions on open and blur fix: Preserve resource URL expression formatting Jul 20, 2026
@kof
kof marked this pull request as ready for review July 20, 2026 14:45
@kof
kof temporarily deployed to development July 20, 2026 14:54 — with GitHub Actions Inactive
@kof
kof temporarily deployed to development July 20, 2026 14:54 — with GitHub Actions Inactive
@kof
kof temporarily deployed to development July 20, 2026 14:54 — with GitHub Actions Inactive
@kof
kof temporarily deployed to development July 20, 2026 14:55 — with GitHub Actions Inactive
@kof
kof temporarily deployed to development July 20, 2026 14:55 — with GitHub Actions Inactive
@kof
kof merged commit 5016426 into main Jul 20, 2026
28 of 29 checks passed
@kof
kof deleted the fix/expression-auto-format branch July 20, 2026 15:01
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.

Preserve resource URL expression formatting

1 participant