Skip to content

checkNodes function has incorrect regex #15

Description

@TotallyInformation

checknodes.js - node-red/node-red-dev-cli - GitHub1s

/<script.+?type=['"]text\/javascript['"].*?>([\S\s]*?)<\/script>/ig

This does not match valid HTML v5 javascript script tag which may not have the type attribute set.

From MDN:

The HTML5 specification urges authors to omit the attribute rather than provide a redundant MIME type.

This results in:

    ---Validating Nodes---
Unable to parse  nodes/wiser.js
Unable to parse  nodes/wiser-listen.js

It would probably be better to have a negative check to eliminate script tags that have type="text/html" or the older red attributes.

Activity

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

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