Code: Select all
/* Simplified example of the HTML code that I'm trying to copy */
const htmlText = ' Test';
async function copyToClipboard() {
try {
const data = [
new ClipboardItem({
'text/html': new Blob([htmlText], { type: 'text/html' })
})
];
await navigator.clipboard.write(data);
console.log('Plain text and HTML copied to clipboard');
} catch (err) {
console.error('Failed to copy both formats:', err);
}
}
Verwenden von und style = "mso-spacerun: yes" (Quelle)-ohne Erfolg. Nicht brechensräume (u+00A0), was beim Kopieren des Inhalts aus PowerPoint (z. B. in einen Code-Editor wie Intellij) zu Problemen führt, in dem Sie regelmäßige Räume wollen. PowerPoint , ohne sie in nicht blockierte Räume zu konvertieren (so bleiben sie regelmäßig Räume, wenn sie erneut kopiert werden). Hat jemand dies gelöst?>