Skip to content

Commit adc4282

Browse files
committed
[jsx mode] Narrow test for trailing-comma generic
Issue codemirror#7073
1 parent bcb8626 commit adc4282

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mode/jsx/jsx.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@
103103
}
104104

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

0 commit comments

Comments
 (0)