react-native-htmlview
Advanced tools
Comparing version 0.1.2 to 0.2.0
@@ -12,2 +12,3 @@ var htmlparser = require('./vendor/htmlparser2') | ||
var PARAGRAPH_BREAK = '\n\n' | ||
var BULLET = ' \u2022 ' | ||
@@ -41,4 +42,6 @@ function htmlToElement(rawHtml, opts, done) { | ||
{node.name == 'pre' ? LINE_BREAK : null} | ||
{node.name == 'li' ? BULLET : null} | ||
{domToElement(node.children, node)} | ||
{node.name == 'br' ? LINE_BREAK : null} | ||
{node.name == 'li' ? LINE_BREAK : null} | ||
{node.name == 'p' && index < list.length-1 ? PARAGRAPH_BREAK : null} | ||
@@ -45,0 +48,0 @@ </Text> |
{ | ||
"name": "react-native-htmlview", | ||
"version": "0.1.2", | ||
"version": "0.2.0", | ||
"description": "A component which renders HTML content as native views", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -11,3 +11,3 @@ # React Native HTMLView | ||
- `onLinkPress`: a function which will be called with a url when a link is pressed. | ||
Passing this prop will override how links are handled (defaults to calling LinkingIOS.openURL(url)) | ||
Passing this prop will override how links are handled (defaults to calling `LinkingIOS.openURL(url)`) | ||
- `stylesheet`: a stylesheet object keyed by tag name, which will override the | ||
@@ -19,2 +19,4 @@ styles applied to those respective tags. | ||
Note: see the [troubleshooting](#troubleshooting) section below if you're having problems with links not working. | ||
### example | ||
@@ -40,3 +42,2 @@ | ||
}) | ||
``` | ||
@@ -49,2 +50,3 @@ var styles = StyleSheet.create({ | ||
}) | ||
``` | ||
@@ -57,5 +59,8 @@ ### screenshot | ||
### troubleshooting | ||
If you're getting the error "undefined is not an object (evaluating 'RCTLinkingManager.openURL’)” from the LinkingIOS API, try adding ‘RCTLinking' to the project's 'Linked Frameworks and Libraries’. You might have to find RCTLinking.xcodeproj in the react-native package dir and drag that into your main Xcode project first. | ||
 | ||
I just wrote this... use at your own risk. Not API stable. |
306490
7037
62