hluk / CopyQ

Clipboard manager with advanced features
GNU General Public License v3.0
8.68k stars 441 forks source link

BG color & Font color - black #1464

Open PaPa31 opened 4 years ago

PaPa31 commented 4 years ago

Describe the bug If I copy selected text from OneNote online page (example of online page, but you won't be able to open it due to permission) i see black font on black background in copy history.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://www.onenote.com/notebooks'
  2. Make or open your account
  3. Create notebook
  4. Create page
  5. Type some text in the page
  6. Copy this text....

.. and now open copyQ history - you will see black font on the black background.

Expected behavior Fix bg & font colors at copy from OneNote online

Screenshots Screenshot from 2020-08-24 19-27-27

Version, OS and Environment (Get details from copyq version command if possible.)

Additional context

hluk commented 4 years ago

I'm afraid that it's a bad or overly-complex HTML code. You can check the text/html format by selecting the item in CopyQ and pressing F4 shortcut (from menu bar: Item - Show Content...).

As workaround, change settings in CopyQ to store and display only plain text.

Another way (but bit more complicated) would be to fix the HTML code automatically after copying with a custom command in CopyQ.

madprops commented 3 years ago

As workaround, change settings in CopyQ to store and display only plain text.

This helped. I also increased font size to 14 and max number of lines to 4.

wyldphyre commented 2 years ago

I see the same thing with links to items in Devops. The links are typically created by using the 'copy work item title' option that is available in various locations.

When I show content on the item (as mentioned above), there are both 'text/plain' and 'text/html' formats. The HTML one looks like the following (I replaced the URL, but it's otherwise untouched)

<html>
<body>
<!--StartFragment--><a href="https://dev-ops-url-goes-here" style="box-sizing: inherit; color: inherit; font-family: &quot;Segoe UI&quot;, -apple-system, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, Helvetica, Ubuntu, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;; font-size: 14px; 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: pre; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: inherit;">Pull Request 23031</a><span style="box-sizing: inherit; color: inherit; font-family: &quot;Segoe UI&quot;, -apple-system, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, Helvetica, Ubuntu, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;; font-size: 14px; 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: pre; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: inherit; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">: fix: Warning of existing enrolment not showing #71716</span><!--EndFragment-->
</body>
</html>
RuthlessRuler commented 2 years ago

Im having similar issues with leetcode. Let's say I'm coping my own solutions to a problem under submission tab, then the text is block of black in Firefox while in Chrome it's kinda Black with text being slightly visible.

p4r4g commented 1 year ago

Use cmd and run it automatically for each paste. Refer the below as example.

Steps:

  1. Follow the steps to copy new command from - https://copyq.readthedocs.io/en/latest/command-examples.html#remove-background-and-text-colors
  2. I have modified the code to only remove bg-color
    
    copyq:
    var html = str(input())
    html = html.replace(/background-color\s*:/g, 'xxx:')
    setData('text/html', html)

3. In the commands window (F6) -> Click Advanced and modify the code as shown above.
4. Select Type : Automatic (runs on every clipboard)