Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTL config using MDX code block breaks formatting #545

Open
d-henn opened this issue Jan 4, 2024 · 1 comment
Open

RTL config using MDX code block breaks formatting #545

d-henn opened this issue Jan 4, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@d-henn
Copy link

d-henn commented Jan 4, 2024

Describe the bug

Not sure if this is intended or not, but when using RTL and MDX code blocks—the formatting within the <pre /> tag becomes jumbled.

Reproduction

I reproduced this with a very minimal install of Ladle and React, see the below StackBlitz environment:

  1. Open StackBlitz ladle-t5xsz3.
  2. Navigate to Docs -> Readme story.
  3. Toggle Right to left on.
  4. See the code block shuffle the semi-colons and parts of the string.
const greeting = 'Hello, ladle!';

becomes

;'!const greeting = 'Hello, ladle

Note: When I copy and paste with my clipboard, the code comes out proper even though it displays incorrectly.

Thank you for the awesome work!

Environment

  • OS: Windows 11 & Mac OS 14.2.1
  • Browser [Firefox, Edge, Brave]
  • Version @ladle/react: 4.0.2
@d-henn d-henn added the needs triage needs to be reviewed label Jan 4, 2024
@tajo
Copy link
Owner

tajo commented Jan 7, 2024

What is the correct behavior? Should rtl not change formatting/directon of code blocks?

It seems we could just achieve that by adding

<pre dir="ltr">

to fix this.

@tajo tajo added bug Something isn't working and removed needs triage needs to be reviewed labels Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants