react-native-render-html

iOS/Android pure javascript react-native component that renders your HTML into 100% native views

BSD-2-CLAUSE License

Downloads
967.5K
Stars
3.4K
Committers
55

Bot releases are visible (Hide)

react-native-render-html - v3.9.0

Published by Exilz over 6 years ago

Features

  • Add staticContentMaxWidth prop, letting you set a maximal width for "non-responsive" renderers (only <iframe> for now)
  • All attributes are now passed in onLinkPress : evt, href, htmlAttribs (thanks @barbogast !)
  • Add allowedStyles prop, excluding everything but these ones (thanks @krystofcelba !)
react-native-render-html - v3.8.1

Published by Exilz over 6 years ago

Bugfixes

  • Properly merge baseFontStyle and default text styles, fixes #96
react-native-render-html - v3.8.0

Published by Exilz over 6 years ago

Features

  • Add getClosestNodeParentByTag to the available utils functions
  • Add textSelectable prop (thanks @hyb175 !)

On iOS, you can copy the text, but not actually select what you want. This is a bug from react-native, see https://github.com/facebook/react-native/issues/13938

  • Add default renderer for <s> (thanks @hyb175 !)

Bugfixes

  • The component should now re-render accordingly to your props updates ! Fixes #89, closes #83 as well as many other related issues

This is very important, especially if you need to update your rendering
after it’s been displayed, or simply if you want to use hot reloading.

  • inherit styles won't crash the rendering anymore, fixes #87

Improvements

  • ignoredStyles prop will now also remove styling passed directly through HTML attributes, see #86

Miscellaneous

  • Removed lodash.isequal dependency
  • Rename iOS demo app with a more recognizable name
react-native-render-html - v3.7.0

Published by Exilz almost 7 years ago

Features

  • You can now alter the RNElements (basically the representation of your DOM elements into native components) with the onParsed prop, letting you customize even more your content.

Bugfixes

  • Add missing parentTag to elements, fixing an important regression where your tagsStyles may not be applied. (thanks @Krizzu !)

Miscellaneous

  • Updated the demo with the latest version of react-native and its dependencies.
react-native-render-html - v3.6.0

Published by Exilz almost 7 years ago

New features

  • Add alterNode prop that lets you change the values parsed from your HTML before it's rendered. It's extremely powerful as a last resort to add some very specific styling or circumvent rendering problems.
  • You can now set your custom renderers as inline components. By default, your renderers will still behave as blocks.

Fixes

  • <ul> and <ol> styles aren't hardcoded anymore, you can now style them normally. (thanks @jonathonlui !)
  • <a> tags will properly use your ignoredStyles prop (thanks @YeatsLu !)
react-native-render-html - v3.5.1

Published by Exilz almost 7 years ago

  • Fix : prevent crash with specific styling. This happens when the renderer is applying text-specific styles from a View wrapper to its Text children.
react-native-render-html - v3.5.0

Published by Exilz almost 7 years ago

New features

  • Add baseFontStyle prop, (replacing baseFontSize !) allowing you to provide complete default styling to your text elements (#25)
  • Add listsPrefixesRenderers prop, allowing you to customize the bullets and numbers rendered in your <ul> and <ol> lists
  • Add imagesInitialDimensions prop
  • Finished writing the base code for loading and parsing remote websites. Added a basic loader and error handlers.
  • Add remoteLoadingView & remoteErrorView props
  • Add onParsed prop, this is fired upon first rendering with the the parsing result of htmlparser2 and of this module
  • HTMLImage: render the alt attribute when images couldn't be displayed
  • HTMLImage: width and height attribute now resize your image
  • Add debug prop, printing the parsing result of htmlparser2 and of this module after initial rendering

Fixes

  • Make classesStyles take precedence over tagsStyles (#35)
  • Greatly improve text styling nested inside views
  • In some cases, raw texts children weren't wrapped with their texts siblings, so their styling wouldn't apply properly
  • Title tags like <h1>, <h2> and so on will always break line between each others
  • HTMLImage: don't overscale images when imagesMaxWidth prop is set to a higher value than the original width of your images
  • Correct some edge cases where random line breaks would randomly happen
  • Properly render raw texts nested inside <a> tags
  • tagsStyles is now applied _constructStyles so your custom renderers have proper styling

react-native-render-html - v3.4.0

Published by Exilz about 7 years ago

New features

  • Add alterData & alterChildren props, allowing you to change your HTML data before the intial rendering !

Fixes

  • Empty lists won't crash (thanks @peacechen !)
  • baseFontSize prop won't override the fontSize set by either : the style attribute, the tagsStyles and classesStyles prop
react-native-render-html - v3.3.0

Published by Exilz about 7 years ago

New features

  • Add customWrapper prop

Fixes

  • Use ViewPropTypes to get rid of the deprecation warning
react-native-render-html - v3.2.0

Published by Exilz about 7 years ago

New features

  • Add baseFontSize prop so you can change the size of all your texts in a single prop without having to style every text tag (thanks @peacechen !)

Fixes

  • Texts elements that are siblings of <br> tags should receive the styling of their parent properly
  • Line breaks in your HTML won't actually render line breaks in your native components, for instance :
<p><b>Description</b><br>Some description...<br />
Item 1,
Item 2,
Item 3,
</p>

Item 1, 2, and 3 will be on the same line, regardless of the line breaks of the snippet.

react-native-render-html - v3.1.0

Published by Exilz about 7 years ago

New features

  • Add decodeEntities prop (true by default)
react-native-render-html - v3.0.0

Published by Exilz about 7 years ago

v3.0.0

This is a major overhaul of the whole module, adding a lot of features, fixing numerous bugs, and... breaking some things. The whole codebase has been refactored and cleaned-up. The javascript style and linters have been updated accordingly.

Demo

This component now comes with a demo that showcases every feature. It will be very useful to keep track of bugs and rendering differences between the different versions of react-native.

It will be mandatory to refer to an example of the demo or to provide one when submitting an issue or a pull request for a new feature.

New features

  • The whole parsing and rendering logic has been written from scratch. It shoud now be able to render anything you throw at it without breaking a sweat (we mean without crashing)
  • Greatly improve & fix the default renderer of images, with support for broken links in a browser-like way
  • Add support for em sizing !
  • Add support for percentage sizing !
  • Add ignoredTags prop, you're now able to get rid of those nasty <script> or <blink> (seriously ?) more easily
  • Add ignoredStyles prop. Want to make sure no background-color is applied through the style attribute ? You got it
  • Add more parameters to your custom renderers, like the CSS styling that has been converted
  • (experimental), use a remote website as the source of parsed HTML !
  • Add a default renderer for <iframes> & <i> tags
  • Add classesStyles prop to style your components with their respective HTML classes
  • Add ignoreNodesFunction prop so you can ignore HTML tags very precisely

Fixes

  • You shouldn't encounter random line breaks in your texts when using tags like <em>, <i>, <strong>... even if they're not wrapped in a parent like <p>
  • Properly re-render everything if the HTML source changes
  • Images nested inside <a> should behave and receive taps properly
  • Don't crash when tapping an <a> tag without href attribute
  • Prevent the manual prop-checking handling the CSS to RN conversions from drowning you with YellowBoxes
react-native-render-html - v2.1.0

Published by Exilz about 7 years ago

Courtesy @duyphambhtech :)

  • Remove shallowCompare and replace with PureComponent
  • Fix crash when <img> tag has no src attribute
  • Render <br> tag
  • Render <sub> and <sup>
  • Fix import PropTypes from prop-types
  • Convert code to conform to Javascript Standard Style
  • Fix crash calling PropTypes validators directly
react-native-render-html - v2.0.0

Published by Exilz over 7 years ago

Compatibility with react-native 0.43.2+ (react 16)

react-native-render-html - v1.0.0

Published by Exilz over 7 years ago

Initial release, usable with react >= 0.20 <= 0.42.2 (react 15)

Package Rankings
Top 0.88% on Npmjs.org
Badges
Extracted from project README
npm npm npm npm
Related Projects