Rich text editor - how to copy contents with formatting to clipboard

I want users to be able to copy to clipboard the contents in Bubble’s official rich text editor with formatting, so they can paste easily in Word, WordPress, etc.

However, when using the state “value”, it comes with the bbcode, e.g.

[h2]some header[/h2]

I tried tinkering with the plugin code, and at best, I can only access the HTML in plaintext, e.g.

<h2>some header</h2>

What I really want is for users to be able to copy the formatted text and not plaintext with those tags.

Any idea? Thanks!