skillbox/client/src/helpers/text.js

7 lines
125 B
JavaScript

export const newLineToParagraph = (text) => {
return text
.split(/\n+/)
.map(p => `<p>${p}</p>`)
.join('');
};