{"action":"created","issue":{"url":"https://api.github.com/repos/tosdr/phoenix/issues/618","repository_url":"https://api.github.com/repos/tosdr/phoenix","labels_url":"https://api.github.com/repos/tosdr/phoenix/issues/618/labels{/name}","comments_url":"https://api.github.com/repos/tosdr/phoenix/issues/618/comments","events_url":"https://api.github.com/repos/tosdr/phoenix/issues/618/events","html_url":"https://github.com/tosdr/phoenix/issues/618","id":348289570,"node_id":"MDU6SXNzdWUzNDgyODk1NzA=","number":618,"title":"Annotation of long quotes is brittle","user":{"login":"Vinnl","id":4251,"node_id":"MDQ6VXNlcjQyNTE=","avatar_url":"https://avatars1.githubusercontent.com/u/4251?v=4","gravatar_id":"","url":"https://api.github.com/users/Vinnl","html_url":"https://github.com/Vinnl","followers_url":"https://api.github.com/users/Vinnl/followers","following_url":"https://api.github.com/users/Vinnl/following{/other_user}","gists_url":"https://api.github.com/users/Vinnl/gists{/gist_id}","starred_url":"https://api.github.com/users/Vinnl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vinnl/subscriptions","organizations_url":"https://api.github.com/users/Vinnl/orgs","repos_url":"https://api.github.com/users/Vinnl/repos","events_url":"https://api.github.com/users/Vinnl/events{/privacy}","received_events_url":"https://api.github.com/users/Vinnl/received_events","type":"User","site_admin":false},"labels":[{"id":749019785,"node_id":"MDU6TGFiZWw3NDkwMTk3ODU=","url":"https://api.github.com/repos/tosdr/phoenix/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-07T11:57:54Z","updated_at":"2018-08-15T13:55:34Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I'm not quite sure what the issue is, but my intuition is that there might be a different in how Javascript calculates string length and how Ruby does it - see e.g. https://mathiasbynens.be/notes/javascript-unicode#counting-symbols \r\n\r\nSee the screencast below: I select a range of text up to and including the word `GDPR`, but once annotated, that word is no longer included in the snippet. From a frustrating debugging session, I know at least that the document below contains some non-breaking spaces - I'm not sure how many code units that symbol is.\r\n\r\n![bug](https://user-images.githubusercontent.com/4251/43774172-914b8814-9a48-11e8-8c4b-524e14b24557.gif)\r\n\r\nI'm not quite sure what the best way to deal with this. \r\n\r\n- We might consider laying out the snippets in Javascript rather than in Ruby, but then we also need to do the same everywhere a snippet appears, e.g. on the point's page.\r\n- Another option is to somehow try to match the Javascript selection in Ruby against the document's text, but since the selection differs from the respective quote in the document (newlines in the document are spaces in the selection, for example), this can be difficult.\r\n- We could also try to do some normalisation when crawling a document. This could include removing at least special kinds of whitespace, maybe even special characters in general (but I can imagine we also want to support e.g. Japanese ToS), removing tags, potentially replacing them with simple newlines, etc.\r\n\r\nAnd that's even assuming that the issue here indeed is string length."},"comment":{"url":"https://api.github.com/repos/tosdr/phoenix/issues/comments/413204929","html_url":"https://github.com/tosdr/phoenix/issues/618#issuecomment-413204929","issue_url":"https://api.github.com/repos/tosdr/phoenix/issues/618","id":413204929,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMzIwNDkyOQ==","user":{"login":"michielbdejong","id":408412,"node_id":"MDQ6VXNlcjQwODQxMg==","avatar_url":"https://avatars2.githubusercontent.com/u/408412?v=4","gravatar_id":"","url":"https://api.github.com/users/michielbdejong","html_url":"https://github.com/michielbdejong","followers_url":"https://api.github.com/users/michielbdejong/followers","following_url":"https://api.github.com/users/michielbdejong/following{/other_user}","gists_url":"https://api.github.com/users/michielbdejong/gists{/gist_id}","starred_url":"https://api.github.com/users/michielbdejong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michielbdejong/subscriptions","organizations_url":"https://api.github.com/users/michielbdejong/orgs","repos_url":"https://api.github.com/users/michielbdejong/repos","events_url":"https://api.github.com/users/michielbdejong/events{/privacy}","received_events_url":"https://api.github.com/users/michielbdejong/received_events","type":"User","site_admin":false},"created_at":"2018-08-15T13:55:34Z","updated_at":"2018-08-15T13:55:34Z","author_association":"MEMBER","body":"I don't see the `br` and `strong` tags when testing this locally, but I guess that's because you made that screencast before you merged that PR.\r\n\r\nWhen I try to annotate that same text ('ever .. GDPR'), it creates a point with a quoteStart of -1. I think that may be related to the tags removal? Will add some debug statements to investigate further."}}
{"actor":{"display_login":"michielbdejong"}}