This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Helpers. | |
import { convertToText } from './'; | |
/* | |
You would call this when receiving a plain text | |
value back from an API, and before inserting the | |
text into the `contenteditable` area on a page. | |
*/ | |
const convertToMarkup = (str = '') => { | |
return convertToText(str).replace(/\n/g, '<br>'); |