HTML - Formatting Style
- Tabs and indents
- Processing Instructions
- Inside of tag header
- Around tags
- Maximum blank lines between tags
- Insert new line before
- Do not indent children of
- Do not indent children if tag size more than
- Keep white spaces inside
- Line breaks after start-tag and before end-tag in multiline elements
- Line breaks after start-tag and before end-tag in elements that contain other elements and no text
- Other
Tabs and indents
Indent style
Property names:
html_indent_style
, indent_style
Possible values:
Examples:
Indent size
Property names:
html_indent_size
, indent_size
Possible values:
an integer
Examples:
value: 0 |
<div>
·<div>
··text
·</div>
</div> |
value: 1 |
<div>
·<div>
··text
·</div>
</div> |
value: 2 |
<div>
··<div>
····text
··</div>
</div> |
Tab width
Property names:
html_tab_width
, tab_width
Possible values:
an integer
Examples:
value: 0 |
<div>
→<div>
→→text
→</div>
</div> |
value: 1 |
<div>
→<div>
→→text
→</div>
</div> |
value: 2 |
<div>
→<div>
→→text
→</div>
</div> |
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:
Space after last attribute
Property names:
[resharper_]html_space_after_last_pi_attribute
, [resharper_]space_after_last_pi_attribute
Possible values:
true | false
Examples:
Attributes format
Property names:
[resharper_]html_pi_attribute_style
, [resharper_]pi_attribute_style
Possible values:
-
on_different_lines
: Each attribute on separate lines -
do_not_touch
: Do not touch -
on_single_line
: On single line -
first_attribute_on_single_line
: First attribute on single line
Examples:
Attributes indenting
Property names:
[resharper_]html_pi_attributes_indent
, [resharper_]pi_attributes_indent
Possible values:
-
align_by_first_attribute
: Align by first attribute -
double_indent
: Double indent -
single_indent
: Single indent
Examples:
align_by_first_attribute |
<?xml·version='1.0'·encoding='utf-8'?> |
double_indent |
<?xml·version='1.0'·encoding='utf-8'?> |
single_indent |
<?xml·version='1.0'·encoding='utf-8'?> |
Blank line after processing instructions
Property names:
[resharper_]html_blank_line_after_pi
, [resharper_]blank_line_after_pi
Possible values:
true | false
Examples:
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:
Space after last attribute
Property names:
[resharper_]html_space_after_last_attribute
, [resharper_]space_after_last_attribute
Possible values:
true | false
Examples:
Space before '/>'
Property names:
[resharper_]html_space_before_self_closing
, [resharper_]space_before_self_closing
Possible values:
true | false
Examples:
Attributes format
Property names:
[resharper_]html_attribute_style
, [resharper_]attribute_style
Possible values:
-
on_different_lines
: Each attribute on separate lines -
do_not_touch
: Do not touch -
on_single_line
: On single line -
first_attribute_on_single_line
: First attribute on single line
Examples:
on_different_lines |
<a
··x='1'
··y='2'
··z='3'/> |
do_not_touch |
<a·x='1'·y='2'·z='3'/> |
on_single_line |
<a·x='1'·y='2'·z='3'/> |
first_attribute_on_single_line |
<a·x='1'
···y='2'
···z='3'/> |
Attributes indenting
Property names:
[resharper_]html_attribute_indent
, [resharper_]attribute_indent
Possible values:
-
align_by_first_attribute
: Align by first attribute -
double_indent
: Double indent -
single_indent
: Single indent
Examples:
Sort attributes
Property names:
[resharper_]html_sort_attributes
, [resharper_]sort_attributes
Possible values:
true | false
Examples:
true |
<div·class='a'
·····data-attr='3'
·····style='color:red'/> |
false |
<div·data-attr='3'
·····style='color:red'
·····class='a'/> |
Sort class selectors
Property names:
[resharper_]html_sort_class_selectors
, [resharper_]sort_class_selectors
Possible values:
true | false
Examples:
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:
Insert new line before
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 tag size more than
Property names:
[resharper_]html_no_indent_inside_if_element_longer_than
, [resharper_]no_indent_inside_if_element_longer_than
Possible values:
an integer
Examples:
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 |
<tag>
··text·text·text
··Text·text·text·text·text·text·text·text·text
</tag> |
false |
<tag>text·text·text
··Text·text·text·text·text·text·text·text·text</tag> |
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:
Other
Line feed at end of file
Property names:
html_insert_final_newline
, insert_final_newline
Possible values:
true | false