Opened 6 weeks ago
Last modified 4 weeks ago
#65734 new enhancement
Classic Editor: Support pasted WebP image URLs in TinyMCE smart paste
| Reported by: | landian | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | TinyMCE | Version: | 7.1 |
| Severity: | normal | Keywords: | has-patch needs-testing |
| Cc: | Focuses: |
Description
In the Classic Editor, pasting a direct WebP image URL keeps the URL as plain text, while JPG/PNG/GIF URLs are converted into an <img> element by TinyMCE smart paste.
WordPress already supports WebP images, and current TinyMCE documents images_file_types as affecting which image URLs are recognized and placed in an img element by smart_paste. Its default list includes webp.
Steps to reproduce:
- Open the Classic Editor visual tab.
- Paste a direct image URL ending in .jpg, for example https://example.com/image.jpg.
- Confirm it is inserted as an image.
- Paste a direct image URL ending in .webp, for example https://example.com/image.webp.
Actual result:
The WebP URL remains plain text.
Expected result:
The WebP URL should be inserted as an image, consistent with JPG/PNG/GIF URL handling.
Patch:
The attached patch minimally updates the bundled TinyMCE paste plugin image URL detection to include webp, without changing file upload, drag-and-drop, or other editor behavior.
Attachments (2)
Change History (6)
This ticket was mentioned in PR #12718 on WordPress/wordpress-develop by id7368.
6 weeks ago
#1
#2
follow-up:
↓ 3
@
6 weeks ago
Test Report
I tested this issue in the Classic Editor (Visual mode) and was able to reproduce the reported behavior.
Before Patch
Pasting a direct .jpg, .png, or .gif image URL is automatically converted into an <img> element by TinyMCE Smart Paste.
Pasting a direct .webp image URL leaves the URL as plain text instead of inserting it as an image.
After Patch
Pasting a direct .webp image URL is now correctly converted into an <img> element, matching the existing behavior for .jpg, .png, and .gif image URLs.
I did not observe any regressions in Smart Paste behavior for the existing supported image formats.
Result
The patch resolves the issue by extending TinyMCE Smart Paste image URL detection to include .webp URLs while preserving the existing functionality for other image formats.
Environment:
WordPress: Current development version
Editor: Classic Editor (Visual mode)
Browser: Google Chrome
OS: Windows 10
Patch Testing: ✅ Passed
#3
in reply to: ↑ 2
@
5 weeks ago
Thank you for testing.
Replying to sanayasir:
Test Report
I tested this issue in the Classic Editor (Visual mode) and was able to reproduce the reported behavior.
Before Patch
Pasting a direct .jpg, .png, or .gif image URL is automatically converted into an <img> element by TinyMCE Smart Paste.
Pasting a direct .webp image URL leaves the URL as plain text instead of inserting it as an image.
After Patch
Pasting a direct .webp image URL is now correctly converted into an <img> element, matching the existing behavior for .jpg, .png, and .gif image URLs.
I did not observe any regressions in Smart Paste behavior for the existing supported image formats.
Result
The patch resolves the issue by extending TinyMCE Smart Paste image URL detection to include .webp URLs while preserving the existing functionality for other image formats.
Environment:
WordPress: Current development version
Editor: Classic Editor (Visual mode)
Browser: Google Chrome
OS: Windows 10
Patch Testing: ✅ Passed
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
## Summary
This updates the bundled TinyMCE paste plugin so Classic Editor smart paste recognizes direct WebP image URLs and inserts them as images, matching the existing JPG/PNG/GIF URL behavior.
## Why
WordPress supports WebP images, and current TinyMCE documents
images_file_typesas affecting which image URLs are recognized and placed in animgelement bysmart_paste. Its default list includeswebp.## Testing
.jpg,.jpeg,.png,.gif,.webp, and.WEBPimage URLs are recognized..svg, query-string URLs, and non-absolute URLs keep the previous behavior.