grunt-usemin icon indicating copy to clipboard operation
grunt-usemin copied to clipboard

fix bug: matching scripts in htmlmined html file

Open ytxiuxiu opened this issue 10 years ago • 4 comments

The original regex for matching <script src="..." in html file can only match script tags in different lines. If the content of a html file (for example a html file which has been htmlmined) looks like this:

<script src="js/vendor-437841c1.js"></script><script src="js/script-9d21274e.js"></script>

It can not be matched correctly. New regex could solve this problem.

ytxiuxiu avatar Apr 07 '16 10:04 ytxiuxiu

so it needs a non-greedy lookup? I suppose this is one way of doing it. Once actual html parsing is in then this shouldn't be needed.

eddiemonge avatar Apr 07 '16 21:04 eddiemonge

@eddiemonge Sorry, I didn't get why this shouldn't be needed once actual html parsing is in?

ytxiuxiu avatar Apr 07 '16 22:04 ytxiuxiu

Once we can parse the html then most of the regexes won't be required since we will be able to do something like document.script.src

eddiemonge avatar Apr 07 '16 23:04 eddiemonge

@eddiemonge Cool! Get it, thanks!

ytxiuxiu avatar Apr 07 '16 23:04 ytxiuxiu