Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
TickleThePanda opened this issue Jan 22, 2017 · 0 comments

Comments

@TickleThePanda
Copy link

TickleThePanda commented Jan 22, 2017

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">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant