{"action":"created","issue":{"url":"https://api.github.com/repos/quilljs/quill/issues/374","labels_url":"https://api.github.com/repos/quilljs/quill/issues/374/labels{/name}","comments_url":"https://api.github.com/repos/quilljs/quill/issues/374/comments","events_url":"https://api.github.com/repos/quilljs/quill/issues/374/events","html_url":"https://github.com/quilljs/quill/issues/374","id":78871950,"number":374,"title":"applying custom format has unexpected behavior on element class name","user":{"login":"brettimus","id":3201327,"avatar_url":"https://avatars.githubusercontent.com/u/3201327?v=3","gravatar_id":"","url":"https://api.github.com/users/brettimus","html_url":"https://github.com/brettimus","followers_url":"https://api.github.com/users/brettimus/followers","following_url":"https://api.github.com/users/brettimus/following{/other_user}","gists_url":"https://api.github.com/users/brettimus/gists{/gist_id}","starred_url":"https://api.github.com/users/brettimus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brettimus/subscriptions","organizations_url":"https://api.github.com/users/brettimus/orgs","repos_url":"https://api.github.com/users/brettimus/repos","events_url":"https://api.github.com/users/brettimus/events{/privacy}","received_events_url":"https://api.github.com/users/brettimus/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-21T07:32:02Z","updated_at":"2015-05-23T21:57:57Z","closed_at":"2015-05-23T21:57:57Z","body":"Excuse the vague title, but I'm not sure if this is _actually_ a bug.\r\n\r\nI'm on Chrome 42, Mac.\r\n\r\nTo reproduce, go to the [quill home page](http://quilljs.com/), open up the console, and write\r\n\r\n```javascript\r\nquill.addFormat(\"mention\", { tag: \"SPAN\", \"class\": \"ql-mention-item\" });\r\nquill.insertText(0, \"this is a mention\", \"mention\", true);\r\n```\r\n\r\nLook at your inserted text in the inspector. You should see that quill appended `true` to the class name.\r\n\r\n![image](https://cloud.githubusercontent.com/assets/3201327/7743535/abd24376-ff50-11e4-8d4c-039733527386.png)\r\n\r\nUsing a default class name that is an empty string throws an error. Similarly, setting a class name with a space at the end will throw an error."},"comment":{"url":"https://api.github.com/repos/quilljs/quill/issues/comments/104947668","html_url":"https://github.com/quilljs/quill/issues/374#issuecomment-104947668","issue_url":"https://api.github.com/repos/quilljs/quill/issues/374","id":104947668,"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":"2015-05-23T21:57:57Z","updated_at":"2015-05-23T21:57:57Z","body":"The current class system is not designed for binary values, ex. having a set class vs not. The class key in the format config is meant to be a prefix for classnames and the suffix is the value, ex. with { class: \"author-\" } an html element with a classname author-jason would have the format with value jason.\r\n\r\nThe new custom format system currently being worked on will handle binary values but for now this is not specifically supported. A workaround might be:\r\n\r\n```js\r\nquill.addFormat(\"mention\", { tag: \"SPAN\", \"class\": \"ql-mention-\" });\r\nquill.insertText(0, \"this is a mention\", \"mention\", \"item\");\r\n```"}}