From 4320263bcc2794976f4586cf87b2d66f600ba62c Mon Sep 17 00:00:00 2001 From: okbel Date: Mon, 5 Mar 2018 17:55:56 -0300 Subject: [PATCH] Add regext to test multiline strings --- plugins/talk-plugin-rich-text-pell/client/utils.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/talk-plugin-rich-text-pell/client/utils.js b/plugins/talk-plugin-rich-text-pell/client/utils.js index e00b7a91c..bb71c2b4f 100644 --- a/plugins/talk-plugin-rich-text-pell/client/utils.js +++ b/plugins/talk-plugin-rich-text-pell/client/utils.js @@ -2,9 +2,10 @@ export function htmlNormalizer(htmlInput) { const str = htmlInput; // We are normalizing the input from contenteditable of each browser, also removing unnecesary html tags // https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Editable_content#Differences_in_markup_generation + console.log(htmlInput); return str - .replace('

', '

') // IE outputs

instead of

s - .replace('

', '
') // IE outputs

instead of

s - .replace('
', '
') - .replace('
', ''); + .replace(/

/g, '
') + .replace(/<\/p>/g, '') + .replace(/

/g, '
') + .replace(/<\/div>/g, ''); }