[html highlight] Warnings in console if script or style block contains HTML-like strings #3328

Closed
peterflynn opened this Issue Apr 3, 2013 · 7 comments

Comments

Projects
None yet
4 participants
Member

peterflynn commented Apr 3, 2013

Launch Live Preview with this content:

<!doctype html>
<html>
<head>
    <title>Some other page</title>

    <script>
        function foo() {
            return "<h2></h2>";
        }
    </script>

    <style>
        .xyzzy {
            content: "<div></div>";
        }
    </style>

</head>
<body>

    <h2>Some other stuff</h2>

    etc. etc. etc.

</body>
</html>

Result: a series of console warnings are printed by DOMAgent, of the form "Skipping Source Node at..." and "Matching Parent not at..."

However, highlighting seems to work correctly.

Expected: no console warnings.

Member

peterflynn commented Apr 3, 2013

I believe this is all valid HTML... afaik CDATA or <!--// type wrappers are only needed if the exact text </script> or </style> appears somewhere in embedded the content -- other HTML-like things should be ignored. If I view the page in the browser, it doesn't seem to complain.

Member

peterflynn commented Apr 3, 2013

Although fwiw if I do use the <!--// wrapper, CodeMirror's formatting is totally broken. Example:

    <script>
    <!--//
        function foo() {
            return "<script></script>";
        }
    //-->
    </script>
Contributor

RaymondLim commented Apr 6, 2013

Reassigned it to myself.

peterflynn was assigned Apr 7, 2013

Contributor

RaymondLim commented Apr 8, 2013

FBNC to @peterflynn

redmunds was assigned Apr 10, 2013

Contributor

redmunds commented Apr 10, 2013

I'll review this one.

Contributor

redmunds commented Apr 10, 2013

Confirmed. Closing.

redmunds closed this Apr 10, 2013

Member

peterflynn commented Apr 10, 2013

Thanks for verifying the fix @redmunds!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment