|

How to get IntelliJ IDEA to indent xml tags with attributes on multiple lines?

code:

| - carriages

<element attr1="1" attr2="2" attr3="3">|</element> 

What I expect to see after pressing enter:

 <element attr1="1" attr2="2" attr3="3"> | </element> 

What I really get:

 <element attr1="1" attr2="2" attr3="3"> | </element> 

IntelliJ IDEA CE 11.1

Thanks for any suggestion!

+4
source share
2 answers

Known bug reported 3 years ago to vote .

+2
source

Interestingly, neither the output you report nor the output you need matches the XSLT / XQuery specification rules for indentation, here

http://www.w3.org/TR/xslt-xquery-serialization/#xml-indent

which reads:

Space characters SHOULD NOT be added next to node text that contains characters without spaces.

The reason is that adding spaces here can very easily render a document outline invalid.

0
source

Source: https://habr.com/ru/post/1435685/


All Articles