react-native-htmltotext

2.0.1 • Public • Published

react-native-htmltotext

Render html string using Text and View components by using parse5 to parse the html

Nesting of block element inside inline element is not supported

Supported elements are u, b, i and div

Example

input:

text<span>unsupportedtag</span><b>bold<div>unsupported nested elements</div></b><div>div1srart<b>bold</b><i>italic</i><div>div1innerstart<b>bold</b>div1innerend</div>div1end</div><div>div2</div><u>underline</u>
<HtmlText
  html={'the html as a string'}
  inlineNodeStyle={{fontSize: 18, color: 'black'}}
  blockNodeStyle={{flexDirection: 'column', justifyContent: 'center'}}
/>

output: native

Readme

Keywords

none

Package Sidebar

Install

npm i react-native-htmltotext

Weekly Downloads

0

Version

2.0.1

License

MIT

Unpacked Size

6.68 kB

Total Files

7

Last publish

Collaborators

  • nklhrstv