{"action":"opened","issue":{"url":"https://api.github.com/repos/ottypes/rich-text/issues/13","labels_url":"https://api.github.com/repos/ottypes/rich-text/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/ottypes/rich-text/issues/13/comments","events_url":"https://api.github.com/repos/ottypes/rich-text/issues/13/events","html_url":"https://github.com/ottypes/rich-text/issues/13","id":93568865,"number":13,"title":"Uncaught Error: diff() called on non-document","user":{"login":"freakycue","id":1905412,"avatar_url":"https://avatars.githubusercontent.com/u/1905412?v=3","gravatar_id":"","url":"https://api.github.com/users/freakycue","html_url":"https://github.com/freakycue","followers_url":"https://api.github.com/users/freakycue/followers","following_url":"https://api.github.com/users/freakycue/following{/other_user}","gists_url":"https://api.github.com/users/freakycue/gists{/gist_id}","starred_url":"https://api.github.com/users/freakycue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freakycue/subscriptions","organizations_url":"https://api.github.com/users/freakycue/orgs","repos_url":"https://api.github.com/users/freakycue/repos","events_url":"https://api.github.com/users/freakycue/events{/privacy}","received_events_url":"https://api.github.com/users/freakycue/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-07T16:14:25Z","updated_at":"2015-07-07T16:14:25Z","closed_at":null,"body":"Hey,\r\nI experience the issue with [Quill](https://github.com/quilljs/quill) on bookmarklet script. After running it on http://www.dwr.com/ initialisation of quill fails with `Uncaught Error: diff() called on non-document`. I found, that it happens, because `clone` method of the `op` returns string instead of object.\r\nAfter replacing original clone method from https://github.com/ottypes/rich-text/blob/master/lib/op.js#L6,\r\nwith\r\n```\r\nclone: function (attributes, keepNull) {\r\n      if (!is.object(attributes)) return {};\r\n      var memo = {};\r\n      Object.keys(attributes).forEach(function(key) {\r\n        if (attributes[key] !== undefined && (attributes[key] !== null || keepNull)) {\r\n          memo[key] = attributes[key];\r\n        }\r\n      });\r\n      return memo;\r\n    },\r\n```\r\neverything goes normal. I think it could happen, because original website using some polyfil script. Any thoughts, how to fix or avoid this would be appreciate."}}