💥 feat!: force code blocks LTR rendering (#412)

BREAKING CHANGE: Code blocks default to LTR. Set `force_codeblock_ltr = false` to keep previous behaviour.
This commit is contained in:
Óscar 2024-10-18 16:34:11 +02:00 committed by welpo
parent 34514c1869
commit 092ccdd1ba
No known key found for this signature in database
GPG key ID: A2F978CF4EC1F5A6
8 changed files with 55 additions and 1 deletions

View file

@ -591,6 +591,14 @@ Setting `copy_button = true` will add a small copy button to the top right of co
Setting `add_src_to_code_block = true` enables the use of the [`add_src_to_code_block` shortcode](@/blog/shortcodes/index.md#show-source-or-path).
### Force Code Blocks LTR
| Page | Section | `config.toml` | Follows Hierarchy | Requires JavaScript |
|:----:|:-------:|:-------------:|:-----------------:|:-------------------:|
| ✅ | ✅ | ✅ | ✅ | ❌ |
By default, code blocks are rendered left-to-right, regardless of the overall text direction. Set `force_codeblock_ltr = false` to allow code blocks to follow the document's text direction. Useful for RTL languages needing RTL code blocks.
### KaTeX Support
| Page | Section | `config.toml` | Follows Hierarchy | Requires JavaScript |