welovewordpress / SublimeHtmlTidy

Tidy, clean and prettify your HTML code with this plugin for Sublime Text 2
GNU General Public License v2.0
88 stars 15 forks source link

HTML5 Support #7

Closed tqad closed 12 years ago

tqad commented 12 years ago

Hi,

Tidy throws Error if you use HTML5-Tags. But there is a workaround, just use the new-blocklevel-tags Parameter. 1) Fill in the get_supported_options definition an empty Parameter: 'new-blocklevel-tags' : ''. 2) Write in your htmltidy settings "new-blocklevel-tags" : "\"header, footer, article, section, hgroup, nav, figure\""

Hope it helps. Best regards Tariq

welovewordpress commented 12 years ago

OK, I implemented support for the new-blocklevel-tags option for the tidy.exe as well as the php wrapper and added it to the default settings.

It will still throw a warning like

 Warning: <section> is not approved by W3C

but there is not much I can do about that - except maybe filtering the error log and hiding those lines. But it is completely safe to ignore these warnings.

Thanks for your help, Tariq

Matt

tqad commented 12 years ago

Hi Matt,

I ignore this warnings but maybe a filter would help, anyway it don't disturbe me much.

But I researched about HTML5 and Tidy, and I could complete this list: "new-blocklevel-tags" : "\"section,header,footer,hgroup,nav,dialog,datalist,details,figcaption,figure,meter,output,progress\"", "new-pre-tags": "\"article,aside,summary,mark\"", "new-inline-tags": "\"video,audio,canvas,source,embed,ruby,rt,rp,keygen,menu,command,time\""

Have a nice day :) Tariq

welovewordpress commented 12 years ago

Thanks for your reseach, Tariq!

I just implemented this list.

sas101 commented 12 years ago

I think there is still the "i"-tag missing. When using the current version of the plugin, my i-tags got removed. Besides that it looked good with HTML5.

welovewordpress commented 12 years ago

@ssimroth I'm afraid I cannot reproduce this. I tried all kinds of i, b, em and other tags, and they all behave the same - as inline tags.

But Tidy should not remove any tags - at least not with the default settings. It might complain about html5 tags, but these are just warnings, which need to be ignored.

If the problem persist, please file another issue and post your console log. Thanks.