[openstreetmap/openstreetmap-website] Add dir=auto to user generated content (PR #3429)

Andy Allan notifications at github.com
Thu Jan 20 15:11:55 UTC 2022


> I was wondering about usernames, but they are displayed in a lot of places, and often in contexts where I'd be quite worried about the layout effects of them leaping to the far side of the page.

Hopefully they won't jump around much, due to the [text-align issue](https://github.com/openstreetmap/openstreetmap-website/issues/3432) if nothing else! But I think there aren't many cases were usernames are on their own with much freedom to roam around.

> Usernames are also often interpolated in longer strings - doe we just wrap them in a span with dir=auto within the wider string? Mark the whole wider string as auto?

I think just the username. If we mark the wider string as dir=auto and the username comes first, then it'll rearrange the remainder of the text too if the wider string contains punctuation. 

Contrived example:
`username commented yesterday! - block` could become `block! - username commented yesterday` if that username was in arabic, since the dir=auto would see the first character as arabic, and layout the wider string in three chunks RTL (`username commented yesterday ` first, then `! - `, then `block`). If just the username is dir=auto, then it won't scramble the rest of wider string.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/3429#issuecomment-1017607466
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/3429/c1017607466 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20220120/9b2953c7/attachment.htm>


More information about the rails-dev mailing list