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

pasteHTML (pasting html generated by Quill) is stripping out ql-indent classes #681

Closed
jonnolen opened this issue May 19, 2016 · 4 comments

Comments

@jonnolen
Copy link
Contributor

Calling pasteHTML with quill generated html that has indented bits (ie. <p class="ql-indent-1">...) strips off the ql-indent-1 class name in the editor and removes the indent. This happens with nested lists too.

Steps for Reproduction

  1. Visit http://codepen.io/jonnolen/pen/GZaaaX
  2. Enter text into left hand quill editor that is indented.
  3. Press "Paste It!" button, (it calls pasteHTML with a copy of the html that has been stashed in a hidden div.)

Expected behavior: Indents are preserved in the editor.

Actual behavior: Indents are stripped.

Platforms: Chrome 50.0.2661.94 (64-bit) on Mac OS 10.11.4

Version: 1.0.0-beta.2-5aa302

@Sritharan-racap
Copy link

I am also facing the same issue. When I copy a content from other text editor like MS Word, it is striping off the indent from the styling. I have been choked up with this issue for 2 days. Its a nightmare!!!

@jonnolen
Copy link
Contributor Author

I do not believe that this is the same issue as #673, this is calling the pasteHTML method from code using html that was originally generated by the quill editor.

@jonnolen
Copy link
Contributor Author

So a clue to what may be causing this... If I change the whitelist for the IndentAttributor to be an array of strings then the indents are correctly applied when pasteHTML() is called. However, the +1 button no longer works because of a place in parchment where the whitelist is now being searched for a numeric value instead of a string value and the canAdd call fails....

Actually... i think i may have fixed it, stand by for PR.

@jhchen
Copy link
Member

jhchen commented May 23, 2016

Closed by merged PR.

@jhchen jhchen closed this as completed May 23, 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

3 participants