In html (using html2 filter), if you have "<form> <span> text <input> text </span></form>", you get tags <s0>, <i1>, </s0> and if you paste that in the translation too, you'll get a tag validation error: bad nesting.
It considers <i1> a start tag, since it is not like '<i1/>', and thus expects an end-tag before </s0>.
Same for <br>
possible fixes:
<i1/>, <br1/> etc. (breaks existing translations!)
Diff:
There is an impedance mismatch between HTML's conception of tags and OmegaT's conception of tags (basically XML-like).
In my opinion it doesn't make sense to make the tag validation logic try to handle this, because it would need to understand the HTML spec to know what tags are OK to leave unclosed, and that is the filter's job.
I also don't like making tag validation too configurable, because it increases the user's burden. How can a user know what is valid and what's not? It will probably depend on the specific project and maybe even differ between files in the same project.
Thus I think the correct thing to do is ensure that the HTML filter outputs tags compatible with OmegaT's tag format; this is your suggestion (2). Yes it's breaking, but that isn't necessarily disqualifying.
A bigger idea is to allow filters to particpate in the validation process somehow. Obviously knowledge of what HTML tags can be standalone belongs in the HTML filter; it makes sense then that the HTML filter should know if tags in the translation are valid.
Actually "1. don't complain if the source has no closing tag either" is a reasonable idea too. I don't expect it will be easy to implement though.
I implemented 1.
It was a fairly simple fix.
Fixed in OmegaT 5.3.0.