<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>21711</bug_id>
          
          <creation_ts>2013-04-16 08:57:24 +0000</creation_ts>
          <short_desc>Unclear statement regarding inclusion of newlines in &lt;pre&gt; and &lt;textarea&gt;</short_desc>
          <delta_ts>2014-01-16 15:10:16 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>CR</keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Robin Berjon">robin</reporter>
          <assigned_to name="Robin Berjon">robin</assigned_to>
          <cc>erika.doyle</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>rubys</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>86277</commentid>
    <comment_count>0</comment_count>
    <who name="Robin Berjon">robin</who>
    <bug_when>2013-04-16 08:57:24 +0000</bug_when>
    <thetext>&quot;A single newline may be placed immediately after the start tag of pre and textarea elements. This does not affect the processing of the element. The otherwise optional newline must be included if the element&apos;s contents themselves start with a newline (because otherwise the leading newline in the contents would be treated like the optional newline, and ignored).&quot;

http://www.w3.org/html/wg/drafts/html/master/syntax.html#element-restrictions

If it&apos;s in the content then it must be included because if it weren&apos;t included it would be ignored? What is meant is that two newlines need be included.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86316</commentid>
    <comment_count>1</comment_count>
    <who name="Sam Ruby">rubys</who>
    <bug_when>2013-04-16 21:17:40 +0000</bug_when>
    <thetext>I believe I can shed some light on the history of this statement.  Obviously, reword it to taste.

When I was exploring the differences between XHTML and HTML, I noticed that while all newlines are significant in XHTML, the first newline of pre elements are ignored.  What you generally see in HTML is a &lt;pre&gt; on a separate line, one or more lines of text, and a &lt;/pre&gt; again on a separate line.

In XHTML, this results in a blank line preceding the text.

I brought this up to Ian as something that wasn&apos;t (then) covered by the spec, and he added a paragraph (I haven&apos;t followed closely to see if it since changed).

Net effect: consuming applications of HTML must ignore the first character in the the &lt;pre&gt; and &lt;textarea&gt; elements if that character is a newline.

HTML producing applications can optionally add a newline in front of the value, but only are required to do so if the first character of that value is a newline.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91033</commentid>
    <comment_count>2</comment_count>
    <who name="Erika Doyle Navara">erika.doyle</who>
    <bug_when>2013-07-20 00:08:27 +0000</bug_when>
    <thetext>

EDITOR&apos;S RESPONSE: This is an Editor&apos;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: Accepted

Change Description: Here&apos;s my attempt at rewording that final sentence:

A single newline may be placed immediately after the start tag of pre and textarea elements. This does not affect the processing of the element. If the element&apos;s contents are intended to start with a newline, two consecutive newlines thus need to be included by the author.

Master: https://github.com/w3c/html/commit/d601f6af9914aa0dadd3277c8771ed46995f61de

Cherry-pick to CR:
https://github.com/w3c/html/commit/8963a19d002ff90eba546c61f39a3d9ab4d07eda

Rationale: Rewording for to improve clarity for web authors for both HTML5 CR and 5.1 drafts. I didn&apos;t differentiate this HTML quirk from the same scenario in XHTML, as it seems sufficiently implied by this being situated in section 8 &quot;The HTML Syntax&quot; (as opposed to Section 9 &quot;The XHTML Syntax&quot;).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98583</commentid>
    <comment_count>3</comment_count>
    <who name="github bugzilla bot">sideshowbarker+gitzilla</who>
    <bug_when>2014-01-16 15:10:16 +0000</bug_when>
    <thetext>Commit pushed to CR at https://github.com/w3c/html

https://github.com/w3c/html/commit/d601f6af9914aa0dadd3277c8771ed46995f61de
[Bug 21711] : Clarify statement regarding newlines in &lt;pre&gt; and &lt;textarea.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>