-
Notifications
You must be signed in to change notification settings - Fork 47
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
Marksy/components is removing new lines from children prop #43
Comments
@Stanley-Jovel Hi there! Not sure what you mean by "new lines"? In HTML you can not add new lines by adding a linebreak. Like: <div>
hello
there
</div> These will be compiled by the browser to: But maybe you can explain a bit more what you are trying to achieve and maybe there is an other way? |
You are right @christianalfoni . What I'm trying to achieve is not supported by react. This is what I want to do: Markdown:
babel removes my newlines from the children, and they become So the "problem" is not a problem and this is the expected behavior for JSX compilation. However I can still achieve the behavior I want if I use props instead. Like so: Markdown:
the problem with this is that if I declare the |
Well, if you need multiline string literals, you have to use backticks anyway:
This should also work with children BTW:
|
If I have markdown that looks like this:
and a compiler that looks like this:
The children prop doesn't have the new lines I typed as the component's children.
I get back an object that looks like this:
My new lines are gone.
Is there a way I can override this behavior so I can have the new lines in the children?
The text was updated successfully, but these errors were encountered: