WordPress.org

Make WordPress Core

Opened 2 months ago

Last modified 2 months ago

#53970 new enhancement

Add HTML mark tag support on Gutenberg

Reported by: isaumya Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Editor Keywords:
Focuses: ui Cc:

Description

Hi,
In Gutenberg when we are writing a paragraph or a list item, sometimes it is needed to highlight a certain part of the text without bolding them.

In HTML 5 there is a specific tag for this called mark. Using the mark tag we can highlight a certain part of the text so it will look like we have highlighted that text without doing anything crazy.

Here is an example code:

<p>I have a car and that car is <mark>super fast</mark> even on bad roads.</p>

You can take a deep drive into the mark tag here on the MDN Docs.

Currently, the only way to achieve it is by writing the paragraph or list item in the Gutenberg and then edit them as HTML and add the tag at which point Gutenberg doesn't recognize the element as the same element and ask users to convert it to HTML block.

It would be really awesome if a new icon can be added in the Gutenberg formatting menu just beside the icons of Bold, Italics etc. This Highlight icon will simply add the mark tag to the selected text and the rest will be automatically taken care of by the browser. It can further be custom styles in CSS if someone wants to do it. Honestly, it would be awesome to see it in Gutenberg.

Change History (1)

#1 @SergeyBiryukov
2 months ago

  • Focuses coding-standards removed

Hi there, welcome back to WordPress Trac! Thanks for the ticket.

I'm removing the coding-standards focus, as it looks like the ticket is not related to WordPress Coding Standards.

Note: See TracTickets for help on using tickets.