You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a child JSX tag is missing a closing tag, the current code uses its parent tag as a mismatched tag, so its parent ends up missing a tag and the rest of the buffer is screwed. By deferring matching of opening and closing tags to rjsx-parse-xml we could be smarter about this matching process.
The text was updated successfully, but these errors were encountered:
Thinking through this more, this would require parsing the body of the top-level tag in big chunks without trying to assign children to parents. After every tag-closer, we would run some matching heuristic and decide whether we were done parsing XML, but that's a difficult question. Only then would we be able to walk the tree and assign children to parents. An example of how this would get confusing:
<divclassName="top"><sectionclassName="middle"><divclassName="bottom">{/* missing closing tag */}
Middle-text
</section></div>
In order to correctly attach "Middle-text" to the section, we'd have to first hit the </section> tag, realize that .bottom is unmatched, and then add all the other children to .middle.
How do we deal with situations like:
<div><div><div>{/* missing closing tag */}</div></div>
When a child JSX tag is missing a closing tag, the current code uses its parent tag as a mismatched tag, so its parent ends up missing a tag and the rest of the buffer is screwed. By deferring matching of opening and closing tags to
rjsx-parse-xml
we could be smarter about this matching process.The text was updated successfully, but these errors were encountered: