I want to create a rich text hyperlink out of an url, which is then pasted as working link. In other words I want to create some sort of behaviour like in this example:
- On stackoverflow copy the tag catgory python
- Paste it in Microsoft Word
The result is a richt text hyperlink in word, which displays pyhton and if I click on the hyperlink it opens up the url https://stackoverflow.com/questions/tagged/python
In Javascript this can be done, somehow like described in 1933185
For pyhton I have found the module rich where you can achive this in a terminal, like describe in real-working-hyperlinks-in-the-terminal-with-rich. But I think this is the wrong approach for me.
The modules pyclip and pyperclip c'ant handle rich-text.
The basic idea is (done in python):
- Take a Url, like: https://stackoverflow.com/questions/tagged/python
- Create a hyperlink out of it:
<a href="https://stackoverflow.com/questions/tagged/python">python</a>
- Convert this to a rich-text-hyperlink: python
- Copy & paste the richt-text-hyperlink
The steps 1 and 2 are clear, but I struggle on step 3 and 4.
How can I create a rich-text-hyperlink in pyhton which can be pasted?