This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 13653 - For PRE element "In the HTML syntax, a leading newline character immediately following the pre element start tag is stripped." The same should hold true for code also, when use inside a pre (<pre><code> my code </code></pre>) If not in the spec, could you
Summary: For PRE element "In the HTML syntax, a leading newline character immediately ...
Status: RESOLVED WONTFIX
Alias: None
Product: HTML WG
Classification: Unclassified
Component: LC1 HTML5 spec (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-04 01:41 UTC by contributor
Modified: 2011-08-05 14:50 UTC (History)
3 users (show)

See Also:


Attachments

Description contributor 2011-08-04 01:41:09 UTC
Specification: http://dev.w3.org/html5/spec/Overview.html
Multipage: http://www.whatwg.org/C#top
Complete: http://www.whatwg.org/c#top

Comment:
For PRE element

"In the HTML syntax, a leading newline character immediately following the pre
element start tag is stripped."

The same should hold true for code also, when use inside a pre (<pre><code>
my code
</code></pre>)

If not in the spec, could you add it?

Reason: same as for <pre>: code readibility

Posted from: 89.157.69.5
User agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30
Comment 1 Michael[tm] Smith 2011-08-04 05:05:03 UTC
mass-moved component to LC1
Comment 2 Simon Pieters 2011-08-05 14:50:28 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: no spec change
Rationale: The line stripping is done because it's what browsers did prior to specifying the parsing rules. Browsers don't do it for <code>. Changing this would affect existing sites that use <pre><code>\n and expect a leading newline.