{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/3811","repository_url":"https://api.github.com/repos/mapbox/mapbox-gl-js","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/3811/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/3811/comments","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/3811/events","html_url":"https://github.com/mapbox/mapbox-gl-js/issues/3811","id":195771865,"number":3811,"title":"Avoid breaking on wrong side of brackets","user":{"login":"1ec5","id":1231218,"avatar_url":"https://avatars.githubusercontent.com/u/1231218?v=3","gravatar_id":"","url":"https://api.github.com/users/1ec5","html_url":"https://github.com/1ec5","followers_url":"https://api.github.com/users/1ec5/followers","following_url":"https://api.github.com/users/1ec5/following{/other_user}","gists_url":"https://api.github.com/users/1ec5/gists{/gist_id}","starred_url":"https://api.github.com/users/1ec5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1ec5/subscriptions","organizations_url":"https://api.github.com/users/1ec5/orgs","repos_url":"https://api.github.com/users/1ec5/repos","events_url":"https://api.github.com/users/1ec5/events{/privacy}","received_events_url":"https://api.github.com/users/1ec5/received_events","type":"User","site_admin":false},"labels":[{"id":31015438,"url":"https://api.github.com/repos/mapbox/mapbox-gl-js/labels/enhancement","name":"enhancement","color":"0052cc","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-15T10:41:27Z","updated_at":"2016-12-16T00:17:59Z","closed_at":null,"body":"Per https://github.com/mapbox/mapbox-gl-js/pull/3743#issuecomment-266897015, we should weight all left and right brackets, not only ASCII parentheses, to avoid breaking on the wrong side of them. A comprehensive list of such brackets can be found by querying the Unicode Character Database for the following properties:\r\n\r\n* `Ps` (Punctuation, open)\r\n* `Pe` (Punctuation, close)\r\n* `Pi` (Punctuation, initial quote)\r\n* `Pf` (Punctuation, final quote)\r\n\r\n[This table](http://www.unicode.org/Public/UCD/latest/ucd/PropList.txt) may be a good starting point.\r\n\r\nOf interest to major Western languages are the following brackets:\r\n\r\n```\r\n()[]{}<>«»‹›\r\n```\r\n\r\nThese quotation marks may be problematic because they bind on different sides depending on the language. I think we should penalize them only when surrounded by ideographic characters:\r\n\r\n```\r\n“”‘’„\r\n```\r\n\r\nOf interest to CJK are the above, plus:\r\n\r\n```\r\n（）｛｝〔〕〘〙【】《》〈〉〖〗＜＞［］｟｠「」『』｢｣\r\n```\r\n\r\n/ref #3505\r\n/cc @ChrisLoer @nickidlugash"},"comment":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/comments/267483513","html_url":"https://github.com/mapbox/mapbox-gl-js/issues/3811#issuecomment-267483513","issue_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/3811","id":267483513,"user":{"login":"ChrisLoer","id":375121,"avatar_url":"https://avatars.githubusercontent.com/u/375121?v=3","gravatar_id":"","url":"https://api.github.com/users/ChrisLoer","html_url":"https://github.com/ChrisLoer","followers_url":"https://api.github.com/users/ChrisLoer/followers","following_url":"https://api.github.com/users/ChrisLoer/following{/other_user}","gists_url":"https://api.github.com/users/ChrisLoer/gists{/gist_id}","starred_url":"https://api.github.com/users/ChrisLoer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChrisLoer/subscriptions","organizations_url":"https://api.github.com/users/ChrisLoer/orgs","repos_url":"https://api.github.com/users/ChrisLoer/repos","events_url":"https://api.github.com/users/ChrisLoer/events{/privacy}","received_events_url":"https://api.github.com/users/ChrisLoer/received_events","type":"User","site_admin":false},"created_at":"2016-12-16T00:17:58Z","updated_at":"2016-12-16T00:17:58Z","body":"Maybe it simplifies things to just disable breaking for all of these when they're adjacent to non ideographic characters? Although opening/closing punctuation might be a decent breaking point in most western text, you'd also usually expect to have a space before or after the punctuation...\r\n\r\nFWIW, we can query the Unicode character properties table in our code using ICU, but it'll pull in a 35KB data dependency if we do."}}
{"actor":{"display_login":"ChrisLoer"}}