Giter Club home page Giter Club logo

react-native-htmlparser's Introduction

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
}
}

react-native-htmlparser's People

Contributors

leonchabbey avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

react-native-htmlparser's Issues

Feature request

Hi

Is it possible to add next feature:

  • Text as a container (will resolve issue with wrapping, will add possibility to style not only text inside tags but regular text as well )

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.