Comments (22)
I'm using react-native-html-render
instead, but its document is bad, you can take my app as an example: https://github.com/kxxoling/PythonChina.app/blob/master/views%2FPost.js
from react-native-htmlview.
@jsdf I've send a pull request #18. Please help to review it.
from react-native-htmlview.
if you want to point to my version temporary before this issue resolved.
Try this
npm i git+https://[email protected]/blackbing/react-native-htmlview.git#master
from react-native-htmlview.
+1 that would be rad @jsdf
from react-native-htmlview.
+1 I hope so.
from react-native-htmlview.
+1024
from react-native-htmlview.
+1
from react-native-htmlview.
I'd happily accept a PR. This wouldn't be particularly difficult to implement, I just don't have time to do it any time soon.
from react-native-htmlview.
Really need this feature, but I don't know how to implement it. Poor knowledge with JS and iOS. :(
@jsdf If you have any idea but no time, how about writing it down and wait someone to implement it?
from react-native-htmlview.
+1
from react-native-htmlview.
I trying somsing but it not work :(
if (node.type == 'tag') {
var linkPressHandler = null
if (node.name == 'a' && node.attribs && node.attribs.href) {
linkPressHandler = () => opts.linkHandler(entities.decodeHTML(node.attribs.href))
}
if (node.name == 'img' && node.attribs && node.attribs.src) {
linkPressHandler = () => node.attribs.src
}
return (
<Text key={index} onPress={linkPressHandler}>
{node.name == 'pre' ? LINE_BREAK : null}
{node.name == 'li' ? BULLET : null}
{node.name == 'img' ? <Image style={height: 300} source={{uri: linkPressHandler}} /> : null}
{domToElement(node.children, node)}
{node.name == 'br' || node.name == 'li' ? LINE_BREAK : null}
{node.name == 'p' && index < list.length-1 ? PARAGRAPH_BREAK : null}
{node.name == 'h1' || node.name == 'h2' || node.name == 'h3' || node.name == 'h4' || node.name == 'h5' ? PARAGRAPH_BREAK : null}
</Text>
)
}
from react-native-htmlview.
+1 hope it very much
from react-native-htmlview.
+1.
from react-native-htmlview.
@kxxoling i found this week ago. work's perfectly
from react-native-htmlview.
@ufon Except some compatibility with HTML5 tags. For example, if you put a img
tag in an figure
tag, the image won't show. I've created an issue about this, but not fixed yet.
from react-native-htmlview.
@kxxoling it's not so critical, I am sure this is remediable at a stage of response preparation :)
from react-native-htmlview.
@ufon Yeah, but I'm working on an app based on python-china.org's API, which prefer HTML5 tags.
from react-native-htmlview.
I'll try @blackbing 's approach.
from react-native-htmlview.
Thanks a lot.
from react-native-htmlview.
@jsdf
Could you please merge @blackbing 's PR?
Thanks.
from react-native-htmlview.
@blackbing it doesn't work on React Native v0.30.
from react-native-htmlview.
from react-native-htmlview.
Related Issues (20)
- Unordered List followed by Paragraph not rendering properly HOT 3
- Space between html tags is huge even tho I wrapped my content in "<div>" HOT 4
- Inline styling is not working HOT 1
- Get text of clicked links
- How to set the number of lines to show HOT 1
- Truncate text in html view HOT 1
- Get raw html in renderNode HOT 2
- Make HTML Text selectable HOT 4
- Multiple HyperLinks
- img tag have default border HOT 1
- Update HTMLView TS definitions to support class components
- <sup> and <sub> tag not working HOT 3
- Typing for HTMLViewNode on Typescript HOT 2
- dynamically set height according to available content
- import ViewPropTypes from deprecated-react-native-prop-types instead of react-native HOT 5
- Is there a way to ignore links ? HOT 1
- Error: Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'. HOT 3
- can add katex css to this html view ? HOT 1
- Please Help me to Solve this Error << ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'. HOT 2
- ViewPropTypes will be removed from 'react-native' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-htmlview.