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

Copy-paste (from Word) to email composer generates "undefined" #2394

Open
richardolsson opened this issue Nov 30, 2024 · 1 comment
Open
Assignees
Labels
🚪 entry-level Good for newcomers 🐬 Medium Just a nice sized issue.

Comments

@richardolsson
Copy link
Member

Description

To send mass email from Zetkin, one must compose the email in the editor (which is built using Editor.js). Some users will copy-paste content from other sources, e.g. from a word processing software (like Microsoft Word or LibreOffice).

Copy-pasting from Word or LibreOffice into the email composer will sometimes generate unexpected blocks, and render different content in the editor from what is represented in the editor state.

Steps to reproduce

  1. Download this sample document and open it in Word or LibreOffice (other software may also work)
  2. Select the entire "Clara Zetkin" section of the document and copy it
  3. Go to https://app.dev.zetkin.org/organize/1/projects
  4. Go into any project
  5. Create a new email
  6. Click the "Compose" tab
  7. Optionally type something into the composer manually
  8. Paste the content copied in step 2
  9. Browse to the API resource for the email to see it's blocks. The resource will be at /api/orgs/1/emails/<email-id>, and <email-id> can be found in the URL of the compose page
  10. Using the uuid from the API response, browse to the web view of the email at /o/1/viewmail/<uuid>

Expected Behaviour

The rendered email (in the web view) should look very similar to what is rendered in the composer, and should contain all of the content pasted from the document.

Actual Behaviour

The rendered email does not display any of the content that was pasted into the composer. When you look at the API response (step 9) it becomes clear that the blocks generated from the editor content are nothing like the content displayed. It's full of unnamed variables:

{"kind":"variable","name":""}

Screenshots (if you have any)

The document (step 2)

image

Pasted into the composer (step 8)

image

Email data in API

image

Web view of email

image

@richardolsson richardolsson added 🚪 entry-level Good for newcomers 🐬 Medium Just a nice sized issue. labels Nov 30, 2024
@neta-kedem
Copy link
Collaborator

looking into this

@neta-kedem neta-kedem self-assigned this Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚪 entry-level Good for newcomers 🐬 Medium Just a nice sized issue.
Projects
None yet
Development

No branches or pull requests

2 participants