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

Use pasteHTML #868

Closed
kolesoffac opened this issue Aug 18, 2016 · 1 comment
Closed

Use pasteHTML #868

kolesoffac opened this issue Aug 18, 2016 · 1 comment

Comments

@kolesoffac
Copy link

When i add content use pasteHTML i have wrong.

var $contents = $('<ul><li>dfgdgfg<li><li class="ql-indent-1">dfgdgfg<li></ul>');
quill.pasteHTML(0, $contents[0].outerHTML);

result inserted "ordered" instaed "bullet" list.

I looked for code :

applyDelta:
....
delta = normalizeDelta(delta);
normalizeDelta:
....
if (op.attributes != null && (op.attributes.list || op.attributes.bullet)) {
          op = (0, _clone2.default)(op);
          if (op.attributes.list) {
            op.attributes.list = 'ordered';
          } else {
            op.attributes.list = 'bullet';
            delete op.attributes.bullet;
          }
        }

Why

if (op.attributes.list) {
            op.attributes.list = 'ordered';
          } 

?

In result "bullet" replace "ordered"?

@jhchen
Copy link
Member

jhchen commented Aug 18, 2016

#847

@jhchen jhchen closed this as completed Aug 18, 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

2 participants