-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
HTML: fix pre's incomplete description #37540
Conversation
Preview URLs Flaws (23)URL:
External URLs (1)URL:
(comment last updated: 2025-01-13 10:42:18) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the great work, as always, @PassionPenguin!
So, for this one, I think your first conflict concern is OK — the wording provided is "represents preformatted text which is to be presented exactly as written". I think the stripping of the first blank line is intended to help with this — authors will appreciate being able to write their element content on separate lines to the opening and closing tags without having to worry about the leading newline character.
Also, note that the text following this line qualifies the exact behavior, so I think we are all good here. If you are still worried, you could maybe update "represents preformatted text which is to be presented exactly as written" to "represents preformatted text intended to be presented exactly as written", to signify that this is what the intent is, rather than the exact behavior?
For your second concern, I think this is valid — the whitespace line looks to be in conflict with your addition. To fix this, I would put the whitespace line into its own paragraph and combine it with your note, which I don't think needs to be a note.
So the second paragraph would read:
Whitespace inside this element is displayed as written, with one exception. If one or more leading newline characters are included immediately following the opening
<pre>
tag, the first newline character is stripped.
Let me know what you think. Thanks again!
Your suggestions are reasonable and awesome, and I'd updated the content to go with your suggestion! Thanks for your review~! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PassionPenguin Perfect; let's get this merged. Thanks again!
Description
<pre>
will drop the first blank line (if exists) immediately following its start tag.Motivation
per @Josh-Cena's comment #37384 (comment)
Additional details
<pre>
's HTML documentation: https://html.spec.whatwg.org/multipage/grouping-content.html#the-pre-element