jpuri / draftjs-utils

An collection of useful utility functions for DraftJS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getSelectionText should take a parameter to replace line breaks with a given char

fibonacid opened this issue · comments

Sometimes you need to include line feeds in you selected text, so I it would be nice to do this:

 const text = getSelectionText(editorState, "\n");
 console.log(text);

And the result would be

> Dear Foo\nHow are you ?