react-native-render-html icon indicating copy to clipboard operation
react-native-render-html copied to clipboard

RTL is not working on p or div tag

Open Mohul44 opened this issue 5 months ago • 1 comments

Decision Table

  • [X] My issue does not look like “The HTML attribute 'xxx' is ignored” (unless we claim support for it)
  • [X] My issue does not look like “The HTML element <yyy> is not rendered”

Good Faith Declaration

  • [X] I have read the HELP document here: https://git.io/JBi6R
  • [X] I have read the CONTRIBUTING document here: https://git.io/JJ0Pg
  • [X] I have confirmed that this bug has not been reported yet

Description

the rtl tags are not working in following code

const source = {
    html: `
    <p dir="rtl">This is a paragraph of text in RTL.</p>
<p style="direction: rtl;">This is a paragraph of text in RTL.</p>

    <p>Alexa ما هو الطقس ليوم غ! (default dir!)</p>
<p dir="ltr">Alexa ما هو الطقس ليوم غد! (ltr dir!)</p>
<p dir="rtl">Alexa ما هو الطقس ليوم غد! (rtl dir!)</p>
<p style="direction: rtl;">Alexa ما هو الطقس ليوم غد! <span dir='ltr'>(rtl with inline ltr span!)</span></p>
<hr />
<p>ما هو الطقس ليوم غ! Hello World كيف حالك (default dir!)</p>
<p dir='auto'>ما هو الطقس ليوم غ! Hello World كيف حالك (auto dir!)</p>
<p dir='ltr'>ما هو الطقس ليوم غ! Hello World كيف حالك (ltr dir!)</p>
<p dir='rtl'>ما هو الطقس ليوم غ! Hello World كيف حالك (rtl dri!)</p>
<p dir='rtl'>ما هو الطقس ليوم غ! Hello World كيف حالك <span dir='ltr'>(rtl with inline ltr span!)</span></p>`
  };

i have set

<RenderHtml source={source} renderersProps={{ p: { enableExperimentalRtl: true }, }} />

React Native Information

https://snack.expo.dev/QR9QKiweTqnT7LmQzJFtW

RNRH Version

"react-native-render-html": "^6.3.4",

Tested Platforms

  • [X] Android
  • [X] iOS
  • [X] MacOS

Reproduction Platforms

  • [X] Android
  • [X] iOS
  • [X] MacOS

Minimal, Reproducible Example

https://snack.expo.dev/QR9QKiweTqnT7LmQzJFtW

Additional Notes

No response

Mohul44 avatar Feb 08 '24 07:02 Mohul44