Skip to content

Commit

Permalink
Allowed multi-line highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnny committed Oct 23, 2018
1 parent 90d168d commit 92350b6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/js/wwCodeBlockManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,10 @@ class WwCodeBlockManager {
*/
_mergeCodeblockEachlinesFromHTMLText(html) {
html = html.replace(/<pre( .*?)?>(.*?)<\/pre>/g, (match, codeAttr, code) => {
code = code.replace(/<br\s*\/?>/g, '\n');
// code = code.replace(/<br\s*\/?>/g, '\n');
code = code.replace(/<div ?(.*?)>/g, '');
code = code.replace(/\n$/, '');
code = code.trim();

return `<pre><code${(codeAttr || '')}>${code}</code></pre>`;
});
Expand Down

0 comments on commit 92350b6

Please sign in to comment.