zzyengineer / google-code-prettify

Automatically exported from code.google.com/p/google-code-prettify
Apache License 2.0
0 stars 0 forks source link

HTML highlighter bugs on multiple <script> tags #101

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
To illustrate, multiple non-`script` tags works fine:

    <element name="value"></element>
    <element name="value"></element>

But multiple `script` tags bugs the highlighter, see the pattern:

    <script name="value"></script>
    <script name="value"></script>

and

    <script name="value"></script>
    <script name="value"></script>
    <script name="value"></script>

and

    <script name="value"></script>
    <script name="value"></script>
    <script name="value"></script>
    <script name="value"></script>

here's a real world example:

    <!doctype html>
    <html lang="en">
        <head>
            <script type="text/javascript"
src="http://example.com/one.js"></script>
            <script type="text/javascript"
src="http://example.com/two.js"></script>
            <script type="text/javascript">
                $(document).ready(function() {
                    alert('waa');
                });
            </script>
        </head>
        <body></body>
    </html>

Look like a bug in some sort of XSS filter, if any.

Original issue reported on code.google.com by balusc on 8 Dec 2009 at 6:56

GoogleCodeExporter commented 9 years ago
What is the problem you're seeing?

Original comment by mikesamuel@gmail.com on 8 Dec 2009 at 7:45

GoogleCodeExporter commented 9 years ago
You can find a live example here:
http://meta.stackoverflow.com/questions/32029/syntax-highlighter-bugs-on-multipl
e-script-tags

Original comment by balusc on 8 Dec 2009 at 7:46

GoogleCodeExporter commented 9 years ago
Thanks.  http://code.google.com/p/google-code-prettify/source/detail?r=92 may 
have 
already fixed the issue.  I'll check when I have a spare minute.

Original comment by mikesamuel@gmail.com on 8 Dec 2009 at 8:19

GoogleCodeExporter commented 9 years ago
I tried your example and it seems to work at revision 92.  Please reopen this 
issue
if upgrading doesn't solve your problem.

Original comment by mikesamuel@gmail.com on 10 Dec 2009 at 6:09