pandoc icon indicating copy to clipboard operation
pandoc copied to clipboard

Bidi -- rtl attributes on every tag in HTML?

Open jgm opened this issue 3 years ago • 2 comments

https://github.com/commonmark/commonmark-spec/issues/722 suggests that dir="auto" should go on every tag (unless of course this is overridden by local attributes). Would this be a desirable change to the HTML writer?

jgm avatar Oct 04 '22 15:10 jgm

MDN states:

The auto value should be used for data with an unknown directionality, like data coming from user input, eventually stored in a database.

Authors have control over directionality, so it is not unknown. Adding the attribute would seem like a slight misuse IMHO. Worst case, people can still use CSS, even though it's not recommended:

This attribute can be overridden by the CSS properties direction and unicode-bidi, if a CSS page is active and the element supports these properties.

tarleb avatar Oct 04 '22 19:10 tarleb

Hey! Using unicode-bidi is a reasonable compromise, using unicode-bidi: plaintext is ok, the problem is that not elements support this style (for example, the <ol><li>...<li/><ol/> tag). Using rtl isn't on option in my case, since I often combine RTL and LTR texts in my documents. I use Pandoc for automated conversion between markdown and HTML, so manually setting the attribute isn't on option.

What do you think about adding an argument to the tool for deciding if we want either none, rtl, tlr or auto for the dir?

yoelbassin avatar Dec 19 '23 21:12 yoelbassin