Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arguments are not escaping special characters. #14622

Open
alanjo4 opened this issue Apr 16, 2021 · 3 comments
Open

Arguments are not escaping special characters. #14622

alanjo4 opened this issue Apr 16, 2021 · 3 comments

Comments

@alanjo4
Copy link

alanjo4 commented Apr 16, 2021

Describe the bug
Storybook is not supporting special characters

To Reproduce
Steps to reproduce the behavior:

  1. Go to Storybook,
  2. Click on the example button component
  3. Put "To be or not to be, that's the question" on the label field
  4. Click on the preview mode
  5. See error

Expected behavior
The preview mode should render "To be or not to be, that's the question"

Screenshots
image
image

System
Environment Info:

System:
OS: Windows 10 10.0.19041
CPU: (8) x64 Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz
Binaries:
Node: 12.18.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.14.5 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 89.0.4389.114
Edge: Spartan (44.19041.423.0), Chromium (89.0.774.76)
npmPackages:
@storybook/addon-actions: ^6.2.8 => 6.2.8
@storybook/addon-essentials: ^6.2.8 => 6.2.8
@storybook/addon-links: ^6.2.8 => 6.2.8
@storybook/html: ^6.2.8 => 6.2.8

Additional context
Add any other context about the problem here.

@shilman
Copy link
Member

shilman commented Apr 16, 2021

This is a known limitation, with a workaround that's documented in the last two sections here:

https://storybook.js.org/docs/react/writing-stories/args#mapping-to-complex-arg-values

I'd like @ghengeveld to chime in -- perhaps there are things we can do to make this less limiting.

@ghengeveld
Copy link
Member

ghengeveld commented Apr 19, 2021

The comma, perhaps. The quote, way too risky. We could consider is supporting a custom serializer/deserializer, which essentially makes it "use at your own peril" (security wise).

One alternative "solution" I can think of is allowing all characters, but asking for confirmation before we deserialize any "risky" values.

@Ustimov
Copy link

Ustimov commented Mar 3, 2023

Why not just allow custom mapping functions between the value shown in url and the value used in code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants