Visual Studio 2010 html indentation

In visual studio, when I paste an html fragment into the original window of an aspx / ascx file, the IDE re-delays the content. For example, if I insert this ...

<div><ul><li><a href="#">Item 1</a></li><li> <a href="#">Item 2</a></li><li><a href="#">Item 3</a></li></ul>/div> 

.. ide will reformat the text to ....

 <div> <ul> <li><a href="#">Item 1</a></li><li><a href="#">Item 2</a></li><li><a href="#">Item 3</a></li></ul> </div> 

But actually, I want the html to be formatted like this ...

 <div> <ul> <li> <a href="#">Item 1</a> </li> <li> <a href="#">Item 2</a> </li> <li> <a href="#">Item 3</a> </li> </ul> </div> 

How to change the way VS html indents to the above?

+4
source share
2 answers

You can change this by introducing special formatting for a text editor (HTML), getting:

Parameters β†’ Text editor β†’ HTML β†’ Formatting β†’ Special tag parameters (button)
-> Client HTML tags -> a -> Sets line breaks for lines before and after

Do this for all tags that you want to format differently.

+4
source

Ctrl + K , then Ctrl + D , will format the current document.

Ctrl + K , then Ctrl + F , will format the selected text.

+4
source

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


All Articles