Skip to content

Commit

Permalink
[jsx mode] Narrow test for trailing-comma generic
Browse files Browse the repository at this point in the history
Issue #7073
  • Loading branch information
marijnh committed Oct 27, 2023
1 parent bcb8626 commit adc4282
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mode/jsx/jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@
}

function jsToken(stream, state, cx) {
if (stream.peek() == "<" && !/,\s*>/.test(stream.string) && jsMode.expressionAllowed(stream, cx.state)) {
if (stream.peek() == "<" && !stream.match(/^<([^<>]|<[^>]*>)+,\s*>/, false) &&
jsMode.expressionAllowed(stream, cx.state)) {
state.context = new Context(CodeMirror.startState(xmlMode, jsMode.indent(cx.state, "", "")),
xmlMode, 0, state.context)
jsMode.skipExpression(cx.state)
Expand Down

0 comments on commit adc4282

Please sign in to comment.