react-native-render-html
react-native-render-html copied to clipboard
Cannot remove bullet from list or handle <lh></lh> tag
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:
Expected behavior:
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',
})
}}
We should definitely support LH tag properly. Reopening to track this effort