Closed Hypercubed closed 6 years ago
Hmm, nice catch. I'll take a quick look this week and try to fix it.
So I took a (very belated...) look, and this totally makes sense. The computed styles are pulled from two sources: the inline style, and the resolved CSS styles. The resolved styles aren't part of the DOM, so they are not reflected in the output. One solution to this could be to add a applyComputedStyles
option to the .toDOM
method.
When using
.toJSON
withcomputedStyle: true
computed styles are copied to the[node].style
object. However, when using.toDOM
only the[node].attributes.styles
text is added to the element.