SubEthaEdit icon indicating copy to clipboard operation
SubEthaEdit copied to clipboard

Re-Indent doesn't cope well with HTML5 elements that don't require close tags

Open th-in-gs opened this issue 4 years ago • 3 comments

See attached images.

If I add a trailing / to the meta, link, and source tags, re-indent works. But they should not be necessary.

Screen Shot 2021-01-30 at 9 13 33 AM

th-in-gs avatar Jan 30 '21 17:01 th-in-gs

This is with App Store version 5.1.7 (9734) on macOS 11.1 (20C69).

th-in-gs avatar Jan 30 '21 17:01 th-in-gs

Actually I rather liked it that way so the html gets improved when using the feature, and you quickly can spot missing closures on the folding ribbon. But of course there would be the possiblity for an option to not do that.

And of course all of this is from a time when we thought XHTML would win eventually, and there the closing is all but optional.

monkeydom avatar Jan 31 '21 06:01 monkeydom

Ah, it is even worse. It is optional in spec, and in HTML it was technically invalid even to close such a tag.

We should probably make XHTML a different mode then, and make HTML adhere to the HTML5 rules.

See http://xahlee.info/js/html5_non-closing_tag.html

monkeydom avatar Apr 10 '21 15:04 monkeydom