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

React renderer doesn't handle arabic right to left in tables #440

Open
yulius-take2 opened this issue Jan 31, 2023 · 1 comment
Open

React renderer doesn't handle arabic right to left in tables #440

yulius-take2 opened this issue Jan 31, 2023 · 1 comment

Comments

@yulius-take2
Copy link

When the React renderer draws a table, it doesn't draw the table right to left properly based on the content.

Example can be seen at the bottom of the page.
https://www.take2games.com/data-request/ar

image

@yulius-take2
Copy link
Author

Here's the workaround. The css to handle this should really be in the renderer I think.

import { documentToReactComponents } from '@contentful/rich-text-react-renderer';
import { css } from '@emotion/core';

const cssRichTextMarkdown = css`
  :dir(rtl) {
    th,
    td {
      text-align: right;
      direction: rtl;
    }
  }
`;

function ReactRichText({richText}) {
  return <div css={cssRichTextMarkdown}>{documentToReactComponents(richText)}</div>;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant