Skip to content

leonchabbey/react-native-htmlparser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-htmlparser

Why?

I did not find any working solution, so I looked for existing packages. None of them were working properly, so I decided to make my own from other packages' parts that I found interesting and usable. This package depends on @kodefox's parse5 react-native version, and is inspired by @siuying's htmltext.

Check their packages out:

Example

This is how you use it

import HtmlParser from 'react-native-htmlparser'

<HtmlParser containerStyle={{}} tagsStyle={{}} html={}/>
Props Type Information
containerStyle array Style that will apply on the main View that wraps the parsed html
tagsStyle array Styles that will be applied to their corresponding html tags (blocks and inlines)
html String Your HTML content that needs to be parsed

There is a special tag you can use, it's general. Its attributes will be applied to every html tags (block and inline tags).

var tagsStyle = {
general: {
fontFamily: "Roboto"
},
p: {
marginBottom: 15
}
}

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published