# v5.1.0 ## Bugfixes - prop `source.uri` failing to cause HTML to load ## Features - `allowWhitespaceNodes` prop to avoid removal of whitespace-filled text nodes - re-renders on `baseFontStyle` updates (port from dev/4.x branch) # v5.0.1 ## Bugfixes - Accurate typescript typings for `onParsed`, `alterData`, `alterChildren` (thanks [@SPWizard01](https://github.com/SPWizard01)) # v5.0.0 ## Enhancements - New `source` prop which deprecates `html` and `uri` props. This prop supports `method`, `body` and `headers` fields :rocket: - 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 `computeEmbeddedMaxWidth`. Read the RFC document [“A Deterministic Approach to Embedded Content Scaling”](https://github.com/meliorence/react-native-render-html/blob/master/rfc/001-A-deterministic-approach-to-embedded-content-scaling.adoc) for more details. - New prop `computeEmbeddedMaxWidth` (see usage above). - New prop `contentWidth` (see usage above). - New prop `htmlParserOptions` to override [htmlparser2](https://github.com/fb55/htmlparser2/wiki/Parser-options) ParserOptions object, thanks [@fabianlee1211](https://github.com/fabianlee1211). - `onLinkPress` has now a default value: open links with `Linking` API (recommended). - Add Podspec file, thanks [@systemride](https://github.com/systemride) - New `WebView` optional prop for plugins which requires it, see [@native-html/plugins](https://github.com/native-html/plugins), thanks [@IjzerenHein](https://github.com/IjzerenHein) - New `defaultTextProps`, thanks [@Peretz30](https://github.com/Peretz30) - New `defaultWebViewProps` for `WebView`-based plugins (tables, iframes...). - Export `constructStyles`, `getParentsTagsRecursively`, `getClosestNodeParentByTag` and `IGNORED_TAGS` from index.js. - New `domNode` field in `passProps`. - New `domNodeToHTMLString` util to get the HTML representation of a DOM node. - The internal pre-render tree structure is now typed (`TransientNode`) as well as `onParsed`. ## Bugfixes - Image getting blur on iOS, [#141](https://github.com/meliorence/react-native-render-html/issues/141); - `img`'s tag `resizeMode` property not modifiable through `tagStyles`, [#172](https://github.com/meliorence/react-native-render-html/issues/172); - `imagesMaxWidth` not working, [#412](https://github.com/meliorence/react-native-render-html/issues/412) ## DEPRECATED PROPS (removed in v6) - `allowFontScaling`, use `defaultTextProps.allowFontScaling` instead; - `textSelectable`, use `defaultTextProps.selectable` instead; - `decodeEntities`, use `htmlParserOptions.decodeEntities` instead. - `html`, use `source.html` instead. - `uri`, use `source.uri` instead. ## BREAKING CHANGES - (TypeScript users), requires minimum TypeScript version 3.5 (was 2.0) - `iframe` tag element is not rendered anymore, and `react-native-webview` has been removed from peer dependencies; use [`@native-html/iframe-plugin`](https://github.com/native-html/plugins/tree/master/packages/iframe-plugin#readme) instead, which supports `onLinkPress` and scales to content width :rocket:. - `imagesMaxWidth` and `staticContentMaxWidth` have been discontinued in favor of `computeEmbeddedMaxWidth`. This function takes the provided `contentWidth` as 1st argument, tag name as 2d argument and returns the max width of the embedded (iframe, image...). - In the `passProps` 4th argument of renderer functions, the field `rawChildren` has been renamed to `transientChildren`. # v4.2.5 ## Bugfixes - re-render `HTML` component on `baseFontStyle` updates # v4.2.4 ## Bugfixes - `src` attributes starting with "//" in `img` and `iframe` elements are not rendered ([#408](https://github.com/meliorence/react-native-render-html/issues/408)) # v4.2.3 ## Bugfixes - Rendered HTML with uri prop displays “undefined” ([#256](https://github.com/meliorence/react-native-render-html/issues/256)) - Custom wrapper ignored ([#276](https://github.com/meliorence/react-native-render-html/issues/276)), thanks [@tomdaniel-it](https://github.com/tomdaniel-it) ## Enhancements - `HTML`: use a proxy method `setStateSafe` to avoid updating while unmounted. # v4.2.2 ## Bugfixes - Translated elements bloated with HTML component props ([#384](https://github.com/meliorence/react-native-render-html/issues/384), [#383](https://github.com/meliorence/react-native-render-html/issues/383)) - Unable to resolve stream module ([#244](https://github.com/meliorence/react-native-render-html/issues/244)) - `textSelectable` not working for tagName `textwrapper` ([#193](https://github.com/meliorence/react-native-render-html/issues/193)), thanks [@brsaylor2](https://github.com/brsaylor2) - CSS font-family values ignored because of false positive match ([#266](https://github.com/meliorence/react-native-render-html/issues/266)) - CSS text-align unrecognized value ([#252](https://github.com/meliorence/react-native-render-html/issues/252)) - CSS inline rules with "none" values ([#319](https://github.com/meliorence/react-native-render-html/issues/319)) - CSS restrict display attribute to flex and none ([#257](https://github.com/meliorence/react-native-render-html/issues/257)) - Typos in IGNORED_TAGS arrays ([#249](https://github.com/meliorence/react-native-render-html/issues/249), [#272](https://github.com/meliorence/react-native-render-html/issues/272)) - Re-render after classesStyles and tagsStyles updates ([#343](https://github.com/meliorence/react-native-render-html/issues/343), [#377](https://github.com/meliorence/react-native-render-html/issues/377)), thanks [@jorgemasta](https://github.com/jorgemasta) - Image size computed after HTMLImage component marked as mounted, thanks [@laurynas](https://github.com/laurynas) ## Enhancements - Replace deprecated references to RN PropTypes with loose types, thanks [denissb](https://github.com/denissb) - “Dumb” support for `acronym` tag, thanks [Brainyoo](https://github.com/Brainyoo) - Stricter handling of CSS rules !important directives stripping ## Miscellaneous - Added a [CHANGELOG](https://github.com/meliorence/react-native-render-html/tree/v4.2.2/CHANGELOG.MD) (#314) - Each fix [has his regression test implemented along](https://github.com/meliorence/react-native-render-html/tree/v4.2.2/src/__tests__) - Some behaviors have been tested to prepare the ground for future refactorings - Upgraded lint tooling to prepare for PR guidelines and CI # v4.2.1 ## Improvements - Add typescript definitions #341 (thanks @jsamr and to everyone that helped him !) # v4.2.0 **⚠️ `react-native-webview` is now a peer dependency**. As a result, you need to install it yourself. Please follow [the plugin's instructions](https://github.com/react-native-community/react-native-webview/blob/master/docs/Getting-Started.md). --- - Fix deprecation warnings for componentWillReceiveProps, ...WillUpdate (thanks [@peacechen](https://github.com/peacechen)) - Fix crashes with `