Closed mrtnpro closed 9 years ago
See https://github.com/middleman/middleman-minify-html/pull/26#issuecomment-57267749, Middleman can handle inline CSS/JS without this extension.
Never made its way into the docs, let me fix that...
Thanks! This worked for me.
However, when I use activate :minify_css
it also tries to compile inline javascript strings that contain the word style
– e.g.:
<javascript>
return c.innerHTML="x<style>"+b+"</style>"
</javascript>
which results in a sass compiling error:
error build/index.html
Invalid CSS after "": expected selector or at-rule, was "', rule, '"
(sass):1
I realised that if i split the string style
, it works fine, e.g:
return c.innerHTML="x<sty'+'le>"+b+"</sty'+'le>"
Unfortunately this is a 3rd party javascript (modernizr) that I'm adding here, which I'd rather not like to modify or hotfix. Any idea how I could prevent sass from compiling javascript strings that contain the keyword style
when using activate :minify_css
?
See https://github.com/middleman/middleman/pull/1386, soon we can hopefully use Oga to parse HTML instead of the regexes currently in use.
Is there a way to compress inline CSS and JS? The Htmlcompressor documentation says there is an option called
compress_css
andcompress_javascript
, however when I try to use any one of them I get a runtime error during my build.That's what I've tried so far:
Runtime error: