akalongman / sublimetext-codeformatter

Code Formatter plugin for ST2/ST3
MIT License
773 stars 130 forks source link

Void tags not closing properly #210

Closed fernandobandeira closed 8 years ago

fernandobandeira commented 8 years ago

I've noticed that the formatter is forcing the images to the XHTML syntax, for example:

<img alt="test" src="test" title="test">
    <span>
        test
    </span>

ctrl + alt + f

<img alt="test" src="test" title="test">
    <span>
        test
    </span>
</img>

If there's a need to support XHTML should'nt it format like this?

<img alt="test" src="test" title="test"/>
<span>
    test
</span>

AFAIK:

html5 <img src="test"> html5 supports, xhtml <img src="test"/> xhtml only <img src="test"></img>

This only happens if the img is in this format: <img src="test"> and there's any text/html(anything) after it, if the image is like <img src="test"/> it doesn't change

fernandobandeira commented 8 years ago

It's not only with images, this happens with any element that doesn't have a closing tag, for example:

a
<br>
b

ctrl + alt + f

a
<br>
    b
</br>

same happens with the <link>tag

akalongman commented 8 years ago

Show me full html file example please