draft-convert icon indicating copy to clipboard operation
draft-convert copied to clipboard

encode '\xA0' to ' '

Open focus0802 opened this issue 8 years ago • 0 comments

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');
          });
        },
      ),
    );

focus0802 avatar Jun 01 '17 01:06 focus0802