rse / node-inline-assets

Node API, CLI and Grunt Task for inlining external assets of HTML/CSS files
https://www.npmjs.org/package/inline-assets
18 stars 4 forks source link

Comment tags in HTML are not honoured. #6

Open willhartman opened 6 years ago

willhartman commented 6 years ago

If a script tag is commented out then the file backing it might not exist.

The utility still tries to grab the file even though it isn't needed for the HTML to render.

This causes an error which can be resolved by deleting the line instead of commenting it out.

The utility should ignore script tags that are inside HTML comment tags.

rse commented 6 years ago

Yes, I agree. But without a real parser this cannot be achieved easily. For a later version I'll check whether we can use an HTML Parser which generates an AST and work on this instead.