mshytikov / jira-shortcut

Chrome extension. https://chrome.google.com/webstore/detail/jira-shortcut/kjofpimpbjninggehnclcgkgniacejha
20 stars 9 forks source link

Copied link includes custom style #7

Open erwa opened 6 years ago

erwa commented 6 years ago

Hi Max,

Thank you for this useful plugin. Just one suggestion for an improvement: I use the "Email" config, which creates a hyperlinked text snippet. However, the snippet includes some style CSS, which causes it to look different from the rest of my email message. The raw snippet that gets copied to my clipboard looks like:

<meta charset='utf-8'><a href="https://issues.apache.org/jira/browse/HIVE-15353" style="font-family: system-ui, &quot;PingFang TC&quot;, &quot;Heiti TC&quot;, sans-serif; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;">HIVE-15353: Metastore throws NPE if StorageDescriptor.cols is null</a>

Is it possible to not include the style CSS in what's copied to the clipboard?

mshytikov commented 6 years ago

Hey @erwa. Sorry for the late reply. I will look into it.

erwa commented 6 years ago

Thank you very much!

mshytikov commented 6 years ago

Hey @erwa ,

I have checked different options, and unfortunately have not found any solution. The problem is quite deep and lies in browser implementation. I have found update which was released recently https://developers.google.com/web/updates/2018/03/clipboardapi But unfortunately Chrome currently only supports writeText and does not support write which I need for copying HTML snippet. For now I will live the ticket open. Let's wait a bit for Chrome to fully support clipboard API. Only then I can fix the issue.

Thank you for using extension and reporting the issue.

erwa commented 6 years ago

Thanks for investigating, Max.