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

Cannot remove bullet from list or handle <lh></lh> tag

Open Navipro70 opened this issue 1 year ago • 2 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

I have next html with <lh></lh> tag:

<ul>
<lh>Text 1</lh>
<li>Text 2</li>
<li>Text 3</li>
</ul>

Current behavior: Library ignores <lh></lh> tag and renders as standard <li></li> tag, but without text and with bullet

Expected behavior: Library renders it as list header tag without marker (bullet, etc.) and with text

Maybe library has posibility to ignore marker (bullet) for specific tag, for example with <lh style="list-style-type: none;"></lh> or by overriding the tag specs in customHTMLElementModels, but I've read docs and didn't find any solution

React Native Information

-

RNRH Version

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

Tested Platforms

  • [X] Android
  • [X] iOS
  • [ ] Web
  • [ ] MacOS
  • [ ] Windows

Reproduction Platforms

  • [X] Android
  • [X] iOS
  • [ ] Web
  • [ ] MacOS
  • [ ] Windows

Minimal, Reproducible Example

Additional Notes

Example with screenshots for html:

<ul>
  <lh>Text 1</lh>
  <li>Text 2</li>
  <li>Text 3</li>
</ul>

Current behavior: Снимок экрана 2023-04-05 в 20 35 19

Expected behavior: Снимок экрана 2023-04-05 в 20 37 54

Navipro70 avatar Apr 05 '23 16:04 Navipro70

Maybe someone else meet this issue, just add next code to props, it will fix it

customHTMLElementModels = {{
    lh: HTMLElementModel.fromCustomModel({
      contentModel: HTMLContentModel.textual,
      mixedUAStyles: {
        backgroundColor: colors.white,
        transform: [{ translateX: -12 }],
      },
      tagName: 'li',
    })
}}

Navipro70 avatar Apr 06 '23 09:04 Navipro70

We should definitely support LH tag properly. Reopening to track this effort

jsamr avatar Apr 06 '23 14:04 jsamr