-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Addon-docs: Preserve Source indentation by default #9513
Addon-docs: Preserve Source indentation by default #9513
Conversation
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/storybook/monorepo/e2sp097bq |
@atanasster Oh, see also the failing chromatic tests! 😱 |
Can you please elaborate, the new version is outputting it as it is in the code, while before it was mangling the code> no ? Here is the code for the story:
|
chromatic tests - no idea what they say :) |
If the issue is the long line, I specifically removed the white-space wrapping style, so the code stays the same as the story was written and the user has control over the code. I can put it back in (to force-wrap lines) |
I took a look at all the different permutations. What I think:
That way we still get line wrapping (debatable, I know) but most of the annoying bugs that people are reporting go away. WDYT? |
sounds good, checking in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 😅
@atanasster WDYT |
@patricklafrance - can you paste your code that breaks here? @shilman yes, lets keep for the 6.0 branch, its too much of a risk to push out. In general, i think we should not touch the source code on our end (including in source-loader) and use the syntax highlighter’s prettier configuration that would be also available to the end-user - ie he prefers 2 vs 4 spaces etc. |
@atanasster for this particular case:
I have a few other cases:
|
@patricklafrance thanks ! |
@atanasster This has already been released in 5.3.7. Should I revert the change there? |
Ah sorry didnt realize. Based on what @patricklafrance is saying, i guess we should revert it if possible? |
👍 will revert it @patricklafrance @atanasster and let's figure out the right fix on the |
Issue: #8078
What I did
How to test
I didn't get much stories to try with, so mostly tested indentation.
Possibly find stories that are using template strings?