theZiz / aha

Ansi HTML Adapter
Other
915 stars 88 forks source link

Use doctype HTML5 instead of XHTML #58

Closed dannagle closed 5 years ago

dannagle commented 5 years ago

An HTML5 header would be far more preferable than an XHTML header.

theZiz commented 5 years ago

I guess you are right, but you already noticed the problem in the source (which I doesn't like tbh) that a language tag is suggested by the standard. I could just choose the language environment variable and add an option to overwrite this with an own language. I could use LANG or LC_MESSAGES. Both are de_DE.UTF-8 for me, so I could ignore everything starting with _. What do you think? Does this work on non-Linux unix like operating systems like BSD, too?

dannagle commented 5 years ago

Internet Explorer triggers legacy rendering techniques if HTML5 doctype is not specified, which is why I made this tweak.

I think leaving it off is the correct answer. You don't know the language, so don't specify it. Trying to figure out the language based on an environment variable or file paths is highly OS-specific, and even then it could still be wrong. The user could be sending a foreign language output to the tool.

I think the best fix would be to leave it blank and have a command line option that allows them to specify the language string if they want it.

My understanding is that lang attribute is for search engines and screen readers. Screen readers will assume system language if lang is not specified, so that is a good built-in fallback. If users of this tool really cared about making search engines happy, they'd supply their own header, and you already have that option.

theZiz commented 5 years ago

Internet Explorer triggers legacy rendering techniques if HTML5 doctype is not specified, which is why I made this tweak.

Wow. :scream:

I think leaving it off is the correct answer. You don't know the language, so don't specify it. Trying to figure out the language based on an environment variable or file paths is highly OS-specific, and even then it could still be wrong. The user could be sending a foreign language output to the tool. I think the best fix would be to leave it blank and have a command line option that allows them to specify the language string if they want it. My understanding is that lang attribute is for search engines and screen readers. Screen readers will assume system language if lang is not specified, so that is a good built-in fallback. If users of this tool really cared about making search engines happy, they'd supply their own header, and you already have that option.

You are probably right, I will have a research myself but probably merge your change in the end. :wink:

dannagle commented 5 years ago

Pull request ok?

I'm cleaning up my GitHub tasks.

theZiz commented 5 years ago

I merged your PR, but made it optional with --no-xml or -x. Furthermore I added a language option. Thanks for your work!