Resolve "JATS generation error"
This fixes the errors noted by Vignesh in #1257 (closed).
What's going on here is a little tricky. What we're getting from XSweet is different from what we were getting – there are a number of attributes coming in on the HTML that weren't there before. These changes strip those out. There's another issue that comes in with these documents: we can get HTML that's in the form like this:
<h4>Header</h4>
<a href="#link">Link</a>
where the <a>
doesn't have a block-level tag. This is valid HTML; it leads to invalid JATS. A complication is that this isn't actually valid inside of Wax; if you make any change in the text, it will change it to this:
<h4>Header</h4>
<p><a href="#link">Link</a></p>
and export to JATS is error-free. So most of these errors only show up if you export JATS immediately after importing (before making any changes in the editor). I have a query in to Christos to see if we can have Wax automatically reformat text coming in – that might actually be a better way to handle this.
This also wraps raw <img>
tags in <figure>
s so that they are properly exported.