Repository navigation
Twenty Nineteen: Replace whitespace character for heading decoration. - #12121
KarunyaChavan wants to merge 4 commits into
Conversation
…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.
Test using WordPress PlaygroundThe 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
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
|
There are merge conflicts with this, if we can get a new patch worked on, happy to do that. |
sabernhardt
left a comment
There was a problem hiding this comment.
I applied the patch cleanly via Tortoise SVN, but it would be good to refresh the PR again after r64610.
Test Report
Patch tested: https://github.com/WordPress/wordpress-develop/pull/12121.diff
Environment
- WordPress: 7.2-beta1-64606-src at revision 64673
- PHP: 8.4.0
- Server: Apache/2.4.62 (Win64) PHP/8.4.0 mod_fcgid/2.3.10-dev
- Database: mysqli (Server: 9.1.0 / Client: mysqlnd 8.4.0)
- Browsers:
- Firefox 158.0, using private window for the front-end screenshots and default window to show the editor
- Edge 155.0.4283.62, with Explain & Send Screenshots extension
- Google Chrome 155.0.8059.80, combining 3 screenshots
- OS: Windows 11
- Theme: Twenty Nineteen 3.4, as it is in trunk
Steps taken
- Create a new post.
- Add a title, and enable comments.
- Add H1 and H2 headings, or even all heading levels.
- If using Heading blocks, copy all blocks and set additional headings to Align text center and Align text right.
- Publish the post and add an approved comment.
- Copy the headings from the post and paste them in the widget area. Update the widgets.
- Visit the post author's User profile, add Biographical Info for the author of the post, and save changes.
- View the post on the front end. It should look identical before and after applying the patch.
- Create another post with a title.
- Add two heading blocks, both H1 and H2 levels.
- In the Typography settings for each block, show the Decoration options and select Strikethrough.
- While the block is still empty, check whether a line—in the text color—appears in front of the editor's gray "Heading" placeholder text. (It appears before applying the patch but not with the patch.)
Expected results with patch
- ✅ The line pseudo-element continues to display above H1 and H2 headings except for the site title:
- headings within post and widget content (
h1:not(.site-title):before, h2:before) - post titles (
.entry .entry-title:before) - "Published by" heading for the author biography (
.author-bio .author-title:before) - "Join the Conversation" heading for comments (
.comments-area .comments-title-wrap .comments-title:before)
- headings within post and widget content (
- ✅ The line also continues to align with text when using center and right alignment options.
- ✅ The extra line does not appear in the editor when the heading is still empty and the decoration option is selected.
Screenshots with results
This Firefox screenshot shows H1 and H2 headings in post, author bio, comments, and widget areas after applying the patch.
I also made screenshots of H1 and H2 in Chrome and Edge, plus a screenshot with all headings in Firefox.
Within the editor, the extra Strikethrough line no longer appears if the decoration is set before the heading has any text.
| Before patch | With patch |
|---|---|
![]() |
![]() |
Support Content
blocks used for each post: one set with all heading levels, one set with the empty headings
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. This changeset updates the CSS content property to use the empty string `content: "";` instead of `content: \020`. By removing the whitespace character, the pseudo-element no longer contains an actual text node. Developed in #12121. Props karunyachavan84, sabernhardt, karmatosed, tusharaddweb, 369work. Fixes #65433. git-svn-id: https://develop.svn.wordpress.org/trunk@65362 602fd350-edb4-49c9-b593-d223f7449a82
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. This changeset updates the CSS content property to use the empty string `content: "";` instead of `content: \020`. By removing the whitespace character, the pseudo-element no longer contains an actual text node. Developed in WordPress/wordpress-develop#12121. Props karunyachavan84, sabernhardt, karmatosed, tusharaddweb, 369work. Fixes #65433. Built from https://develop.svn.wordpress.org/trunk@65362 git-svn-id: http://core.svn.wordpress.org/trunk@64501 1a063a9b-81f0-0310-95a4-ce76da25c4cd


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
What this Changes
post-section-dashmixin insass/mixins/_mixins-master.scssto use an empty string (content: "";) instead ofcontent: "\020".display: block,width, andheightproperties, the decorative dash continues to render identically on the frontend and backend.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.