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

calling "dangerouslyPasteHTML()" with the same value wont always return the same HTML #1065

Closed
philly385 opened this issue Oct 21, 2016 · 0 comments

Comments

@philly385
Copy link

After applying "bold format" to only parts of a text in the editor, and then calling "dangerouslyPasteHTML()", the whole text becomes bold. I know in the documentation it says:

The snippet is interpreted by Clipboard matchers, which may not produce the exactly input HTML.

But to me this is a bug, so I'm posting this.
Note that this behaviour is also the case for "underline" and "italic" formatting. (This occurs only in my use-case, not in the codepen).

Steps for Reproduction

  1. Visit http://codepen.io/wu-philly/pen/GjwbKK
  2. Paste: <div><p><strong>Heading (Bold)</strong></p><p>This should not be bold until the user decides to format it bold.</p><p>But instead "dangerouslyPasteHTML()" formats the whole text. </p><p>However it does this all the time. Try to "unbold" everything except the heading and try again.</p></div> into text input.
  3. Click "pasteHtml" Button to paste it into the editor.
  4. Click again to trigger the bug.

Expected behavior: Calling "dangerouslyPasteHTML()" with the same value should return the same HTML everytime it is called.

Actual behavior: Calling the function for the first time returns the correct HTML. For calling it the second time it has added <strong>-Tags to every node with text.

Platforms:
Mac OSX Yosemite 10.10.3:
Chrome 54.0.2840.59 (64-bit)
Safari 8.0.6 (10600.6.3)
Firefox 49.0.2
Win10 v.1607:
Microsoft Edge 38.14393.0.0

Include browser, operating system and respective versions

Version: quill v1.1.0

Run v1.1.0 to find out

@philly385 philly385 changed the title "dangerouslyPasteHTML()" applies format to whole text calling "dangerouslyPasteHTML()" with same value wont always return the same HTML Oct 21, 2016
@philly385 philly385 changed the title calling "dangerouslyPasteHTML()" with same value wont always return the same HTML calling "dangerouslyPasteHTML()" with the same value wont always return the same HTML Oct 21, 2016
@jhchen jhchen closed this as completed in f64a8f2 Oct 23, 2016
tim-mc pushed a commit to tim-mc/quill that referenced this issue Dec 12, 2016
tim-mc pushed a commit to tim-mc/quill that referenced this issue Dec 12, 2016
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