{"action":"created","issue":{"url":"https://api.github.com/repos/timdown/rangy/issues/272","labels_url":"https://api.github.com/repos/timdown/rangy/issues/272/labels{/name}","comments_url":"https://api.github.com/repos/timdown/rangy/issues/272/comments","events_url":"https://api.github.com/repos/timdown/rangy/issues/272/events","html_url":"https://github.com/timdown/rangy/issues/272","id":58074072,"number":272,"title":"SVG text highlighting","user":{"login":"parisni","id":9535350,"avatar_url":"https://avatars.githubusercontent.com/u/9535350?v=3","gravatar_id":"","url":"https://api.github.com/users/parisni","html_url":"https://github.com/parisni","followers_url":"https://api.github.com/users/parisni/followers","following_url":"https://api.github.com/users/parisni/following{/other_user}","gists_url":"https://api.github.com/users/parisni/gists{/gist_id}","starred_url":"https://api.github.com/users/parisni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parisni/subscriptions","organizations_url":"https://api.github.com/users/parisni/orgs","repos_url":"https://api.github.com/users/parisni/repos","events_url":"https://api.github.com/users/parisni/events{/privacy}","received_events_url":"https://api.github.com/users/parisni/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-18T14:28:28Z","updated_at":"2015-02-19T00:41:33Z","closed_at":null,"body":"Hello, \r\n\r\nDo you think it would be possible to highlight text in a SVG element ?\r\nI have a SVG file loaded in the DOM. It has some text :        \r\n\r\n```\r\n<svg height=\"30\" width=\"200\"><text x=\"0\" y=\"15\" fill=\"red\">I love SVG!</text></svg>\r\n```\r\n\r\nI have tried to manually add to the file : \r\n\r\n``` \r\n<svg height=\"30\" width=\"200\"><text x=\"0\" y=\"15\" fill=\"red\"><tspan class=\"hightligh\">I love SVG!</tspan></text></svg>\r\n```\r\nThis add a color to my text. However, when I apply your \"highlightSelection()\" function (and modify it a little to add \"tspan\" instead of \"span\" ), I get exactly the same result in the DOM, but as a result the text disapears. It seems that the CSS does not apply the same way\r\n\r\nThanks for any idea\r\n"},"comment":{"url":"https://api.github.com/repos/timdown/rangy/issues/comments/74979756","html_url":"https://github.com/timdown/rangy/issues/272#issuecomment-74979756","issue_url":"https://api.github.com/repos/timdown/rangy/issues/272","id":74979756,"user":{"login":"nchase","id":197309,"avatar_url":"https://avatars.githubusercontent.com/u/197309?v=3","gravatar_id":"","url":"https://api.github.com/users/nchase","html_url":"https://github.com/nchase","followers_url":"https://api.github.com/users/nchase/followers","following_url":"https://api.github.com/users/nchase/following{/other_user}","gists_url":"https://api.github.com/users/nchase/gists{/gist_id}","starred_url":"https://api.github.com/users/nchase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nchase/subscriptions","organizations_url":"https://api.github.com/users/nchase/orgs","repos_url":"https://api.github.com/users/nchase/repos","events_url":"https://api.github.com/users/nchase/events{/privacy}","received_events_url":"https://api.github.com/users/nchase/received_events","type":"User","site_admin":false},"created_at":"2015-02-19T00:41:33Z","updated_at":"2015-02-19T00:41:33Z","body":"I don't know the exact issue you guys are talking around, but I thought I'd chime in with a known-issue in IE11 w/r/t `classList`:\r\n\r\nthe `classList.toggle` method is a bit incomplete in IE. It doesn't take a second argument which will force toggling on/off based on whether or not a truthy value is passed to it ([source](https://connect.microsoft.com/IE/feedback/details/878564/element-classlist-toggle-does-not-support-second-parameter)), so you have to use a combination of `classList.add` and `classList.remove` instead."}}