New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
close tag of A span multi lines #5433
Comments
@hisland It's because |
It's the same in 1.15.2. Prettier 1.15.2 --parser html
--single-quote Input: <p>'print-width' parameter is set to 80</p>
<p>if line lenght/width is under 81 characters: closing 'a' tag is fine</p>
<a href="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">line is 79 characters</a>
<a href="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">line is 80 characters</a>
<a href="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">line is 81 characters</a>
<p>if line lenght/width is over 81 characters: closing 'a' tag is broken over 2 lines:</p>
<a href="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">line is 82 characters</a> Output: <p>'print-width' parameter is set to 80</p>
<p>if line lenght/width is under 81 characters: closing 'a' tag is fine</p>
<a href="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">line is 79 characters</a>
<a href="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">line is 80 characters</a>
<a href="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">line is 81 characters</a>
<p>
if line lenght/width is over 81 characters: closing 'a' tag is broken over 2
lines:
</p>
<a href="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
>line is 82 characters</a
> Expected behavior: |
@paolovanini It sounds like the same concept as #5377, can you move your comment there? |
@ikatyang : I don't think it's the same issue. It's not a problem with the alignment of a tag and its corresponding closing tag but that the single closing a tag (</a>) it's divided in 2 different lines. |
through the spec, I know that end-tag can contain white-space, so |
@hisland : that kind of formatting could be valid according to the spec but I never seen in use before :-) |
@hisland Sounds like this issue can be closed? @paolovanini #5377 is about using |
@paolovanini the link can answer your doubt |
I'm confused. What's the difference between
and
? |
Oh, I should understand your issue now. As mentioned by @hawkrives, it's because Prettier 1.15.2 --html-whitespace-sensitivity ignore
--parser html Input: <p>'print-width' parameter is set to 80</p>
<p>if line lenght/width is under 81 characters: closing 'a' tag is fine</p>
<a href="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">line is 79 characters</a>
<a href="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">line is 80 characters</a>
<a href="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">line is 81 characters</a>
<p>if line lenght/width is over 81 characters: closing 'a' tag is broken over 2 lines:</p>
<a href="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">line is 82 characters</a> Output: <p>'print-width' parameter is set to 80</p>
<p>if line lenght/width is under 81 characters: closing 'a' tag is fine</p>
<a href="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">line is 79 characters</a>
<a href="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">line is 80 characters</a>
<a href="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">line is 81 characters</a>
<p>
if line lenght/width is over 81 characters: closing 'a' tag is broken over 2
lines:
</p>
<a href="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">
line is 82 characters
</a> |
Yeah ! That's what I need, because I style tag-a as a block-element, which don't care the whitespace around it. Thank You Very Much! |
@ikatyang : the option you suggested seems to resolve my problems with the closing tags:. |
Prettier 1.15.1
Playground link
Input:
Output:
Expected behavior:
see the output above, '#ok_sample'
The text was updated successfully, but these errors were encountered: