View Single Post
Old 09-04-2021, 02:15 PM   #24
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,779
Karma: 24088595
Join Date: Dec 2010
Device: Kindle PW2
@fxp33

If the feature is that important to you, why not use a plugin? The following code should do the trick:

Spoiler:
Code:
# -*- coding: utf-8 -*-
import sys
from PyQt5.Qt import QApplication

def run(bk):
    app = QApplication(sys.argv)
    clipboard = QApplication.clipboard()
    mime_data = clipboard.mimeData()
    
    if mime_data.hasHtml():
        app.clipboard().setText(mime_data.html())

    return 0

def main():
  print ("I reached main when I should not have\n")
  return -1

if __name__ == "__main__":
  sys.exit(main())


Just assign it one of the 10 plugin shortcuts and a corresponding keyboard shortcut, and you're good to go.

However, you might want to consider using PageEdit instead, because it'll significantly clean up the messy HTML code that some apps will copy to the clipboard.
Attached Files
File Type: zip CopyHTML.zip (1.6 KB, 607 views)
Doitsu is offline   Reply With Quote