What is the best way to copy HTML to a clipboard, so that the user can copy it prettified to Email clients (at least outlook)?
I have an Angular app running which uses Angular Materials Clipboard module to copy content to the clipboard:
import { Clipboard } from '@angular/cdk/clipboard';
constructor(private clipboard: Clipboard) { }
copy(): void {
const content = document.getElementById('copy-field');
this.clipboard.copy(pretty(content!.innerHTML));
}
I understand that I copy HTML code. So after copy(), I paste raw HTML. Is there any way to render this HTML code before copying it? Or can I use the rendered code directly?
What do I want to achieve?
The user should be able to copy everything to his/her email client. For example, an image with text should be displayed like in the browser. But my current solution displays the HTML (...).