html - CSS Inliner in Javascript (premailer) -
i use ckeditor 4 , want filter html content insert style directly in html elements mailchimp css inliner (http://beaker.mailchimp.com/inline-css). have in javascript must, idea?
i can use jquery , prototypejs.
i can't use external api.
my test jsfiddle ckeditor (on paste) : http://jsfiddle.net/epokk/utw8k/7/
in :
<style> .test { outline: 1px solid red; } </style> <div class="test">hello</div>
out :
<div style="outline: 1px solid red;">hello</div>
i find solution : http://tikku.com/scripts/websites/tikku/css_inline_transformer_simplified.js trick opens tab , blocked default in firefox ...
api solution : http://premailer.dialect.ca/
i created simple css styles inliner - styliner.
it works on firefox , chrome. may work on ie9+ , safari 6, haven't tested yet. version not need new window - uses iframe (so may not work on ie - needs tricks make iframes work :).
it lacks support css specificity, @ least now, use it, have sort rules manually. maybe i'll find time add feature soon.
Comments
Post a Comment