Code blocks are rendered RTL on RTL documentation pages

Open Beginner friendly
#57,476 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
css
Domain
documentation

Research direction

Start from the rendered https://kubernetes.io/fa page and inspect the CSS/styles applied to its code blocks and inline code elements. Confirm that the surrounding documentation remains RTL while both code blocks and inline code render LTR, then verify the result on the RTL documentation page.

Written by the indexing model from the issue text.

Description

area/localization area/web-development kind/bug priority/important-longterm triage/accepted

This is a Bug Report

Problem:

On RTL documentation pages, code blocks are also rendered in RTL direction.

Code examples should remain left-to-right (LTR) even when they are displayed on an RTL page. Code is not localized and its syntax, indentation, punctuation, and structure depend on LTR rendering.

Currently, applying RTL direction to the page also affects code blocks, which makes code examples harder to read and can negatively affect indentation, syntax, and the overall readability of the examples.

Proposed Solution:

Ensure that all code blocks and inline code elements use LTR direction, regardless of the text direction of the surrounding page.

For example, RTL pages should have:

  • Documentation text: RTL
  • Code blocks: LTR
  • Inline code: LTR

This could potentially be addressed through the CSS/styles applied to code elements on RTL pages.

Page to Update:
https://kubernetes.io/fa

A screenshot demonstrating the issue is attached below.

Image
Dominant language
HTML
Stars
5.4k
Forks
15.7k
Avg merge
4d 10h
Merged PRs (30d)
228

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from kubernetes/website

All issues in kubernetes/website

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.