HTML5 main Element

One of the newer elements in HTML5 is the “main” element. Unfortunately, the syntax checker doesn’t recognise it, and marks the opening tag as an error; it then marks the closing tag with a warning.

Is there any way to convince Komodo Edit that it’s OK to use main?

Thanks,

Mark

Not ideal but try switching from using tidy for syntax checking to html5lib under Prefs > Syntax Checking > Html5

eg. http://files.naatan.com/1csv/18RN6BwA

Note I did not implement this and am not sure what the limitations are between either options, hopefully @toddw will be able to explain that better.

Thanks for your reply.

I set the options as you suggest, and it does indeed let “main” pass. Unfortunately, it also lets everything else pass, such as <thing>. I take that to suggest that html5lib is not actually working.

I notice that on your screenshot that you’re using a Mac, which is also my case. I checked inside the Komodo app, and the html5lib appears to be present.

Thanks

I just added support for the main element:
  https://github.com/Komodo/KomodoEdit/commit/3db07b49974f67422c42120e97d1df9e8b9733b2 (trunk)

You could tweak your koHTMLLinter.py file (in your Komodo 8.5 installation) to add that element too.

Cheers,
Todd

Just want to let you know I changed koHTMLLinter.py. I was afraid to do this, because I was afraid to destroy my Komodo installation. But for everybody else who’s possibly afraid to try this: it’s really easy. And that ‘main’ error is gone.
Thanks for the tip!

Man, I was understand your afraid if this fix will be created by non-developer, but in this case this fix was created by @toddw, so it means fix will be worked and fix will not break your Komodo. (because developer’s in most cases test they fixes before push it to main repository or a program ;))

I think maybe I was a bit unclear. It was not the fix I was afraid of. I was afraid to do something wrong myself with a good fix, because I’ve no experience at all with python. That’s why I wrote my reply, because maybe there are more people who know css, html and JavaScript, but have no experience with python.

1 Like

If somebody afraid to change something in python files because they are don’t know Python as is - they are can download files contrib/catalogs/html5/html5.dtd and src/lint/koHTMLLinter.py from repository and just override it with original files in Komodo installation dir :wink: