@contentful/rich-text-react-renderer
Advanced tools
Comparing version 15.22.2 to 15.22.3
@@ -20,3 +20,4 @@ "use strict"; | ||
var nodeValue = renderText ? renderText(node.value) : node.value; | ||
if (preserveWhitespace) { | ||
// Preserving whitespace is only supported with the default transformations. | ||
if (preserveWhitespace && !renderText) { | ||
// Preserve multiple spaces. | ||
@@ -23,0 +24,0 @@ nodeValue = nodeValue.replace(/ {2,}/g, function (match) { return '\u00A0'.repeat(match.length); }); |
@@ -380,3 +380,4 @@ 'use strict'; | ||
var nodeValue = renderText ? renderText(node.value) : node.value; | ||
if (preserveWhitespace) { | ||
// Preserving whitespace is only supported with the default transformations. | ||
if (preserveWhitespace && !renderText) { | ||
// Preserve multiple spaces. | ||
@@ -383,0 +384,0 @@ nodeValue = nodeValue.replace(/ {2,}/g, function (match) { return '\u00A0'.repeat(match.length); }); |
{ | ||
"name": "@contentful/rich-text-react-renderer", | ||
"version": "15.22.2", | ||
"version": "15.22.3", | ||
"main": "dist/rich-text-react-renderer.es5.js", | ||
@@ -42,3 +42,3 @@ "typings": "dist/types/index.d.ts", | ||
}, | ||
"gitHead": "7a8e612e70e8aa9de555057094233d8bd75d3d23" | ||
"gitHead": "b32a72f7df9299913e97f4515ef6b67814ca130b" | ||
} |
@@ -225,2 +225,4 @@ # rich-text-react-renderer | ||
Note that `preserveWhitespace` is not compatible with the `renderText` option. When the functionality of `preserveWhitespace` is desired along with a custom `renderText` callback, it should be implemented within the callback instead. | ||
```javascript | ||
@@ -227,0 +229,0 @@ import { documentToReactComponents } from '@contentful/rich-text-react-renderer'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
154595
1870
255