unbalanced comments in field.html.tmpl script

RESOLVED INVALID

Status

()

Bugzilla
Bugzilla-General
RESOLVED INVALID
5 years ago
5 years ago

People

(Reporter: gfrancis1, Unassigned)

Tracking

Details

(Reporter)

Description

5 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4

Steps to reproduce:

The Summary for my Bug wasn't showing on the Bug page - then I noticed a script error on the page, so I read source of /template/en/default/bug/field.html.tmpl


Actual results:

@line 171

<script type="text/javascript">
        <!--
          initHidingOptionsForIE('[% field.name FILTER js %]');
          [%+ INCLUDE "bug/field-events.js.tmpl" field = field %]
        // -->
        </script>


Expected results:

<script type="text/javascript">
        <!--
          initHidingOptionsForIE('[% field.name FILTER js %]');
          [%+ INCLUDE "bug/field-events.js.tmpl" field = field %]
        -->
        </script>

Comment 1

5 years ago
No, you MUST write // -->, not --> alone, else the JS parser will fail, see

  http://www.w3.org/TR/html4/interact/scripts.html#h-18.3.2
Status: UNCONFIRMED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → INVALID
(Reporter)

Comment 2

5 years ago
Ok but then shouldn't <!-- be changed to //<!--   ?
(In reply to gfrancis1 from comment #2)
> Ok but then shouldn't <!-- be changed to //<!--   ?

The JavaScript engine allows the string "<!--" to occur at the start of a SCRIPT element, and ignores further characters until the end of the line.
You need to log in before you can comment on or make changes to this bug.