mirror of
https://github.com/google/styleguide.git
synced 2024-03-22 13:11:43 +08:00
Update the HTML Line-Wrapping guidance
This relaxes the guidance around indenting by 4 additional spaces and provides the Prettier format as one of the examples to ensure the style guide is compatible with the Prettier formatter.
This commit is contained in:
parent
d2cc2a7ec3
commit
453aca8c43
|
@ -447,9 +447,19 @@ instead of an error.)</p>
|
||||||
<p>While there is no column limit recommendation for HTML, you may consider
|
<p>While there is no column limit recommendation for HTML, you may consider
|
||||||
wrapping long lines if it significantly improves readability.</p>
|
wrapping long lines if it significantly improves readability.</p>
|
||||||
|
|
||||||
<p>When line-wrapping, each continuation line should be indented at least 4
|
<p>When line-wrapping, each continuation line should be indented to distinguish
|
||||||
additional spaces from the original line to distinguish wrapped attributes from
|
wrapped attributes from child elements. Lines should be wrapped consistently
|
||||||
child elements.</p>
|
within a project, ideally enforced by automated code formatting tools.</p>
|
||||||
|
|
||||||
|
<pre><code class="language-html good"><button
|
||||||
|
mat-icon-button
|
||||||
|
color="primary"
|
||||||
|
class="menu-button"
|
||||||
|
(click)="openMenu()"
|
||||||
|
>
|
||||||
|
<mat-icon>menu</mat-icon>
|
||||||
|
</button>
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
<pre><code class="language-html good"><button mat-icon-button color="primary" class="menu-button"
|
<pre><code class="language-html good"><button mat-icon-button color="primary" class="menu-button"
|
||||||
(click)="openMenu()">
|
(click)="openMenu()">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user