Skip to content

Inline Javascript gets broken via injected CDATA elements #176

@cxj

Description

@cxj

For some reason, under some (but not all) circumstances, Transphporm is wrapping my Inline Javascript with CDATA. This means both my Javascript gets broken, and my browser's console spews error messages like this one:

SyntaxError: Unexpected token '<' (anonymous function) — list-claims-form:168

The content at that point looks like this:

    <script><![CDATA[
        $("#payer-id-input").keyup(function (e) {
            var code = (e.keyCode ? e.keyCode : e.which);
            if (code == 39) { // right-arrow keycode
                e.preventDefault();
                $('#payer-picker-modal').modal();
            }
        });
    ]]></script>

I've got a working test case where the error is repeatable, although it's still larger than what would be easily posted here. I'll ZIP it up and attach it, if I can.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions