grommet / grommet/jsx-to-string

Adds incorrect whitespace to output (needs "no-format" option)

Open
#22 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
122
Forks
26
PR merge metrics
No merged PRs in 30d

Description

If you pass this JSX string:
```

fooorbaz


```
You get this output:
```



foo

or

baz


```
This will add whitespace between the `em`, "or" and `strong`, which is incorrect. If you use `ReactDOMServer.renderToStaticMarkup`, you get this, which is correct:
```

fooorbaz


```
This could be resolved by a `noformat` or similar option, which removed indentation and newlines in the output.

Contributor guide

No contributing guide indexed for this repository

Research direction

Trace the JSX-to-string formatting path that produces indentation and newlines, using the example input and output in the issue as the reproduction. Add a way to preserve inline text without inserting whitespace between adjacent elements, and verify that the proposed option produces markup matching the ReactDOMServer example.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.