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

Pad crashes on pasting html containing <li> #6665

Open
dcht00 opened this issue Sep 16, 2024 · 7 comments
Open

Pad crashes on pasting html containing <li> #6665

dcht00 opened this issue Sep 16, 2024 · 7 comments

Comments

@dcht00
Copy link
Collaborator

dcht00 commented Sep 16, 2024

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.

@SamTV12345
Copy link
Member

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

@dcht00
Copy link
Collaborator Author

dcht00 commented Sep 16, 2024

:) 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 .

@SamTV12345
Copy link
Member

That works unfortunately too on my instance https://pad.samtv.fyi/p/test

@dcht00
Copy link
Collaborator Author

dcht00 commented Sep 25, 2024

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

@SamTV12345
Copy link
Member

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

image

The pad is still intact or did I misread the pad crash?

@dcht00
Copy link
Collaborator Author

dcht00 commented Oct 14, 2024

Sorry, missed the question there,
yes, on refresh, the pad is as was before the paste.

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

No branches or pull requests

3 participants
@dcht00 @SamTV12345 and others