meliorence / react-native-render-html

iOS/Android pure javascript react-native component that renders your HTML into 100% native views
https://meliorence.github.io/react-native-render-html/
BSD 2-Clause "Simplified" License
3.48k stars 589 forks source link

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

Open Navipro70 opened 1 year ago

Navipro70 commented 1 year ago

Decision Table

Good Faith Declaration

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

Reproduction Platforms

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 commented 1 year ago

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',
    })
}}
jsamr commented 1 year ago

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