Project

General

Profile

Actions

Bug #23969

open

Copy and pasting HTML pages into paragraph blocks loses certain formatting

Added by Raffi Khatchadourian 3 days ago. Updated about 14 hours ago.

Status:
New
Priority name:
Normal
Assignee:
-
Category name:
WordPress (misc)
Target version:
-
Start date:
2025-11-21
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

Copy and pasting HTML pages into paragraph blocks loses underlining. Interestingly, other formatting (e.g., boldface) remains. This seems like a relatively new development.

To reproduce, copy any underlined text on an HTML page into a paragraph block. I have attached a page with underlined text.

May be related to: https://wordpress.org/support/topic/pasting-in-post-loses-formatting/. But, I don't seem to have the mentioned plug-in installed. Moreover, I haven't changed the plug-in structure very much lately.


Files

all.html (35.3 KB) all.html Raffi Khatchadourian, 2025-11-21 05:44 PM
Screenshot_2025-11-24_11-12-35.png (33 KB) Screenshot_2025-11-24_11-12-35.png Boone Gorges, 2025-11-24 12:13 PM
Actions #1

Updated by Raffi Khatchadourian 3 days ago

May be related to https://redmine.gc.cuny.edu/issues/23169 but unsure. My guess is that it has something to do with recent theme updates. But, it is the editor that has the problem, so maybe it's a Wordpress update?

Actions #2

Updated by Raffi Khatchadourian 3 days ago

  • Subject changed from Copy and pasting HTML pages into classic blocks loses certain formating to Copy and pasting HTML pages into paragraph blocks loses certain formatting
Actions #3

Updated by Boone Gorges about 15 hours ago

Seems like this is, in part, a design decision by the WP team. See https://github.com/WordPress/gutenberg/issues/15590#issuecomment-523794936 and surrounding discussion. The 'u' tag is not part of the allowed HTML in the block editor, and underline is represented internally with a span that has a style declaration; but inline CSS is not "semantic" in the sense discussed here. This seems like a bit of odd inconsistency to me; if they represent underlines as styled spans, why wouldn't 'u' elements be translated into such on paste?

Anyway, I think this is beyond what we're able to fix, as it appears to be an intentional decision in WP. The only workaround I can offer at this time is to convert your 'u' elements to spans with style="text-decoration:underline;". See screenshot.

Actions #4

Updated by Raffi Khatchadourian about 14 hours ago

Interesting! It works fine in the classic block. Thanks, I'll try that.

Actions

Also available in: Atom PDF