Skip to content

When a script has attributes on a new line, the document doesn't parse. #19

Description

@TickleThePanda

I wanted to add jquery to a particular page. The following snippet caused a parse error:

<script src="https://code.jquery.com/jquery-3.1.1.min.js"
    integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
    crossorigin="anonymous">

Error:

Jan 22 12:56:10 4986-11937-2229 node[17019]: /**/node_modules/htmling/lib/parser.js:7782
Jan 22 12:56:10 4986-11937-2229 node[17019]: throw peg$buildException(null, peg$maxFailExpected, peg$maxFailPos);
Jan 22 12:56:10 4986-11937-2229 node[17019]: ^
Jan 22 12:56:10 4986-11937-2229 node[17019]: SyntaxError: Expected <content>, <include>, <script>, <template>, Custom Element, OutputStatement, Raw Content, comment or end of input but "<" found.

This doesn't occur if the script is all on one line, e.g.:

<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous">

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