{"action":"created","issue":{"url":"https://api.github.com/repos/quilljs/quill/issues/1232","repository_url":"https://api.github.com/repos/quilljs/quill","labels_url":"https://api.github.com/repos/quilljs/quill/issues/1232/labels{/name}","comments_url":"https://api.github.com/repos/quilljs/quill/issues/1232/comments","events_url":"https://api.github.com/repos/quilljs/quill/issues/1232/events","html_url":"https://github.com/quilljs/quill/issues/1232","id":198531620,"number":1232,"title":"Inline blot similar to Link","user":{"login":"danielschwartz","id":505433,"avatar_url":"https://avatars2.githubusercontent.com/u/505433?v=4","gravatar_id":"","url":"https://api.github.com/users/danielschwartz","html_url":"https://github.com/danielschwartz","followers_url":"https://api.github.com/users/danielschwartz/followers","following_url":"https://api.github.com/users/danielschwartz/following{/other_user}","gists_url":"https://api.github.com/users/danielschwartz/gists{/gist_id}","starred_url":"https://api.github.com/users/danielschwartz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielschwartz/subscriptions","organizations_url":"https://api.github.com/users/danielschwartz/orgs","repos_url":"https://api.github.com/users/danielschwartz/repos","events_url":"https://api.github.com/users/danielschwartz/events{/privacy}","received_events_url":"https://api.github.com/users/danielschwartz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2017-01-03T17:57:57Z","updated_at":"2018-04-09T08:45:12Z","closed_at":null,"author_association":"NONE","body":"Hi All,\r\n\r\nI'm trying to create a custom blot that is similar to Link in that typing after it doesn't keep the formatting (e.g. typing after the blot doesn't keep the same format, but reverts to no formatting), but typing inside of does. My code is below, which follow the Link blot code almost exactly (except for adding properties other than href or blocking certain formatting options), any idea why I can't get this to work?\r\n\r\n```js\r\nimport Inline from '../blots/inline';\r\n\r\n\r\nclass UserMention extends Inline {\r\n    static create(value) {\r\n        let node = super.create(value);\r\n        node.setAttribute('data-user-id', value.userId);\r\n        node.setAttribute('data-user-name', value.userName);\r\n        return node;\r\n    }\r\n\r\n    static formats(domNode) {\r\n        return {\r\n            userName: domNode.getAttribute('data-user-name'),\r\n            userId: domNode.getAttribute('data-user-id')\r\n        }\r\n    }\r\n}\r\n\r\nUserMention.blotName = 'user-mention';\r\nUserMention.className = 'user-mention'\r\nUserMention.tagName = 'SPAN';\r\n\r\nexport default UserMention;\r\n```"},"comment":{"url":"https://api.github.com/repos/quilljs/quill/issues/comments/379679411","html_url":"https://github.com/quilljs/quill/issues/1232#issuecomment-379679411","issue_url":"https://api.github.com/repos/quilljs/quill/issues/1232","id":379679411,"user":{"login":"joeribakker","id":1791066,"avatar_url":"https://avatars2.githubusercontent.com/u/1791066?v=4","gravatar_id":"","url":"https://api.github.com/users/joeribakker","html_url":"https://github.com/joeribakker","followers_url":"https://api.github.com/users/joeribakker/followers","following_url":"https://api.github.com/users/joeribakker/following{/other_user}","gists_url":"https://api.github.com/users/joeribakker/gists{/gist_id}","starred_url":"https://api.github.com/users/joeribakker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joeribakker/subscriptions","organizations_url":"https://api.github.com/users/joeribakker/orgs","repos_url":"https://api.github.com/users/joeribakker/repos","events_url":"https://api.github.com/users/joeribakker/events{/privacy}","received_events_url":"https://api.github.com/users/joeribakker/received_events","type":"User","site_admin":false},"created_at":"2018-04-09T08:45:12Z","updated_at":"2018-04-09T08:45:12Z","author_association":"NONE","body":"It seems to me that it has something to do with either the cursor's behaviour:\r\n\r\nhttps://github.com/quilljs/quill/blob/master/blots/cursor.js#L66\r\n\r\nOr (or rather, maybe in combination with) Inline's `order` attribute:\r\n\r\nhttps://github.com/quilljs/quill/blob/c9a2e9f4d0bbeeae20f15dd0bdad143a241a5275/blots/inline.js#L43\r\n\r\nChanging a linkblot's name to `code` yields the same behaviour, while changing it to something arbitrary (even though I'm keeping the `A` tag name) makes the format expand rather than stop with inserting new characters after its end.\r\n\r\nI'm not quite sure how to manipulate these functionalities in order to add my own format that will behave like a link; I've added my own format's `blotName` at the end of the `order` list, but that doesn't cut it."}}
{"actor":{"display_login":"joeribakker"}}