From my Notebook >

How to get xclip to copy HTML to the clipboard in proper text/html format

This worked for me in Ubuntu 22.04 (xclip version 0.13):

xclip -selection clipboard -t text/html -i < <(echo "<p>Here is a web link: <a href='http://example.com'>Example page</a>. <strong>This is said to be one of the most famous websites out there</strong>, for those who are in the know. Though, as always, <em>people have their opinions</em>.</p>")

After executing the line above, you’ll be able to paste rich HTML text into GMail, or other similar rich text editors.

Thanks to Protesilaos Stavrou for his help in figuring this out.

Have fun!