When DT creates HTML from Markdown (either explicitly with the “convert to” function or implicitly when previewing MD), the html
element does not contain a lang
attribute. It does, however, set the dir
attribute to auto
, thus burdening the browser with determining the writing direction.
In my opinion, DT should set the lang
attribute and a meaningful dir
value when converting MD to HTML.
lang
is required for assistive technologies – without it, a screen reader wouldn’t know which language the document is written in, which makes reading it kind of difficult.lang
is required by the browser if the user wants hyphenated text. Without knowing the language, hyphenation is not possible.
As a default, the lang
attribute could be deduced from the system-wide locale. As Multimarkdown 6 provides for a Language
metadata key, the user should be able to use that if they want to override the default. That way, a user could indicate that a particular MD file is written in (eg) French, although their system-wide locale is (eg) German.