Skip to content

Twenty Nineteen: Replace whitespace character for heading decoration.#12121

Open
KarunyaChavan wants to merge 1 commit into
WordPress:trunkfrom
KarunyaChavan:fix/65433-2019-theme-empty-heading-hyphen
Open

Twenty Nineteen: Replace whitespace character for heading decoration.#12121
KarunyaChavan wants to merge 1 commit into
WordPress:trunkfrom
KarunyaChavan:fix/65433-2019-theme-empty-heading-hyphen

Conversation

@KarunyaChavan

Copy link
Copy Markdown

Trac ticket: https://core.trac.wordpress.org/ticket/65433

When a user inserts an empty heading block in the editor and applies an "Underline" or "Strikethrough" text decoration, the browser attempts to underline the pseudo-element's whitespace character. This interaction causes a stray, visible hyphen-like artifact to render inside the editor above the empty block as

Heading decorated with underline
Heading decorated with strikethrough

What this Changes

  • This PR updates the post-section-dash mixin in sass/mixins/_mixins-master.scss to use an empty string (content: "";) instead of content: "\020".
  • By removing the whitespace character, the pseudo-element no longer contains an actual text node.
  • Since the element has explicit display: block, width, and height properties, the decorative dash continues to render identically on the frontend and backend.
  • However, because there is no text content, the browser can no longer underline a whitespace character, completely resolving the visual bug in the editor without requiring any editor-specific CSS overrides.
Decorated Heading blocks after fix

Use of AI Tools

AI assistance: Yes
Tool(s): GitHub Copilot
Model(s): GPT-4o
Used for: To verify optimality and efficiency of the patch.


…nt stray hyphen.

- Replaces `content: "\020"` with `content: ""` in the `post-section-dash` mixin.
- Prevents a visible hyphen from rendering in the editor when an empty heading block has the underline text decoration active.
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@KarunyaChavan KarunyaChavan marked this pull request as ready for review June 8, 2026 10:58
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props karunyachavan84.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@KarunyaChavan KarunyaChavan changed the title Twenty Nineteen: Empty Heading block displays stray hyphen in editor when underline decoration is enabled. Twenty Nineteen: Replace whitespace character for heading decoration. Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant