Code formatting - preserve whitespace in self closing tags

Hello everyone,

I've been unsucesfuly searching to locate where or how I'd change code formatting settings to preserve a space before the forward slash of self-closing tags, like:

<jdoc:include type="component" />


 
<jdoc:include type="component"/>


Any help is greatly appreciated!

Best,

Matt

2
4 comments

Found it!

Settings => Code Style => HTML => Other => Spaces => in empty tag (checked to preserve)

15

Hi,

How to set the rule for *.csproj files?

How to configure it in .editorconfig?

I found ij_html_space_inside_empty_tag and ij_xml_space_inside_empty_tag but it does not work.

Thanks

0

You need to enable EditorConfig support on `Preferences | Editor | Code Style` so that the tag "ij_xml_space_inside_empty_tag = true" from this file can be read.
add .editorconfig file with 

[*.csproj]
ij_xml_space_inside_empty_tag = false

And call Code > Reformat and CleanUp action in the main menu.
Just checked and it works for me.
Please let me know if this works for you.

0

Please sign in to leave a comment.