Actually, I tested your example and Preview clearly shows the following error message.
So Preview is interpreting that text the exact same way gumbo did in Mend and Prettify.
And Sigil's well formed check detected the missing unclosed attribute value and the Validation window showed:
Code:
Section0001.xhtml Line 11: Offset N/A Message: Attribute "class" has unmatched quotes on attribute value. near column 15
Unfortunately, I did not design the whatwg/gumbo parser but it seems that missing quotes in attribute names is not a common enough occurence to create a better self mend process probably because real html does not need attributes to have quotes or even have any value.
Not much I can do here. Both Preview and Sigil's own Well-formed check indicate there is a problem and Sigils' own well-formed check even correctly identifies what is wrong.
In general making sure everything is well formed and that Checkpoints are made before running Mend or Mend and Prettify or any Sigil Tool is probably the best approach.