<?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>20974</bug_id>
          
          <creation_ts>2013-02-12 11:45:06 +0000</creation_ts>
          <short_desc>Comments including meta tag</short_desc>
          <delta_ts>2013-02-13 18:13:41 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Validator</product>
          <component>check</component>
          <version>HEAD</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="iaack">iaack</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>mike</cc>
          
          <qa_contact name="qa-dev tracking">www-validator-cvs</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>82983</commentid>
    <comment_count>0</comment_count>
    <who name="iaack">iaack</who>
    <bug_when>2013-02-12 11:45:06 +0000</bug_when>
    <thetext>The validator fails to handle comments including meta tags like this

&lt;!DOCTYPE html&gt;
&lt;title&gt;&lt;/title&gt;

&lt;!--
 &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=Shift_JIS&quot;&gt;
--&gt;

After validated, This text will be changed to

&lt;!DOCTYPE html&gt;
&lt;title&gt;&lt;/title&gt;

&lt;!--
 &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt;&lt;!-- &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=Shift_JIS&quot;&gt; --&gt;
--&gt;

The error message is following

Consecutive hyphens did not terminate a comment. -- is not permitted inside a comment, but e.g. - - is.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82996</commentid>
    <comment_count>1</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2013-02-12 13:46:59 +0000</bug_when>
    <thetext>Thanks for reporting this. It seems to be a bug in the legacy validator code, because you&apos;re using http://validator.w3.org/ to check your document. I recommend that you don&apos;t use that but instead use http://validator.w3.org/nu/

The code for the legacy validator at http://validator.w3.org/ is not code I work on but as far as I can see it appears to be doing some pre-processing on the input it sends to the HTML5 backend. The way to avoid that broken preprocessing is to instead use the UI at http://validator.w3.org/nu/ which sends the input to the same HTML5 backend but without doing any preprocessing.

I&apos;ll try to get this bug in the legacy validator fixed but I think it&apos;s likely I&apos;ll do that simply by having the request redirected to http://validator.w3.org/nu/ so that the preprocessing gets bypassed completely.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83093</commentid>
    <comment_count>2</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2013-02-13 08:02:18 +0000</bug_when>
    <thetext>Ville, I can reproduce this bug with the doctype set to HTML4, so this isn&apos;t a bug in the HTML5 backend or in the REST API for the HTML5 validator but rather it seems a bug in some preprocessing step in the validator perl code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83113</commentid>
    <comment_count>3</comment_count>
    <who name="Ville Skyttä">ville.skytta</who>
    <bug_when>2013-02-13 18:13:41 +0000</bug_when>
    <thetext>That&apos;s right, I took a brief look at it too. The culprit is override_charset() which does a simple text replacement without any &quot;intelligence&quot; whatsoever and thus has no idea about the context it is working in. I&apos;m afraid it&apos;ll take more than a few lines of code to fix this.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>