From 92350b635b2b9cd2efb02e37790365e509084682 Mon Sep 17 00:00:00 2001 From: Johnny Date: Tue, 23 Oct 2018 16:59:53 -0400 Subject: [PATCH] Allowed multi-line highlighting --- package-lock.json | 2 +- package.json | 2 +- src/js/wwCodeBlockManager.js | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) 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}
`; });