gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Unable to edit pasted HTML tags in post title in the main editor

Open mjdewitt opened this issue 3 years ago • 5 comments

What problem does this address?

Pasted text that contains HTML tags cannot be edited visually as title has no block edit nor can it be edited as code as the title block appears to be rendered unlike the post content.

What is your proposed solution?

  1. the code editor should treat the post title like any other editable block
  2. add separate editor settings to control the stripping of HTML tags from pasted text for both the title and content.
  3. Give the post title a block editor.

Is there a work-around?

Yes, Quick edit allows for the editing of HTML Tags

mjdewitt avatar Dec 29 '22 16:12 mjdewitt

Give the post title a block editor.

Hey there! With Site Editing, the Post Title is indeed an editable block. You can learn more about it here: https://wordpress.org/support/article/post-title-block/

This feature is available in block themes, like Twenty Twenty-Three, Twenty Twenty-Two, and any of the block themes you'll find here: https://wordpress.org/themes/tags/full-site-editing/

kathrynwp avatar Dec 29 '22 17:12 kathrynwp

I run into this issue regularly. I often have to manually copy and paste the code into a text editor to clean it up.

The Post Title block should not hide embedded html tags, or perhaps the view could be toggled to source view. It does not appear to render the <strong> tags in the editor I often encounter. It does not feel appropriate for post title to support html tags, but if that is a necessary function it should not filter out their view in the editor.

I am not using a block theme and don't intend to for all sites. Thanks

bozzmedia avatar Jan 12 '23 02:01 bozzmedia

When I copy and paste bold words from a google document file or any other site, it shows tag in the admin backend for the Twenty-Three, Twenty Twenty-One, Twenty Twenty-Two themes. It does not feel appropriate for the post title to support HTML we must use some esc filter to remove such HTML tag.

For better understanding I am posting a video: https://share.cleanshot.com/GTcXSfSJyBdM6rwDRTY4

Himshekhar07 avatar Feb 10 '23 04:02 Himshekhar07

Related: https://github.com/WordPress/gutenberg/issues/38668

bozzmedia avatar Feb 17 '23 21:02 bozzmedia

There's some detail on this also being an issue for the title block, as @kathrynwp referenced earlier.

"I discovered that there is a 'title block' in gutenberg. Probably this is the one that is used for the title. Anyway: If you add a new title block to the existing page, it also has the problem with tags 'working' in visual view, but not (showing) in 'edit mode'. So, the bug is in the title block."

Discussion here: https://www.facebook.com/groups/advancedwp/posts/6172112669517562/

bozzmedia avatar Feb 23 '23 01:02 bozzmedia