draft-convert
draft-convert copied to clipboard
encode '\xA0' to ' '
add support for encode '\xA0' to ' '.
convert contentState to non-breaking contentState as @benbriggs said
const nonBreakingContentState = ContentState.createFromBlockArray(
contentState.getBlocksAsArray().map(
(block) => {
return block.update('text', (text) => {
const reg = new RegExp(' ', 'g');
return text.replace(reg, '\xA0');
});
},
),
);