{"action":"created","issue":{"url":"https://api.github.com/repos/HubSpot/draft-convert/issues/90","repository_url":"https://api.github.com/repos/HubSpot/draft-convert","labels_url":"https://api.github.com/repos/HubSpot/draft-convert/issues/90/labels{/name}","comments_url":"https://api.github.com/repos/HubSpot/draft-convert/issues/90/comments","events_url":"https://api.github.com/repos/HubSpot/draft-convert/issues/90/events","html_url":"https://github.com/HubSpot/draft-convert/issues/90","id":251671060,"number":90,"title":"Custom Inline style's HTML is produced inconsistently","user":{"login":"shapiroronny","id":11403966,"avatar_url":"https://avatars0.githubusercontent.com/u/11403966?v=4","gravatar_id":"","url":"https://api.github.com/users/shapiroronny","html_url":"https://github.com/shapiroronny","followers_url":"https://api.github.com/users/shapiroronny/followers","following_url":"https://api.github.com/users/shapiroronny/following{/other_user}","gists_url":"https://api.github.com/users/shapiroronny/gists{/gist_id}","starred_url":"https://api.github.com/users/shapiroronny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shapiroronny/subscriptions","organizations_url":"https://api.github.com/users/shapiroronny/orgs","repos_url":"https://api.github.com/users/shapiroronny/repos","events_url":"https://api.github.com/users/shapiroronny/events{/privacy}","received_events_url":"https://api.github.com/users/shapiroronny/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-08-21T14:19:40Z","updated_at":"2018-05-08T22:26:02Z","closed_at":null,"author_association":"NONE","body":"Hey,\r\n\r\nI've added a custom inline style for coloring some text. Using styleToHTML I create a `<span>` with some inline style.\r\nIf the same text range also has 'underline' style there is no way to control the processing order of the styles and they are treated in the order they were applied.\r\nThis may cause issues as \r\n`<span style=\"color: blue\"><u>text</u></span>`\r\nand \r\n`<u><span style=\"color: blue\">text</span></u> `\r\nare different. In the latter case the color style doesn't affect the underline.\r\n\r\nI've tried changing the way underlines are treated to create a `<span style=\"text-decoration: underline\">`\r\nbut unfortunately the spans don't merge even if they have the same range so I'm facing the same problem.\r\n\r\nIs there a way around this ?\r\nI imagine merging identical tags (and the style attribute) is a possible solution.\r\nAnother solution is somehow controlling the style processing order by somehow specifying priority.\r\n\r\nA temporary workaround is to remove the underline before I apply a color and then set it again. If the underline is the last added style it's always handled first when the custom HTML is generated, but that feels really hacky.\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/HubSpot/draft-convert/issues/comments/387561946","html_url":"https://github.com/HubSpot/draft-convert/issues/90#issuecomment-387561946","issue_url":"https://api.github.com/repos/HubSpot/draft-convert/issues/90","id":387561946,"user":{"login":"benbriggs","id":1313497,"avatar_url":"https://avatars3.githubusercontent.com/u/1313497?v=4","gravatar_id":"","url":"https://api.github.com/users/benbriggs","html_url":"https://github.com/benbriggs","followers_url":"https://api.github.com/users/benbriggs/followers","following_url":"https://api.github.com/users/benbriggs/following{/other_user}","gists_url":"https://api.github.com/users/benbriggs/gists{/gist_id}","starred_url":"https://api.github.com/users/benbriggs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benbriggs/subscriptions","organizations_url":"https://api.github.com/users/benbriggs/orgs","repos_url":"https://api.github.com/users/benbriggs/repos","events_url":"https://api.github.com/users/benbriggs/events{/privacy}","received_events_url":"https://api.github.com/users/benbriggs/received_events","type":"User","site_admin":false},"created_at":"2018-05-08T22:26:02Z","updated_at":"2018-05-08T22:26:02Z","author_association":"COLLABORATOR","body":"Definitely - that was kind of what I was getting at with:\r\n> We could probably do a similar thing with tag names to keep some semantic meaning in the output\r\n\r\nI think we could do something to look at tag names where it inherits the new tag name as it merges until it merges in one with meaning (i.e. something other than `span`). If it encounters more than one non-`span` tag name it could either start a new stack of merged styles or just abort merging altogether. Do you think that'd cover your use case?"}}
{"actor":{"display_login":"benbriggs"}}