Make WordPress Core

Opened 11 months ago

Last modified 10 days ago

#61800 new defect (bug)

Twenty Twelve: preformatted elements have hyphens on front-end

Reported by: viralsampat's profile viralsampat Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch
Focuses: css Cc:

Description

Hello Team,

I have reviewed the "Preformatted block" and found that the "hyphens" character is adding in text on front-end when we changed its "Letter spacing" from "Typography" setting.

So, I think that the editor side text & front-side text should be same.

Here, I have attached its screenshots and video for references.

Thanks,

Attachments (16)

twenty-twelve-preformatted-block-editor.png (274.6 KB) - added by viralsampat 11 months ago.
Back-end:
twenty-twelve-preformatted-block-front-end.png (246.0 KB) - added by viralsampat 11 months ago.
Front-end:
twenty-twelve-preformatted-block-issue.mp4 (1.5 MB) - added by viralsampat 11 months ago.
Issue video:
61800.patch (424 bytes) - added by viralsampat 11 months ago.
I have checked above mentioned issue and I have resolved it and added patch. Also, I have attached screenshot after resolved this issue.
after-resolved-twenty-twelve-preformatted-block-editor.png (284.7 KB) - added by viralsampat 11 months ago.
After resolved issue Back-end:
after-resolved-twenty-twelve-preformatted-block-front-end.png (241.0 KB) - added by viralsampat 11 months ago.
After resolved issue front-end:
2012-preformatted-text-hyphens.png (57.2 KB) - added by sabernhardt 11 months ago.
(before patch) hyphens in post content and widget area, with the default font size and letter spacing
61800.2.patch (471 bytes) - added by viralsampat 11 months ago.
I have updated my patch.
61800.3.patch (471 bytes) - added by viralsampat 10 months ago.
As per coding standard, I have updated my patch.
editor.png (136.4 KB) - added by shraddhagore 4 months ago.
site.png (143.8 KB) - added by shraddhagore 4 months ago.
61800.4.patch (535 bytes) - added by viralsampat 4 months ago.
Latest Patch
twentytwelve_pref_block_editor.png (309.2 KB) - added by viralsampat 4 months ago.
twentytwelve_pref_block.png (252.1 KB) - added by viralsampat 4 months ago.
after-editor-61800.4.png (156.2 KB) - added by shraddhagore 4 months ago.
after-site-61800.4.png (143.1 KB) - added by shraddhagore 4 months ago.

Change History (25)

@viralsampat
11 months ago

I have checked above mentioned issue and I have resolved it and added patch. Also, I have attached screenshot after resolved this issue.

@sabernhardt
11 months ago

(before patch) hyphens in post content and widget area, with the default font size and letter spacing

#1 @sabernhardt
11 months ago

  • Component changed from General to Bundled Theme
  • Keywords has-patch added; needs-patch needs-testing removed
  • Summary changed from The Preformatted block text add hyphens on front-end side on twenty twelve theme. to Twenty Twelve: preformatted elements have hyphens on front-end

Preformatted text can have automatic hyphens with the theme without adjusting the font size or letter spacing.

When using a modern browser, the patch removes the hyphens for any pre element within the post content area.

Additional changes to consider:

  1. Twenty Twelve adds -webkit- and -moz- vendor prefixes for hyphens. The need for these may be rare, but including them would be consistent with the theme's styles for .site-content article and .widget-area .widget.
  2. Preformatted blocks in a widget area can still hyphenate. The override could be added for any pre element (possibly placed at line 506, after the a:hover ruleset).
pre {
	-webkit-hyphens: none;
	-moz-hyphens: none;
	hyphens: none;
}
Last edited 11 months ago by sabernhardt (previous) (diff)

@viralsampat
11 months ago

I have updated my patch.

#2 @sabernhardt
10 months ago

  • Keywords changes-requested added

According to coding standards, the prefixed properties belong before the unprefixed property.

	-webkit-hyphens: none;
	-moz-hyphens: none;
	hyphens: none;

@viralsampat
10 months ago

As per coding standard, I have updated my patch.

#3 @sabernhardt
9 months ago

  • Keywords dev-feedback changes-requested removed
  • Version 6.6.1 deleted

#4 @karmatosed
6 months ago

I am going to test this and see about progressing this into a commit as the hyphens are now in as per @sabernhardt's suggestion. Thank you everyone.

#5 @karmatosed
6 months ago

  • Keywords needs-testing added

I just tested this and I am unable to replicate the original issue. I am curious if others are today?

@shraddhagore
4 months ago

@shraddhagore
4 months ago

#6 @shraddhagore
4 months ago

Patch Report


Patch Tested: https://core.trac.wordpress.org/attachment/ticket/61800/61800.3.patch

Environment:
WordPress: 6.8-alpha-59274-src
Theme: Twenty Twelve, 4.4
Browser: Google Chrome
OS: Windows 11

Screenshots:
Editor: https://core.trac.wordpress.org/attachment/ticket/61800/editor.png
Site: https://core.trac.wordpress.org/attachment/ticket/61800/site.png

Comments:
The patch isn't working as expected. I tested it with the default settings and also adjusted the Typography settings for the preformatted block, but the hyphens are still appearing in the site content.

@viralsampat
4 months ago

Latest Patch

#7 @viralsampat
4 months ago

Hello @shraddhagore

Thank you so much for your feedback. I have added latest patch for above mentioned issue. Can you please test it again from your end and share your feedback.

Patch: I have checked above-mentioned feedback and I have updated the patch.
https://core.trac.wordpress.org/attachment/ticket/61800/61800.4.patch

Environment:

WordPress: 6.7.2 running
Theme: Twenty Twelve, 4.4
Browser: Google Chrome, Version 133.0.6943.98 (Official Build) (arm64)
Device: MacBook Air M1
OS: macOS 15.3.1 (24D70)
Gutenberg plugin: Version Version 20.2.0

Screenshots:
Editor: https://core.trac.wordpress.org/attachment/ticket/61800/twentytwelve_pref_block_editor.png
Site: https://core.trac.wordpress.org/attachment/ticket/61800/twentytwelve_pref_block.png

Thanks,

#8 @shraddhagore
4 months ago

Patch Report


Patch Tested: https://core.trac.wordpress.org/attachment/ticket/61800/61800.4.patch

Environment:
WordPress: 6.8-alpha-59274-src
Theme: Twenty Twelve, 4.4
Browser: Google Chrome
OS: Windows 11

Screenshots:
Editor: https://core.trac.wordpress.org/attachment/ticket/61800/after-editor-61800.4.png
Site: https://core.trac.wordpress.org/attachment/ticket/61800/after-site-61800.4.png

Comments:
The Patch 61800.4 is working as expected. ✅
Thank you, @viralsampat!

#9 @avinashbhosale
10 days ago

  • Keywords needs-testing removed

Test Report

Description

This report validates that the indicated patch works as expected.

Patch tested: https://core.trac.wordpress.org/attachment/ticket/61800/61800.4.patch

Environment

  • WordPress: 6.8.1
  • PHP: 8.2.27
  • Server: nginx/1.26.1
  • Database: mysqli (Server: 8.0.35 / Client: mysqlnd 8.2.27)
  • Browser: Chrome 137.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Twelve 4.5
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ✅ Issue resolved with patch.

Supplemental Artifacts

Note: See TracTickets for help on using tickets.