Pad crashes on pasting html containing <li>
Env: Ubuntu + Firefox
Reproduce:
echo '<li>this crashes</li>' | xclip -selection clipboard -t text/html
(or just copy any html with a list item)
... and paste into a pad
Result
TypeError: b.lineAttributes.list is undefined
at https://#####/padbootstrap-sxsSWavtLWA.min.js at line 20
ErrorId: vYIhQJ3X8o7VeqsTlv2t
Uncaught exception
URL: https://#####/p/test-wtfpaste
UserAgent: Mozilla/5.0 (X11; Linux x86_64; rv:129.0) Gecko/20100101 Firefox/129.0
Discovered by trying to paste a ChatGPT response including a list of items into a pad.
echo '<li>this crashes</li>' | xclip -selection clipboard -t text/html
@Gared Do you use Ubuntu by chance? I used Windows and just copy pasted the W3C example to my pad and it didn't do anything https://www.w3schools.com/html/tryit.asp?filename=tryhtml_lists_intro
:) That example works for me too.
Try this: https://archive.totalism.org/breaks_etherpad.html
I think w3c one works because there's an ul around, which is technically mandatory. When copying from there , even if you just take a single item, Firefox makes another copy buffer:
in addition to text/html
<meta http-equiv="content-type" content="text/html; charset=utf-8"><li>Tea</li>
also text/_moz_htmlcontext
<html><body contenteditable="false"><ul></ul></body></html>
Not sure how it all works there ... but in any case, it breaks on my example, and also copying from ChatGPT, if you don't also capture the before-beginning of the list, which includes the ul .
That works unfortunately too on my instance https://pad.samtv.fyi/p/test
Weird! For me, on that instance, with Chromium:
TypeError: Uncaught TypeError: Cannot read properties of undefined (reading 'indexOf')
at https://pad.samtv.fyi/padbootstrap-dFzLwc4hpa0.min.js at line 20
ErrorId: 3IjNALPg8ERIiv9pM1AY
Uncaught exception
URL: https://pad.samtv.fyi/p/test
UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
With Firefox:
TypeError: b.lineAttributes.list is undefined
at https://pad.samtv.fyi/padbootstrap-dFzLwc4hpa0.min.js at line 20
ErrorId: 00GdaCnxM3eJOfhYNWSY
Uncaught exception
URL: https://pad.samtv.fyi/p/test
UserAgent: Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0
Weird! For me, on that instance, with Chromium:
TypeError: Uncaught TypeError: Cannot read properties of undefined (reading 'indexOf') at https://pad.samtv.fyi/padbootstrap-dFzLwc4hpa0.min.js at line 20 ErrorId: 3IjNALPg8ERIiv9pM1AY Uncaught exception URL: https://pad.samtv.fyi/p/test UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36With Firefox:
TypeError: b.lineAttributes.list is undefined at https://pad.samtv.fyi/padbootstrap-dFzLwc4hpa0.min.js at line 20 ErrorId: 00GdaCnxM3eJOfhYNWSY Uncaught exception URL: https://pad.samtv.fyi/p/test UserAgent: Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0
The pad is still intact or did I misread the pad crash?
Sorry, missed the question there, yes, on refresh, the pad is as was before the paste.