Skip to content

Commit 61eb7e4

Browse files
committed
[xml mode] Fix giant indentation when continuing an attribute on a long line
Closes #2473
1 parent 901666a commit 61eb7e4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mode/xml/xml.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,10 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
310310
var context = state.context;
311311
// Indent multi-line strings (e.g. css).
312312
if (state.tokenize.isInAttribute) {
313-
return state.stringStartCol + 1;
313+
if (state.tagStart == state.indented)
314+
return state.stringStartCol + 1;
315+
else
316+
return state.indented + indentUnit;
314317
}
315318
if (context && context.noIndent) return CodeMirror.Pass;
316319
if (state.tokenize != inTag && state.tokenize != inText)

0 commit comments

Comments
 (0)