Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception thrown when pasting example code into WYSIWYG editor #693

Closed
docent opened this issue Nov 24, 2019 · 2 comments
Closed

Exception thrown when pasting example code into WYSIWYG editor #693

docent opened this issue Nov 24, 2019 · 2 comments

Comments

@docent
Copy link

docent commented Nov 24, 2019

Version

1.4.8

Test Environment

Linux, Chromium 78.0

Current Behavior

Open the editor "basic" example, select the example below and paste into WYSIWYG editor:

var foo = function (bar) {
  return bar++;
};

Expected Behavior

No exceptions should be thrown, but the following exception is thrown:

TypeError: Cannot set property 'innerHTML' of null
    at VM25 tui-editor-Editor-full.js:107801
    at Array.forEach (<anonymous>)
    at WwClipboardManager._replaceNewLineToBr (VM25 tui-editor-Editor-full.js:107799)
    at WwClipboardManager._preparePaste (VM25 tui-editor-Editor-full.js:107947)
    at WwClipboardManager._onWillPaste (VM25 tui-editor-Editor-full.js:107813)
    at WwClipboardManager._executeHandler (VM25 tui-editor-Editor-full.js:107707)
    at VM25 tui-editor-Editor-full.js:107685
    at VM25 tui-editor-Editor-full.js:36952
    at forEachArray (VM25 tui-editor-Editor-full.js:11653)
    at Object.forEach (VM25 tui-editor-Editor-full.js:11730)
@seonim-ryu
Copy link
Member

@docent
That's right. Thanks for the bug report.

@seonim-ryu
Copy link
Member

Case 1

When plain text containing a newline is pasted into the editor, the newline should be changed to <br>.

<span class="highlight" style="..."><span class="colour" style="..."><span class="font" style="..."><span class="size" style="font-size:13px">foo
bar</span></span></span></span>

Case 2

Newline characters should be preserved when text containing newline characters in the code block is pasted into the editor.

<pre style="..."><code style="..."><span style="box-sizing: border-box;">var</span> foo = <span style="box-sizing: border-box;"><span style="box-sizing: border-box;">function</span> (<span style="box-sizing: border-box;">bar</span>) </span>{
  <span style="box-sizing: border-box;">return</span> bar++;
};</code><br></pre>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants