sax-wasm icon indicating copy to clipboard operation
sax-wasm copied to clipboard

Error with JSX parsing of inline valid javascript expressions including `<`

Open marcusglowe opened this issue 1 year ago • 1 comments

Describe the bug Suppose you have the following:

<foo>{bar < baz ? <div></div> : <></>}</foo>

The SAX parser will detect that <baz ? <div> is a tag To Reproduce Use this example

Expected behavior I expect that any complex expression is ignored from the parser, even if it contains <

I'd be happy to help fix if there are code pointers / strategies that would be effective in solving this!

marcusglowe avatar Dec 13 '23 04:12 marcusglowe

I have been able to confirm this defect. Nice catch!

I would expect the parser to report any nodes that exist in the jsx expression. This might be quite the rabbit hole however. I'll explore some options soon and report back.

justinwilaby avatar Dec 16 '23 04:12 justinwilaby