From 6e88738c9bcb9dff9a75701e81194849d0276007 Mon Sep 17 00:00:00 2001 From: khaydarov Date: Thu, 26 Jan 2017 19:27:48 +0300 Subject: [PATCH] quote modifications --- plugins/quote/quote.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/plugins/quote/quote.js b/plugins/quote/quote.js index 4686eb3c..684f6160 100644 --- a/plugins/quote/quote.js +++ b/plugins/quote/quote.js @@ -422,8 +422,24 @@ var quote = (function(quote) { data.size = 'small'; } - console.log(data); + var wrapper = document.createElement('DIV'); + wrapper.innerHTML = data.text; + var child; + + for (child = 0; child < wrapper.childNodes.length; child++) { + // is TEXT node ? + if (wrapper.childNodes[child].nodeType === 3) { + + var paragraph = document.createElement('P'); + paragraph.innerHTML = wrapper.childNodes[child].textContent; + + wrapper.childNodes[child].replaceWith(paragraph); + } + } + + data.text = wrapper.innerHTML; + return data; };