Bug(rich-text-editor): copying/pasting label + comment wrapper error

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

if you try to copy a label and a comment wrapper from rich text editor and paste it into ich text editor there are two errors

Steps to reproduce

  1. open the rich text editor

  2. switch to plain text

  3. insert e.g.

    <!-- my comment block -->
    ~"1st contribution" 
  4. switch back to rich text.

  5. mark all (strg + a)

  6. copy (strg + c)

  7. first error in console (this will always occure when copying comment wrapper)

    helpers.js:118 Uncaught TypeError: this.nodes[t.type.name] is not a function
     at et.serializeNodeInner (index.js:3286:81)
     at index.js:3278:34
     at o.forEach (index.js:250:13)
     at et.serializeFragment (index.js:3252:18)
     at C.n (copy_paste.js:125:76)
     at index.js:3049:26
     at un.someProp (index.js:5440:50)
     at pe (index.js:3047:17)
     at t.dom.addEventListener.t.input.eventHandlers.<computed> (index.js:3016:53)
     at HTMLDivElement.r (helpers.js:96:17)
  8. delete content of editor

  9. paste content

  10. next error

helpers.js:118 Uncaught TypeError: Cannot read properties of null (reading 'className')
 at Object.parseHTML (reference.js:46:43)
 at index.js:406:38
 at Array.reduce (<anonymous>)
 at Object.getAttrs (index.js:404:55)
 at _.matchTag (index.js:2612:39)
 at Y.addElement (index.js:2839:35)
 at Y.addDOM (index.js:2796:18)
 at Y.addAll (index.js:2973:18)
 at Y.addElementByRule (index.js:2961:18)
 at Y.addElement (index.js:2873:22)
 at Y.addDOM (index.js:2796:18)
 at Y.addAll (index.js:2973:18)
 at Y.addElementByRule (index.js:2961:18)
 at Y.addElement (index.js:2873:22)
 at Y.addDOM (index.js:2796:18)
 at Y.addAll (index.js:2973:18)
 at Y.addElementByRule (index.js:2961:18)
 at Y.addElement (index.js:2873:22)
 at Y.addDOM (index.js:2796:18)
 at Y.addAll (index.js:2973:18)
 at _.parseSlice (index.js:2599:17)
 at Xt (index.js:2806:24)
 at Ae (index.js:3572:17)
 at OMlb.le.paste (index.js:3601:17)
 at t.dom.addEventListener.t.input.eventHandlers.<computed> (index.js:3018:17)
 at HTMLDivElement.r (helpers.js:96:17)

Possible fixes

Edited by 🤖 GitLab Bot 🤖