linkeddata / dokieli

:bulb: dokieli is a clientside editor for decentralised article publishing, annotations and social interactions
https://dokie.li/
Other
788 stars 81 forks source link

Consider removing `style` from attribute skipping in DOMNormalisation or introduce cases #359

Open csarven opened 1 year ago

csarven commented 1 year ago

DOMNormalisation has skipAttributes where the style attribute is intended to be skipped over (config.js), i.e., not preserved once the node tree is dumped (dumpNode in doc.js). Rationale being that inline style in HTML should be moved to external or internal styles.

That's generally okay but a bit strict for HTML nodes. It is also common to see inline style attribute in SVG trees. So, when SVG is embedded in HTML, and when the HTML document is passed through dumpNode, these styles are also stripped - not preserved.

Consider whether to remove style from skipping or introduce cases where it may be allowed, e.g., if style is used in a node that has svg as ancestor element.