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

Meaningful whitespace is not preserved #1218

Open
6 of 12 tasks
TzviPM opened this issue Jul 8, 2023 · 3 comments · May be fixed by #1219 or TzviPM/mitosis#1
Open
6 of 12 tasks

Meaningful whitespace is not preserved #1218

TzviPM opened this issue Jul 8, 2023 · 3 comments · May be fixed by #1219 or TzviPM/mitosis#1
Labels
bug Something isn't working

Comments

@TzviPM
Copy link

TzviPM commented Jul 8, 2023

I am interested in helping provide a fix!

Yes

Which generators are impacted?

  • All
  • Angular
  • HTML
  • Preact
  • Qwik
  • React
  • React-Native
  • Solid
  • Stencil
  • Svelte
  • Vue
  • Web components

Reproduction case

https://mitosis.builder.io/?outputTab=E4UwhgxgLkA%3D&code=KYDwDg9gTgLgBAE2AMwIYFcA29noHYDGMAlhHnABLCaYQAUYUEYAzgJRwDeAUHHFMBjoo5Orz5wAPAmIA3AHziJlarS6NmLAHR5UAW2BwA%2FEbgByAOrRMCMwF8lUgPQyF4tgG5udoA%3D%3D

Expected Behaviour

The meaningful whitespace (" ") should be preserved in the react output.

Actual Behaviour

The space is converted into a line break, causing the output to be HelloWorld (without a space)

Additional Information

I did notice a few things:

  1. Adding {' '} causes the output to have a space, although not escaped with braces. Unfortunately, prettier also removes this literal space from the .lite.tsx file, because it's redundant.
  2. Adding   has no effect on the output. The   escape is removed.
@TzviPM TzviPM added the bug Something isn't working label Jul 8, 2023
TzviPM added a commit to TzviPM/mitosis that referenced this issue Jul 8, 2023
@TzviPM TzviPM linked a pull request Jul 8, 2023 that will close this issue
TzviPM added a commit to TzviPM/mitosis that referenced this issue Jul 8, 2023
TzviPM added a commit to TzviPM/mitosis that referenced this issue Jul 8, 2023
@samijaber
Copy link
Contributor

This is related to #310 as well.

@Imadnajam
Copy link

hello

@Imadnajam
Copy link

fixes #4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants