diff --git a/package-lock.json b/package-lock.json index d5fa064cfb..093bc7ee07 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tui-editor-alternate", - "version": "1.0.0", + "version": "1.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 024b27eb91..faafd719eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tui-editor-alternate", - "version": "1.0.1", + "version": "1.0.3", "description": "Alternate version of GFM Markdown Wysiwyg Editor.", "keywords": [ "toast", diff --git a/src/js/wwCodeBlockManager.js b/src/js/wwCodeBlockManager.js index 3ee1db7b1e..914bd51b72 100644 --- a/src/js/wwCodeBlockManager.js +++ b/src/js/wwCodeBlockManager.js @@ -148,9 +148,10 @@ class WwCodeBlockManager { */ _mergeCodeblockEachlinesFromHTMLText(html) { html = html.replace(/
(.*?)<\/pre>/g, (match, codeAttr, code) => { - code = code.replace(/
/g, '\n'); + // code = code.replace(/
/g, '\n'); code = code.replace(//g, ''); code = code.replace(/\n$/, ''); + code = code.trim(); return ``; });${code}