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

Parchment Error thrown when trying to replace text that includes formatting and newlines #779

Closed
clemmy opened this issue Jun 29, 2016 · 1 comment

Comments

@clemmy
Copy link

clemmy commented Jun 29, 2016

When I have editor content that includes bolds and new lines, and I highlight all the text (via cursor or Control + A), then I press a key in order to replace the text, Quill throws an error, ParchmentError: [Parchment] Unable to create [object HTMLElement] blot. The stack trace is as follows:

create (quill.js:929)
(anonymous function) (quill.js:568)
ContainerBlot.update (quill.js:561)
FormatBlot.update (quill.js:1084)
(anonymous function) (quill.js:1503)
ScrollBlot.update (quill.js:1500)
update (quill.js:5759)
(anonymous function) (quill.js:1399)

Steps for Reproduction

  1. Visit http://beta.quilljs.com/playground/

  2. Paste the following into the editor.

    asdf

    asdf

  3. Select all the text (with cursor or by pressing Control + A)

  4. Press a key (e.g. 'x') in order to replace the selected text

  5. Observe that the error is thrown.

Expected behavior:
The selected text should be replaced with whatever you type.

Platforms: [ex. Chrome 52 on Mac 10.10.5]

Version: 1.0.6.Beta

@clemmy
Copy link
Author

clemmy commented Jun 29, 2016

Upon further analysis, it looks like query(input) is returning a Text element inside Firefox (where the behaviour is correct). However, query(input) is returning <b>X</b> in Chrome, which leads to a logic path that throws an error.

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