Skip to content

Commit 6e3e173

Browse files
abhinavgandhamkemister85metricjs
authored
DOC-3224: powerpaste_emf_processor function that takes an emf blob and should return a promise of a png blob. (#3932)
* DOC-3224: function that takes an emf blob and should return a promise of a png blob. * DOC-3224: Fixed xref link. * DOC-3224: Added the note to the option documentation as well. * Update modules/ROOT/partials/configuration/powerpaste_emf_processor.adoc Co-authored-by: Millie <[email protected]> --------- Co-authored-by: Karl Kemister-Sheppard <[email protected]> Co-authored-by: Millie <[email protected]>
1 parent e060792 commit 6e3e173

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

modules/ROOT/pages/8.3.0-release-notes.adoc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,28 @@ include::partial$misc/admon-releasenotes-for-stable.adoc[]
2828

2929
The following premium plugin updates were released alongside {productname} {release-version}.
3030

31+
=== PowerPaste
32+
33+
The {productname} {release-version} release includes an accompanying release of the **PowerPaste** premium plugin.
34+
35+
**PowerPaste** includes the following addition.
36+
37+
==== `powerpaste_emf_processor` function that takes an `emf` blob and returns a promise of a `png` blob.
38+
39+
Before October 2025, copying and pasting content from Microsoft Word containing `emf` images resulted in those images not being pasted and an error message being displayed. After October 2025, this behavior changed where the images began appearing in the editor, but only at low resolution, accompanied by an error message in Chrome and Firefox. Safari displayed the low-resolution images without showing an error message.
40+
41+
This change negatively affected the user experience. After October 2025, users would see a low-quality image alongside an error message stating `Some images failed to import`, which caused confusion since the image was, in fact, visible in the editor—albeit with degraded quality.
42+
43+
{productname} {release-version} introduces a new option, xref:powerpaste-options.adoc#powerpaste_emf_processor[powerpaste_emf_processor], to address this issue. This option accepts a function that receives an `emf` blob and returns a promise resolving to a `png` blob (i.e. `(blob: Blob) => Promise<Blob>`).
44+
45+
* If this option is provided, the editor will invoke the supplied function to convert `emf` image blobs into `png` image blobs before inserting them into the editor.
46+
47+
* If this option is **not** provided, the editor will remove the low-quality images and display an error message, restoring the pre–October 2025 behavior.
48+
49+
NOTE: If only the image is selected, pasting it will succeed and the image will be inserted correctly. However, if the image is selected together with other types of content, such as text, the image will not be pasted and an error message will be displayed.
50+
51+
For information on the **PowerPaste** plugin, see: xref:introduction-to-powerpaste.adoc[PowerPaste].
52+
3153
=== Media Optimizer
3254

3355
The {productname} {release-version} release includes an accompanying release of the **Media Optimizer** premium plugin.

modules/ROOT/pages/powerpaste-options.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ include::partial$configuration/powerpaste_autolink_urls.adoc[leveloffset=+1]
2323

2424
include::partial$configuration/powerpaste_allow_local_images.adoc[leveloffset=+1]
2525

26+
include::partial$configuration/powerpaste_emf_processor.adoc[leveloffset=+1]
27+
2628
include::partial$configuration/paste_block_drop.adoc[leveloffset=+1]
2729

2830
include::partial$configuration/powerpaste_clean_filtered_inline_elements.adoc[leveloffset=+1]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[[powerpaste_emf_processor]]
2+
== `+powerpaste_emf_processor+`
3+
4+
This option controls how `emf` images are handled. If this option **is** provided, `emf` image blobs will be converted into `png` image blobs using the supplied function, which will then be pasted into the editor. If this option is **not** provided, the editor will remove the poor quality images, and show an error message.
5+
6+
*Type:* `+Function+`
7+
8+
=== Example: `+powerpaste_emf_processor+`
9+
10+
[source,js]
11+
----
12+
tinymce.init({
13+
selector: 'textarea', // change this value according to your HTML
14+
plugins: 'powerpaste',
15+
powerpaste_word_import: 'clean',
16+
powerpaste_emf_processor: (blob) => {
17+
return fetch('YOUR_IMAGE_URL').then(res => res.blob())
18+
}
19+
});
20+
----
21+
22+
NOTE: If only the image is selected, pasting it will succeed and the image will be inserted correctly. However, if the image is selected together with other types of content, such as text, the image will not be pasted and an error message will be displayed.

0 commit comments

Comments
 (0)