by Anonymous » 21 Mar 2025, 08:49
Ich verwende die
-Plip -Board -API , um den HTML -Inhalt des Stils in die Zwischenablage zu kopieren. Beim Einfügen in
Microsoft PowerPoint möchte ich
Leading Spaces für Formatierungszwecke behalten. PowerPoint tritt jedoch diese Leerzeichen auf Paste ab.
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);
}
}
Was ich ausprobiert habe:
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?>
Ich verwende die [b] -Plip -Board -API [/b], um den HTML -Inhalt des Stils in die Zwischenablage zu kopieren. Beim Einfügen in [b] Microsoft PowerPoint [/b] möchte ich [b] Leading Spaces [/b] für Formatierungszwecke behalten. PowerPoint tritt jedoch diese Leerzeichen auf Paste ab.[code]/* 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);
}
}
[/code]
Was ich ausprobiert habe:
Verwenden von und style = "mso-spacerun: yes" (Quelle)-ohne Erfolg. Nicht brechensräume (u+00A0), was beim Kopieren des Inhalts [b] aus PowerPoint (z. B. in einen Code-Editor wie Intellij) zu Problemen führt, in dem Sie regelmäßige Räume wollen. PowerPoint [/b], [b] ohne sie in nicht blockierte Räume [/b] zu [url=viewtopic.php?t=12659]konvertieren[/url] (so bleiben sie regelmäßig Räume, wenn sie erneut kopiert werden). Hat jemand dies gelöst?>