html5 react native,GitHub - liepinteam/react-native-html5: html, html5 parser for react-native

react-native-html5

html, html5 parser for react-native

68747470733a2f2f70696c6c79732e6769746875622e696f2f72656163742d6e61746976652d68746d6c352f696d616765732f302e706e6768747470733a2f2f70696c6c79732e6769746875622e696f2f72656163742d6e61746976652d68746d6c352f696d616765732f312e706e67

Install

npm install react-native-html5

Usage

import Html5 from 'react-native-html5';

...

rawHtml={rawHtml}

styleSheet={styleSheet}

externalStyleSheet={externalStyleSheet}

/>

options

rawHtml

HTML Text

styleSheet

optional, styles

externalStyleSheet

optional, external styles, textIndent for

supported

Example

import React, { Component } from 'react';

import {

Text,

View,

StyleSheet,

} from 'react-native';

import Html5 from 'react-native-html5';

const rawHtml = `

h1. heading

h2. heading

h3. heading

h4. heading
h5. heading
h6. heading

<p> is a paragraph

<image> rendered as an image

logo_og.png

<mark> renderd as highlight text

<del> or <s> rendered as deleted text

<u> or <ins> rendered as underlined text

<small> rendered as small text

<strong> or <b> rendered as bold text

<em> or <i> rendered as italicized text

<blockquote> rendered as a blockquote

<code> rendered as code

and other most of html tags supported.

`;

const styleSheet = {

a: {

color: '#00f',

}

};

const externalStyleSheet = {

p: {

textIndent: 0,

},

};

class ReactNativeHtml5Test extends Component {

render() {

return (

rawHtml={rawHtml}

styleSheet={styleSheet}

externalStyleSheet={externalStyleSheet}

/>

);

}

}

const styles = StyleSheet.create({

container: {

marginTop: 40,

padding: 20,

},

});

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值