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 - Release 6.0.0-alpha.4

Published by jsamr almost 4 years ago

6.0.0-alpha.4 (2020-11-27)

See https://github.com/archriss/react-native-render-html/pull/434#issue-527747509 and https://github.com/archriss/react-native-render-html/issues/430

Bug Fixes

  • spread styles passed to TDefaultTextRenderer (d167f95)

Code Refactoring

  • distinguish props from TDefaultRenderer and custom renderers (0f2c41d)

Features

  • add new splitBoxModelStyle utility (3b0586c)

BREAKING CHANGES

  • renderer props (and TDefaultRendererProps) don't pass
    props to their underlying element. Instead, they pass viewProps if they
    are view-based, and textProps if they are text-based. Only onPress is
    still directly passed to the underlying element. Finally, a third prop
    is available, type, useful for mixed renderers to know the type of the
    underlying element (Text or View).
react-native-render-html - Release 6.0.0-alpha.3

Published by jsamr almost 4 years ago

react-native-render-html - Release 6.0.0-alpha.2

Published by jsamr almost 4 years ago

react-native-render-html - v5.0.0-alpha.2

Published by jsamr about 4 years ago

Enhancements

  • Center images when computeImagesMaxWidth() < contentWidth
react-native-render-html - v5.0.0-alpha.1

Published by jsamr about 4 years ago

Enhancements

  • Brand new HTMLImage component which should be much better at adapting its
    size to available width. For this to happen, you must pass contentWidth prop. We recommend using useWindowDimensions().width to handle screen rotation gracefully. If you don't want your images to grow after a certain size, you could use computeImagesMaxWidth.
  • New prop computeImagesMaxWidth (see usage above).
  • New prop contentWidth (see usage above).

Bugfixes

  • Image getting blur on iOS, #141;
  • img's tag resizeMode property not modifiable through tagStyles, #172;
  • imagesMaxWidth not working, #412

BREAKING CHANGES

  • imagesMaxWidth had been discontinued in favor of computeImagesMaxWidth.
    This function takes the provided contentWidth as an argument, and returns
    the space the image should take.
react-native-render-html - v4.2.4

Published by jsamr about 4 years ago

Bugfixes

  • src attributes starting with "//" in img and iframe elements are not rendered (#408)
react-native-render-html - v4.2.3

Published by jsamr about 4 years ago

Bugfixes

  • Rendered HTML with uri prop displays “undefined” (#256)
  • Custom wrapper ignored (#276), thanks @tomdaniel-it

Enhancements

  • HTML: use a proxy method setStateSafe to avoid updating while unmounted.
react-native-render-html - v4.2.3-beta.1

Published by jsamr about 4 years ago

🚀 give us feedback here: https://github.com/archriss/react-native-render-html/issues/390

Bugfixes

  • Rendered HTML with uri prop displays “undefined” (#256)
  • Custom wrapper ignored (#276), thanks @tomdaniel-it

Enhancements

  • HTML: use a proxy method setStateSafe to avoid updating while unmounted.
react-native-render-html - v4.2.2

Published by jsamr about 4 years ago

Bugfixes

  • Translated elements bloated with HTML component props (#384, #383)
  • Unable to resolve stream module (#244)
  • textSelectable not working for tagName textwrapper (#193), thanks @brsaylor2
  • CSS font-family values ignored because of false positive match (#266)
  • CSS text-align unrecognized value (#252)
  • Stricter handling of CSS rules !important directives stripping
  • CSS inline rules with "none" values (#319)
  • CSS restrict display attribute to flex and none (#257)
  • Typos in IGNORED_TAGS arrays (#249, #272)
  • Re-render after classesStyles and tagsStyles updates (#343, #377), thanks jorgemasta
  • Image size computed after HTMLImage component marked as mounted, thanks laurynas

Enhancements

  • Replace deprecated references to RN PropTypes with loose types, thanks denissb
  • “Dumb” support for acronym tag, thanks Brainyoo

Miscellaneous

react-native-render-html - v4.2.2-beta.2

Published by jsamr about 4 years ago

react-native-render-html - v4.2.1

Published by Exilz over 4 years ago

Improvements

  • Add typescript definitions #341 (thanks @jsamr and to everyone that helped him !)
react-native-render-html - v4.2.0

Published by bd-arc almost 5 years ago

⚠️ react-native-webview is now a peer dependency. As a result, you need to install it yourself. Please follow the plugin's instructions.


  • Fix deprecation warnings for componentWillReceiveProps, ...WillUpdate (thanks @peacechen)
  • Fix crashes with tag (thanks @Ryabchikus)
  • Upgraded demo app to RN 0.59.10 (fixes build issues on XCode 11) (thanks @IjzerenHein)
  • Use baseFontSize for tags
react-native-render-html - v4.1.2

Published by Exilz over 5 years ago

Bugfixes

  • Update htmlparser2, preventing Unable to resolve module stream error (thanks @mlazari !)
react-native-render-html - v4.1.1

Published by Exilz over 5 years ago

Important note

⚠️ As of this release, react-native-render-html is now compatible with RN < 0.58 once again. Feel free to upgrade from 3.10.0 to 4.1.1 regardless of your RN version. ⚠️

Bugfixes

  • Prevent crash when encountering css functions like style="calc(100% - 20px);"
  • Prevent crash when encountering normal and unset keys
react-native-render-html - v4.1.0

Published by Exilz over 5 years ago

Features

  • Add a default renderer for <pre>. This lets you display preformatted text such as code inside your content with a monospace font. #196
  • Add allowFontScaling prop. #157 (thanks @amhinson !)
  • Support srcdoc in <iframe> tags. #148 (thanks @charpeni !)

Bugfixes

  • Properly display an error when fetching a remote content to display has failed. #199 (thanks @Alex123456780)
  • Fix the rendering of nested lists, like <ul> inside <ol> #173 (thanks @muhamad-rizki)
  • Don't update HTMLImage's state after it's been unmounted. This prevents warnings during development. 4fca299
  • Don't strip line breaks in <pre> tags #196 (thanks @henry40408 !)

Miscellaneous

  • Remove useless stream dependency from package.json #190 (thanks @ramuse !)
  • Fix typo in the documentation #205 (thanks @ajmeese7 !)
react-native-render-html - v4.0.0

Published by Exilz over 5 years ago

⚠️ This version requires react-native 0.58 and up. If you're using an older version, please stick to the version 3 of this plugin. ⚠️

Bugfixes

  • Prevent crash on react-native 0.58 and above since ViewStylePropTypes and ImageStylesPropTypes have been deprecated. (thanks @ChrisEdson !)
react-native-render-html - v3.10.0

Published by Exilz over 6 years ago

Features

  • Add renderersProps prop. This lets you pass a set of props to your custom renderers, allowing you to style them furthermore without duplicating the renderers code. For instance, if you create a blockquote custom renderer, you can alter its color depending on the data you're rendering.

Example :

<HTML html={...} renderers={renderers} renderersProps={{ color: 'blue' } />
<HTML html={...} renderers={renderers} renderersProps={{ color: 'red' } />

const renderers = {
    blockquote: (htmlAttribs, children, convertedCSSStyles, passProps) => {
        const { renderersProps } = passProps;
        // rendersProps : { color: blue/red }

        return ...
    }
}

Rework

  • The logic that applies text styling has been rewritten from scratch. The previous implementation had a lot of flaws that were hard to debug. This should be a much needed improvement addressing some of the oldest issues of this plugin. The new algorithm is explained here.

⚠️ Although this shouldn't be a breaking change, your current rendering might be taking into account the previous buggy implementation. Upgrading to 3.10.0 might break some of your advanced text styling, just because it's now working as it should have from the beginning. ⚠️

Bugfixes

  • Is some cases, text nodes used to be wrapped in additional <p> tags. This could have unintended style effects. Let's now wrap them in a new custom tag that behaves like an inline tag, but without styling : textwrapper
react-native-render-html - v3.9.2

Published by Exilz over 6 years ago

Miscellaneous

  • Minor fix with the npm release, no code change from the previous version.
react-native-render-html - v3.9.1

Published by Exilz over 6 years ago

Features

  • Handle absolute font sizes : medium, xx-small, small... (thanks @ikhsanalatsary) Closes #122
  • Add ptSize prop (thanks @ikhsanalatsary)
  • Improve <iframe> rendering, letting you set their dimensions through tagsStyles & classesStyles. These are overriden by height and width html attributes. Closes #110

Bugfixes

  • Addresses issues when fontWeight property mistakenly got converted from string to a number. This resulted in crashes due to the wrong type. (thanks @mchudy !) Closes #111
  • Prevent a crash when rendering an <img> if you happen to have a style on your HTML container that's not an array (thanks @ikhsanalatsary) Closes #120
  • Remove !important annotations that prevented some styles from being rendered Closes #121

Miscellaneous

  • Fix typos & baseFontStyle value in README (thanks @charpeni) Closes #116
  • staticContentMaxWidth and imagesMaxWidth now have Dimensions.get('window').width as their default values
Package Rankings
Top 0.88% on Npmjs.org
Badges
Extracted from project README
npm npm npm npm
Related Projects