Codeinwp / Codeinwp/wp-maintenance-mode

Don't wrap text in an <h2>

Open
#270 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
PHP
Stars
163
Forks
82
Avg merge
8h 31m
Merged PRs (30d)
8

Description

When entering text in the rich text editor, it automatically adds all the HTML we need (<p>,<ul> or <ol>, etc.).

The plugin then wraps all of that content in an <h2> element, which is invalid HTML. The W3C HTML validator returns errors such as:

  • Element p not allowed as child of element h2 in this context.
  • Element ul not allowed as child of element h2 in this context.

Can the <h2> element be dropped and just use what the rich text editor generates?

If you were to implement this, you could stylize other block level elements using the same default CSS that you're currently using for <h2>. So unless users have overridden the default CSS, their content will still look the same.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the plugin code that wraps rich text editor output in an h2 element, then inspect the generated markup for paragraphs and lists. Confirm the change with the W3C HTML validator; done means block elements are no longer nested inside h2 and the existing default styling remains effective.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, php, wordpress
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.