From 9cc1e186a43f3a17b3c7473771751e671fc66fbe Mon Sep 17 00:00:00 2001 From: Luke Haas Date: Thu, 26 Oct 2023 12:01:24 +0100 Subject: [PATCH] allow for space between comma and bracket --- mode/jsx/jsx.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mode/jsx/jsx.js b/mode/jsx/jsx.js index 23d9e9cf2c..83141c0567 100644 --- a/mode/jsx/jsx.js +++ b/mode/jsx/jsx.js @@ -103,7 +103,7 @@ } function jsToken(stream, state, cx) { - if (stream.peek() == "<" && stream.string.indexOf(',>', stream.start) < 0 && jsMode.expressionAllowed(stream, cx.state)) { + if (stream.peek() == "<" && !/,\s*>/.test(stream.string) && jsMode.expressionAllowed(stream, cx.state)) { state.context = new Context(CodeMirror.startState(xmlMode, jsMode.indent(cx.state, "", "")), xmlMode, 0, state.context) jsMode.skipExpression(cx.state)