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:
Tony Ruscoe 2023-04-24 14:42:52 +01:00 committed by GitHub
parent d2cc2a7ec3
commit 453aca8c43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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">&lt;button
mat-icon-button
color="primary"
class="menu-button"
(click)="openMenu()"
&gt;
&lt;mat-icon&gt;menu&lt;/mat-icon&gt;
&lt;/button&gt;
</code></pre>
<pre><code class="language-html good">&lt;button mat-icon-button color="primary" class="menu-button" <pre><code class="language-html good">&lt;button mat-icon-button color="primary" class="menu-button"
(click)="openMenu()"&gt; (click)="openMenu()"&gt;