Skip to content

fix: support Unicode characters in form field names#38138

Merged
WTW0313 merged 5 commits into
mainfrom
fix/markdown-forms
Jun 29, 2026
Merged

fix: support Unicode characters in form field names#38138
WTW0313 merged 5 commits into
mainfrom
fix/markdown-forms

Conversation

@WTW0313

@WTW0313 WTW0313 commented Jun 29, 2026

Copy link
Copy Markdown
Member

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

Fixes inner ticket 2944

Screenshots

Before After
image image

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

@github-actions github-actions Bot added the web This relates to changes on the web. label Jun 29, 2026
@WTW0313 WTW0313 marked this pull request as ready for review June 29, 2026 03:25
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 29, 2026
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.33%. Comparing base (358cf8b) to head (1bafc7a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #38138      +/-   ##
==========================================
- Coverage   85.38%   85.33%   -0.06%     
==========================================
  Files        5119     4964     -155     
  Lines      262662   258334    -4328     
  Branches    50081    49023    -1058     
==========================================
- Hits       224281   220452    -3829     
+ Misses      34092    33593     -499     
  Partials     4289     4289              
Flag Coverage Δ
cli ?
dify-ui 94.93% <ø> (ø)
web 85.02% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Markdown form component in the web frontend to accept Unicode characters in form field name attributes, so non-ASCII field names (e.g., Chinese, accented Latin) are not filtered out as “unsafe”.

Changes:

  • Expand the “safe field name” regex to allow Unicode letters/marks/numbers.
  • Add a unit test ensuring Unicode-named fields are included in JSON submission output.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
web/app/components/base/markdown-blocks/form.tsx Updates the safe-name validation regex to support Unicode field names.
web/app/components/base/markdown-blocks/tests/form.spec.tsx Adds a test covering Unicode field-name submission in JSON mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread web/app/components/base/markdown-blocks/form.tsx Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jun 29, 2026
crazywoola
crazywoola previously approved these changes Jun 29, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jun 29, 2026
@WTW0313 WTW0313 added this pull request to the merge queue Jun 29, 2026
Merged via the queue into main with commit d2216fe Jun 29, 2026
38 checks passed
@WTW0313 WTW0313 deleted the fix/markdown-forms branch June 29, 2026 05:08
wylswz pushed a commit that referenced this pull request Jun 29, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
(cherry picked from commit d2216fe)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants