-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
I am trying to parse the following html
<!-- build:js scripts/combined.concat.min.js-->
<!-- some comment -->
<script type="text/javascript" src="scripts/this.js"></script>
<script type="text/javascript" src="scripts/that.js"></script>
<!-- endbuild-->As you can see there are no spaces after scripts/combined.concat.min.js and that's why the parsed html looks like this (the value of the "parsed" variable from src/index.js 178:7)
{
"type": "js",
"target": "scripts/combined.concat.min.js-->",
"attbs": "<!-- some comment"
}I found that the reason in the following part of the "regbuild" regular expression
var regbuild = /<!--\s*build:(\w+)(?:\(([^\)]+)\))?\s*([^\s]+)?\s*(?:(.*))?\s*-->/;The attribute group is not lazy. Making it lazy solves this issue, however, there are tests that fail.
Metadata
Metadata
Assignees
Labels
No labels