From f7513a822b420f903d4dbb9012aa1d1962e4c487 Mon Sep 17 00:00:00 2001 From: Tugdual de Kerviler Date: Mon, 17 Dec 2018 17:48:27 +0100 Subject: [PATCH] Temporary fix for whitespace in HTML, will need to be addressed later --- packages/editor/src/components/rich-text/index.native.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/editor/src/components/rich-text/index.native.js b/packages/editor/src/components/rich-text/index.native.js index ca5ada7689f8c8..e6461bc0aa8add 100644 --- a/packages/editor/src/components/rich-text/index.native.js +++ b/packages/editor/src/components/rich-text/index.native.js @@ -271,12 +271,13 @@ export class RichText extends Component { style, formattingControls, isSelected, - value, } = this.props; // Save back to HTML from React tree - const html = '<' + tagName + '>' + value + ''; const record = this.getRecord(); + // Use record instead of this.props.value to make sure we're in sync with Aztec on the selection + // TODO: Make sure the selection in Aztec and in Gutenberg both handle whitespaces in HTML and thus are in sync + const html = '<' + tagName + '>' + this.valueToFormat( record ) + ''; return (