HTML - Formatting Style
Last modified: 21 July 2022Tabs and indents
Indent style
Property names:
indent_style
, [resharper_]html_indent_style
Possible values:
tab
: Tabspace
: Spaces
Examples:
tab |
---|
|
space |
---|
|
Indent size
Property names:
indent_size
, [resharper_]html_indent_size
Possible values:
an integer
Examples:
value: 0 |
---|
|
value: 1 |
---|
|
value: 2 |
---|
|
Tab width
Property names:
tab_width
, [resharper_]html_tab_width
Possible values:
an integer
Examples:
value: 0 |
---|
|
value: 1 |
---|
|
value: 2 |
---|
|
How to align when tabs are used for indents
Property names:
[resharper_]html_alignment_tab_fill_style
, [resharper_]alignment_tab_fill_style
Possible values:
use_spaces
: Use spaces (looks aligned on any tab size)use_tabs_only
: Only use tabs (inaccurate)optimal_fill
: Mix tabs and spaces for optimal fill
Align even if the resulting indentation is too large
Property names:
[resharper_]html_allow_far_alignment
, [resharper_]allow_far_alignment
Allow alignment even if construct is located too far to the right, more than 2/3 of `Hard wrap at` limit
Possible values:
true | false
Processing instructions
Spaces around '=' in attribute
Property names:
[resharper_]html_spaces_around_eq_in_pi_attribute
, [resharper_]spaces_around_eq_in_pi_attribute
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Space after last attribute
Property names:
[resharper_]html_space_after_last_pi_attribute
, [resharper_]space_after_last_pi_attribute
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Attributes format
Property names:
[resharper_]html_pi_attribute_style
, [resharper_]pi_attribute_style
Possible values:
on_single_line
: On single linefirst_attribute_on_single_line
: First attribute on single lineon_different_lines
: Each attribute on separate linesdo_not_touch
: Do not touch
Examples:
on_single_line |
---|
|
first_attribute_on_single_line |
---|
|
on_different_lines |
---|
|
do_not_touch |
---|
|
Attributes indenting
Property names:
[resharper_]html_pi_attributes_indent
, [resharper_]pi_attributes_indent
Possible values:
single_indent
: Single indentdouble_indent
: Double indentalign_by_first_attribute
: Align by first attribute
Examples:
single_indent |
---|
|
double_indent |
---|
|
align_by_first_attribute |
---|
|
Blank line after processing instructions
Property names:
[resharper_]html_blank_line_after_pi
, [resharper_]blank_line_after_pi
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Inside of tag header
Spaces around '=' in attribute
Property names:
[resharper_]html_spaces_around_eq_in_attribute
, [resharper_]spaces_around_eq_in_attribute
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Space after last attribute
Property names:
[resharper_]html_space_after_last_attribute
, [resharper_]space_after_last_attribute
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Space before '/>'
Property names:
[resharper_]html_space_before_self_closing
, [resharper_]space_before_self_closing
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Attributes format
Property names:
[resharper_]html_attribute_style
, [resharper_]attribute_style
Possible values:
on_single_line
: On single linefirst_attribute_on_single_line
: First attribute on single lineon_different_lines
: Each attribute on separate linesdo_not_touch
: Do not touch
Examples:
on_single_line |
---|
|
first_attribute_on_single_line |
---|
|
on_different_lines |
---|
|
do_not_touch |
---|
|
Attributes indenting
Property names:
[resharper_]html_attribute_indent
, [resharper_]attribute_indent
Possible values:
single_indent
: Single indentdouble_indent
: Double indentalign_by_first_attribute
: Align by first attribute
Examples:
single_indent |
---|
|
double_indent |
---|
|
align_by_first_attribute |
---|
|
Sort attributes
Property names:
[resharper_]html_sort_attributes
, [resharper_]sort_attributes
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Sort class selectors
Property names:
[resharper_]html_sort_class_selectors
, [resharper_]sort_class_selectors
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Around tags
Maximum blank lines between tags
Property names:
[resharper_]html_max_blank_lines_between_tags
, [resharper_]max_blank_lines_between_tags
Possible values:
an integer
Examples:
value: 0 |
---|
|
value: 1 |
---|
|
value: 2 |
---|
|
Place all elements on new line
Property names:
[resharper_]html_linebreak_before_all_elements
, [resharper_]linebreak_before_all_elements
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Place multiline elements on new line
Property names:
[resharper_]html_linebreak_before_multiline_elements
, [resharper_]linebreak_before_multiline_elements
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Place these elements on new line
Property names:
[resharper_]html_linebreak_before_elements
, [resharper_]linebreak_before_elements
Do not indent children of
Property names:
[resharper_]html_no_indent_inside_elements
, [resharper_]no_indent_inside_elements
Do not indent children if element has more lines than
Property names:
[resharper_]html_no_indent_inside_if_element_longer_than
, [resharper_]no_indent_inside_if_element_longer_than
Possible values:
an integer
Keep white spaces inside
Property names:
[resharper_]html_preserve_spaces_inside_tags
, [resharper_]preserve_spaces_inside_tags
Line breaks after start-tag and before end-tag in multiline elements
Property names:
[resharper_]html_linebreaks_inside_tags_for_multiline_elements
, [resharper_]linebreaks_inside_tags_for_multiline_elements
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Line breaks after start-tag and before end-tag in elements that contain other elements and no text
Property names:
[resharper_]html_linebreaks_inside_tags_for_elements_with_child_elements
, [resharper_]linebreaks_inside_tags_for_elements_with_child_elements
Possible values:
true | false
Examples:
true |
---|
|
false |
---|
|
Other
Line feed at end of file
Property names:
insert_final_newline
, [resharper_]html_insert_final_newline
Possible values:
true | false
Extra spaces inside
Property names:
[resharper_]html_extra_spaces
, [resharper_]extra_spaces
Possible values:
remove_all
: Remove all extra spacesleave_tabs
: Leave extra tabsleave_multiple
: Leave multiple extra spacesleave_all
: Leave all extra spaces and tabs
Examples:
Before formatting | After formatting, remove_all |
---|---|
|
|
Before formatting | After formatting, leave_tabs |
---|---|
|
|
Before formatting | After formatting, leave_multiple |
---|---|
|
|
Before formatting | After formatting, leave_all |
---|---|
|
|