[openstreetmap/openstreetmap-website] `code` tags produced by markdown in user content do not follow direction of surrounding text (Issue #3762)

bgo-eiu notifications at github.com
Fri Oct 21 20:46:45 UTC 2022


### URL

https://www.openstreetmap.org/user/b-unicycling/diary/400151

### How to reproduce the issue?

This issue falls under the umbrella of #3427. This is related but different from the issue discussed in #3428 and for which a draft is posted at #3429.

When a user includes Markdown formatted to become `<code></code>` in a diary entry, this text is impacted by direction override styling which means that even with `dir="auto"` added to the overall diary content, the text will render only in the direction of the interface language, causing RTL characters to appear LTR in LTR interfaces and LTR characters to appear RTL in RTL interfaces. I think this might be coming from somewhere in Bootstrap, but I am not sure. In the CSS, this is the rule that needs to be removed from somewhere:

    pre, code, kbd, samp {
        direction: rtl /* presumably ltr in ltr layouts */
        unicode-bidi: bidi-override; /* this causes dir=auto to be ignored
    }
    
See for example in this recent diary entry:
https://www.openstreetmap.org/user/b-unicycling/diary/400151



### Screenshot(s) or anything else?

In the console here, I have applied corrections to the text alignment and direction of the overall diary entry, and the issue with `code` text is apparent:

![image](https://user-images.githubusercontent.com/100172442/197285762-da2a9e08-fbbe-4f8a-ae79-d8a71f6fe034.png)

This is after unchecking `unicode-bidi` in the console style panel:

![image](https://user-images.githubusercontent.com/100172442/197285852-46c8fa74-4d1a-43a7-b784-12a4be241d7e.png)


-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/3762
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/issues/3762 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20221021/c9e5ee68/attachment.htm>


More information about the rails-dev mailing list