Closed Munter closed 9 years ago
This might be fixed in 1.0.0 - but do you think you can create a test/fixture/script-esc.src.html and test/fixture/script-esc.result.html and it'll be automatically tests to check...
This PR doesn't really seem relevant anymore, seeing as that string replacement had been refactored away.
Is the expected result of inlining <script src="https://cdn.rawgit.com/zloirock/core-js/master/client/shim.min.js"></script>
really <script></script>
?
No. It should put the contents of script inline, but ignore minified scripts. So that's a new bug!
In issue #11 @mathiasbynens points out that the escaping of script end tags in the script source only covers one of three cases.
I discovered that there are actually more cases, since white space is apparently allowed between
</
andscript
.This update should cover all those cases.
By the way I stumbled upon this project because the html5boiler plate npm build system references it. I am working on a project called assetgraph, which is a build system toolkit, and thought inliner would be a fun example for one of many tools that all need pretty much to do the same, and where assetgraph covers over 95% of the work already. My reimplementation of inliner can be found here: https://github.com/Munter/buildfu/blob/master/bin/inline
Thanks for the inspiration :)