{"action":"created","issue":{"url":"https://api.github.com/repos/quilljs/quill/issues/1023","repository_url":"https://api.github.com/repos/quilljs/quill","labels_url":"https://api.github.com/repos/quilljs/quill/issues/1023/labels{/name}","comments_url":"https://api.github.com/repos/quilljs/quill/issues/1023/comments","events_url":"https://api.github.com/repos/quilljs/quill/issues/1023/events","html_url":"https://github.com/quilljs/quill/issues/1023","id":180542185,"number":1023,"title":"Calling formatText() sometimes leads to the format extending upon more text input","user":{"login":"jc4p","id":207575,"avatar_url":"https://avatars.githubusercontent.com/u/207575?v=3","gravatar_id":"","url":"https://api.github.com/users/jc4p","html_url":"https://github.com/jc4p","followers_url":"https://api.github.com/users/jc4p/followers","following_url":"https://api.github.com/users/jc4p/following{/other_user}","gists_url":"https://api.github.com/users/jc4p/gists{/gist_id}","starred_url":"https://api.github.com/users/jc4p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jc4p/subscriptions","organizations_url":"https://api.github.com/users/jc4p/orgs","repos_url":"https://api.github.com/users/jc4p/repos","events_url":"https://api.github.com/users/jc4p/events{/privacy}","received_events_url":"https://api.github.com/users/jc4p/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/quilljs/quill/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-02T23:18:56Z","updated_at":"2016-10-21T01:00:06Z","closed_at":null,"body":"I'm really enjoying Quill, I've been messing around with adding some minor real time formatting to it. My first attempt is to automatically embolden text wrapped in asterisks, like: `*text*`.\r\n\r\nA minimal version of my code is here: http://codepen.io/jc4p/pen/dpVgjA?editors=1010\r\n\r\nI'm using `.on('text-change')` to continuously run the editor's contents through a simple regex which looks for `\\*.+?\\*`. I'm calling `.formatText(start, length, 'bold', true);` to format the text captured then immediately afterwards `.format('bold', false)` so this part of the API docs kicks in:\r\n\r\n>  If the user’s selection length is 0, i.e. it is a cursor, the format will be set active, so the next character the user types will have that formatting.\r\n\r\nThis works for the most part, and without it any text typed after the second `*` extends to be bold (not what I want).\r\n\r\nBut (and here's the bug) when it's the beginning of the line of text, the bolding still extends.\r\n\r\n**Steps for Reproduction**\r\n\r\n1. Visit http://codepen.io/jc4p/pen/dpVgjA\r\n2. In the Quill area, type `I am typing some *bold* text`.\r\n3. Delete all the text. (Sometimes I've been able to repro by just hitting new line, sometimes not. Deleting everything always repros though)\r\n4. Type `*bold* text`.\r\n\r\n**Expected behavior**:\r\n\r\n- In step 2, new input is plain after the `*bold*`.\r\n- In step 4, new input is plain after the `*bold*`.\r\n\r\n**Actual behavior**:\r\n\r\nIn step 4, text input after the `*bold*` is still formatted bold, even though `.format('bold', false)` has just been called.\r\n\r\nSince it only happens when the formatted region begins on the line.. I think it's due to the \"active\" format per API docs looking backwards from the format that just ended, and yeah.\r\n\r\n**Platforms**:\r\n\r\nI'm testing on Chrome 53 using Debian 8.\r\n\r\n**Version**:\r\n\r\n1.0.6"},"comment":{"url":"https://api.github.com/repos/quilljs/quill/issues/comments/255267748","html_url":"https://github.com/quilljs/quill/issues/1023#issuecomment-255267748","issue_url":"https://api.github.com/repos/quilljs/quill/issues/1023","id":255267748,"user":{"login":"jhchen","id":192974,"avatar_url":"https://avatars.githubusercontent.com/u/192974?v=3","gravatar_id":"","url":"https://api.github.com/users/jhchen","html_url":"https://github.com/jhchen","followers_url":"https://api.github.com/users/jhchen/followers","following_url":"https://api.github.com/users/jhchen/following{/other_user}","gists_url":"https://api.github.com/users/jhchen/gists{/gist_id}","starred_url":"https://api.github.com/users/jhchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhchen/subscriptions","organizations_url":"https://api.github.com/users/jhchen/orgs","repos_url":"https://api.github.com/users/jhchen/repos","events_url":"https://api.github.com/users/jhchen/events{/privacy}","received_events_url":"https://api.github.com/users/jhchen/received_events","type":"User","site_admin":false},"created_at":"2016-10-21T01:00:06Z","updated_at":"2016-10-21T01:00:06Z","body":"I think the timeout should no longer be necessary in 1.1.1. Can you check and confirm?"}}
{"actor":{"display_login":"jhchen"}}