{"action":"created","issue":{"url":"https://api.github.com/repos/ichord/At.js/issues/290","labels_url":"https://api.github.com/repos/ichord/At.js/issues/290/labels{/name}","comments_url":"https://api.github.com/repos/ichord/At.js/issues/290/comments","events_url":"https://api.github.com/repos/ichord/At.js/issues/290/events","html_url":"https://github.com/ichord/At.js/issues/290","id":79194197,"number":290,"title":"\"atwho-query\" and \"atwho-inserted\" not encapsulating suffix","user":{"login":"NSinopoli","id":541058,"avatar_url":"https://avatars.githubusercontent.com/u/541058?v=3","gravatar_id":"","url":"https://api.github.com/users/NSinopoli","html_url":"https://github.com/NSinopoli","followers_url":"https://api.github.com/users/NSinopoli/followers","following_url":"https://api.github.com/users/NSinopoli/following{/other_user}","gists_url":"https://api.github.com/users/NSinopoli/gists{/gist_id}","starred_url":"https://api.github.com/users/NSinopoli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NSinopoli/subscriptions","organizations_url":"https://api.github.com/users/NSinopoli/orgs","repos_url":"https://api.github.com/users/NSinopoli/repos","events_url":"https://api.github.com/users/NSinopoli/events{/privacy}","received_events_url":"https://api.github.com/users/NSinopoli/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-21T22:56:00Z","updated_at":"2015-06-01T22:36:54Z","closed_at":null,"body":"Hi there, thanks for all of your great work with this library!\r\n\r\nI've encountered an issue with the way suffixes are handled. The `span` elements that are generated do not include the suffix. Here's my code:\r\n\r\n```coffee\r\n$('#textarea')\r\n  .atwho({\r\n    at: '['\r\n    data: [{ name: 'total', description: 'total amount' }]\r\n    #insertTpl: '[${name}]'\r\n    displayTpl: '''\r\n      <li>\r\n        <p><strong>[${name}]</strong></p>\r\n        <p>${description}</p>\r\n      </li>\r\n    '''\r\n    suffix: ']'\r\n  })\r\n```\r\n\r\n### atwho-inserted\r\n\r\nSteps to reproduce:\r\n\r\n1. Type `[tot` in the textarea to see the menu come up.\r\n2. Hit tab to choose `[total]`\r\n3. Inspect the textarea element to view the markup:\r\n\r\n`<span class=\"atwho-inserted\">[total</span>]`\r\n\r\nNote how the suffix is _outside_ the span element.\r\n\r\n### atwho-query\r\n\r\nSteps to reproduce:\r\n\r\n1. Type `[total]` in the textarea.\r\n2. Move the cursor so that it's between the `l` and the `]`. \r\n3. Hit backspace (deleting the `l`), and then re-type `l`.\r\n4. Don't choose the element from the list.\r\n5. Inspect the textarea element to view the markup:\r\n\r\n`<span class=\"atwho-query\">[total</span>]`\r\n\r\nAgain, note how the suffix is outside the span element.\r\n\r\nWhat can I do to get the suffix inside the span elements? Thanks for any insight you can offer!"},"comment":{"url":"https://api.github.com/repos/ichord/At.js/issues/comments/107737924","html_url":"https://github.com/ichord/At.js/issues/290#issuecomment-107737924","issue_url":"https://api.github.com/repos/ichord/At.js/issues/290","id":107737924,"user":{"login":"NSinopoli","id":541058,"avatar_url":"https://avatars.githubusercontent.com/u/541058?v=3","gravatar_id":"","url":"https://api.github.com/users/NSinopoli","html_url":"https://github.com/NSinopoli","followers_url":"https://api.github.com/users/NSinopoli/followers","following_url":"https://api.github.com/users/NSinopoli/following{/other_user}","gists_url":"https://api.github.com/users/NSinopoli/gists{/gist_id}","starred_url":"https://api.github.com/users/NSinopoli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NSinopoli/subscriptions","organizations_url":"https://api.github.com/users/NSinopoli/orgs","repos_url":"https://api.github.com/users/NSinopoli/repos","events_url":"https://api.github.com/users/NSinopoli/events{/privacy}","received_events_url":"https://api.github.com/users/NSinopoli/received_events","type":"User","site_admin":false},"created_at":"2015-06-01T22:36:54Z","updated_at":"2015-06-01T22:36:54Z","body":"@ichord Thanks so much for tackling this!\r\n\r\nThe `atwho-inserted` issue I described above is fixed with your patch, but the `atwho-query` issue remains."}}