Has anyone fixed code blocks for RTL language pages? #347
dogweather
started this conversation in
General
Replies: 2 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
0 replies
-
|
not sure but might be related to this pr #301 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Here's the problem: when the page is, say, Hebrew, the codeblocks are also (incorrectly) shown in RTL:
I was able to fix this in the Ananke theme with this:
layouts/_default/_markup/render-codeblock.html{{ $class := .Attributes.class | default "" }} {{ $lang := .Attributes.lang | default .Type }} {{ if transform.CanHighlight $lang }} <div dir="ltr" class="{{ $class }}">{{ highlight .Inner $lang }}</div> {{else}} <pre dir="ltr"><code class="{{ $class }}">{{.Inner}}</code></pre> {{end}}This resolves the RTL problem, but it breaks the Hextra styling. It worked with Ananke, so I'm not why this doesn't work with Hextra:
Beta Was this translation helpful? Give feedback.
All reactions