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

implicit/explicit whitespace #43

Open
pekeler opened this issue Aug 31, 2016 · 0 comments
Open

implicit/explicit whitespace #43

pekeler opened this issue Aug 31, 2016 · 0 comments

Comments

@pekeler
Copy link

pekeler commented Aug 31, 2016

When working with a more strict layout, whitespace between elements can cause trouble. For example, if I have a couple of spans that need to be flush against each other, there can't be any whitespace between the span tags in the generated HTML. Unfortunately, bel (or hyperx?) preserves the whitespace from the input.

bel`
  <p>
    <span>one</span>
    <span>two</span>
  </p>
`.toString()

generates:

<p>\n    <span>one</span>\n    <span>two</span>\n  </p>

To work around this issue, I'd have to

bel`
  <p>
    <span>one</span><span>two</span>
  </p>
`.toString()

Which isn't ideal, especially when multiple tags are involved or if they have attributes.

I like the way React deals with this issue: https://facebook.github.io/react/blog/2014/02/20/react-v0.9.html#jsx-whitespace

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

No branches or pull requests

1 participant