Clean up invalid elements (a/img without attrs, empty inline ones) after filtering.
Check more precisely whether result of auto paragraphing or transformation of rejected element to p/div is correct and fix if not.
Merge branch 't/10073' into major