Add local editor classes and styles to inline styling in resulting HTML

1/2 - needs more improvements and optimizations - although it works already
This commit is contained in:
iliajie
2023-06-18 03:23:02 +03:00
parent 8d595a7ac5
commit a268373550
2 changed files with 28 additions and 3 deletions

View File

@@ -0,0 +1,6 @@
/*!
computed-style-to-inline-style v3.0.0 (https://github.com/lukehorvat/computed-style-to-inline-style)
Copyright (c) 2016 Luke Horvat
Licensed under MIT (https://github.com/lukehorvat/computed-style-to-inline-style/blob/master/LICENSE)
*/
!function(e,t){if("function"==typeof define&&define.amd)define(["module"],t);else if("undefined"!=typeof exports)t(module);else{var o={exports:{}};t(o),e.computedStyleToInlineStyle=o.exports}}(this,(function(e){var t=Array.prototype.forEach;e.exports=function e(o){var r,i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!o)throw new Error("No element specified.");n.recursive&&(i=o.children,t).call(i,(function(t){e(t,n)}));var l=getComputedStyle(o);(r=n.properties||l,t).call(r,(function(e){o.style[e]=l.getPropertyValue(e),o.removeAttribute("class"),o.removeAttribute("id")}))}}));