Strip outer tags upon xsweet import
Manuscripts imported via xsweet are stored as a full HTML document, with DOCTYPE
, html
, head
and body
tags and metadata. This is very different to documents that are written up manually in Wax (or copy-pasted, etc), which are stored as a bare sequence of block-level tags (h1
, p
, img
, etc). The outer tags and metadata from xsweet are causing weirdness in Flax.
For consistency and ease of use we should strip all the outer tags and metadata from manuscripts at time of import from xsweet. The manuscript content is not a final, complete HTML document, so it doesn't make sense to treat it as though it is.
It looks as though the content we should retain from xsweet is only that within the <container id="main">
tag, but we need to confirm that no other sibling containers will be created with other content we might need. It would be nice if we could strip the container
tag as it's not standard HTML.