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/pasted html is treated as plain text #4268

Open
conradfr opened this issue Jun 24, 2024 · 0 comments
Open

Copy/pasted html is treated as plain text #4268

conradfr opened this issue Jun 24, 2024 · 0 comments

Comments

@conradfr
Copy link

I can't figure how to get pasted html text (as a user, not programmatically) and get it interpreted correctly and not as plain text.

I try :

const quill = new Quill('#editor', {
  modules: {
    toolbar: [
      [{ header: [1, 2, false] }],
      ['bold', 'italic', 'underline'],
      ['image', 'code-block'],
    ],
  },
  placeholder: 'Compose an epic...',
  theme: 'snow', // or 'bubble'
});

and

const quill = new Quill('#editor', {
  modules: {
    toolbar: [
      [{ header: [1, 2, false] }],
      ['bold', 'italic', 'underline'],
      ['image', 'code-block'],
    ],
    clipboard: {
      allowed: {
        tags: ['a', 'b', 'strong', 'em', 'i', 'p', 'br']
      }
    }
  },
  placeholder: 'Compose an epic...',
  theme: 'snow', // or 'bubble'
});

here

Expected behavior:

When html content like <p>Lorem ipsum</p> dolor <strong>sit</strong> amet is pasted by the user the content is formatted by Quill accordingly.

Actual behavior:

It's displayed as-is.

Platforms:

Firefox / Chrome / Safari

Version:

2.02

I guess I'm missing something very basic but what?

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

1 participant