Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bidi support of lists #309

Open
ahangarha opened this issue Jul 24, 2021 · 1 comment
Open

Bidi support of lists #309

ahangarha opened this issue Jul 24, 2021 · 1 comment

Comments

@ahangarha
Copy link

I have checked Inline markup and bidirectional text in HTML and Structural markup and right-to-left text in HTML for bidi support but couldn't find anything related to list items (ul, ol, li).

What should be the standard way of adding bidi support to lists? As per my understanding, we need to add dir="auto" to ul or ol but also each li should also have some way to support bidi. What should be done specially when different items are in different languages; some start with RTL and some with LTR.

@aphillips
Copy link
Contributor

This is an interesting comment.

The dir for a list (e.g. ol or ul) provides the paragraph direction for each of the list items. Setting dir on an individual li element overrides that direction for that specific list item.

The challenge here is that the content of a list item and the handling/alignment/decoration of the list item probably ought to be separate. Consider this list:

<ul dir=ltr>
   <li>This is left to right
   <li dir=rtl>هذا من اليمين إلى اليسار 
</ul>

The bullet decoration on the second (arabic) item displays on the right side. To get consistent presentation and still get proper bidi one needs to have a span or bdi for the content:

<ul dir=ltr>
   <li>This is left to right
   <li><span dir=rtl>هذا من اليمين إلى اليسار </span>
</ul>

@r12a This is similar to our discussions of the handling of quote marks on the q element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants