Skip to content

Releases: meliorence/react-native-render-html

v3.8.1

08 Feb 16:05
bb8fbfa
Compare
Choose a tag to compare

Bugfixes

  • Properly merge baseFontStyle and default text styles, fixes #96

v3.8.0

08 Feb 10:36
9adae7c
Compare
Choose a tag to compare

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 facebook/react-native#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

v3.7.0

15 Jan 14:29
0b4d120
Compare
Choose a tag to compare

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.

v3.6.0

02 Jan 17:04
Compare
Choose a tag to compare

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 !)

v3.5.1

10 Nov 08:27
1213c4d
Compare
Choose a tag to compare
v3.5.1 Pre-release
Pre-release
  • Fix : prevent crash with specific styling. This happens when the renderer is applying text-specific styles from a View wrapper to its Text children.

v3.5.0

27 Oct 09:48
Compare
Choose a tag to compare

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

v3.4.0

12 Oct 07:14
Compare
Choose a tag to compare

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

v3.3.0

09 Oct 13:07
Compare
Choose a tag to compare

New features

  • Add customWrapper prop

Fixes

  • Use ViewPropTypes to get rid of the deprecation warning

v3.2.0

04 Oct 07:45
Compare
Choose a tag to compare

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.

v3.1.0

02 Oct 13:04
Compare
Choose a tag to compare

New features

  • Add decodeEntities prop (true by default)