Skip to content

"HTML strings must start with '<' character" warning broken in jQuery Migrate 1.2.0 #40

@gerrod

Description

@gerrod

Some of the HTML code generated in our project (via RequireJS + Handlebars) ends up badly formatted (with an empty line at the beginning) as shown in the attached screenshot.

Using jQuery Migrate 1.1.1, our console correctly shows the warning:

JQMIGRATE: $(html) HTML strings must start with '<' character 

However, upgrading to jQuery Migrate 1.2.0 breaks this warning; instead it produces an Uncaught TypeError after trying to run the rignoreText regular expression over the selector:

match = rignoreText.exec( selector );

The warning produced in the console is:

Uncaught TypeError: Cannot read property '1' of null

Here is a JSFiddle which demonstrates the problem. If you get rid of the jQuery Migrate 1.2.0 (under "External Resources") and switch back to 1.1.0 or 1.1.1, the problem does not exist.

Note: This could quite likely be the same problem as reported in Issue 39, but just wanted to be sure!

invalidhtml

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions