Skip to content

Add left margin to prevent line number overlap in legacy custom HTML block#70544

Open
R1shabh-Gupta wants to merge 1 commit intoWordPress:trunkfrom
R1shabh-Gupta:fix/legacy-custom-html-editor-spacing-35499
Open

Add left margin to prevent line number overlap in legacy custom HTML block#70544
R1shabh-Gupta wants to merge 1 commit intoWordPress:trunkfrom
R1shabh-Gupta:fix/legacy-custom-html-editor-spacing-35499

Conversation

@R1shabh-Gupta
Copy link
Contributor

What?

Closes #35499

This PR fixes a visual issue in the Custom HTML block within the legacy widgets screen, where the line numbers overlap the editable HTML content, and the left edge of the content is not visible.

Why?

When editing a Legacy custom HTML widget under Appearance → Widgets, the line numbers currently overlap the code, making it difficult to read and edit. This is due to insufficient left margin in the editor.

How?

This PR adjusts the margin of the pre tag to add enough space between the line numbers and the code, improving visibility and usability.

Testing Instructions

  1. Install and activate the Classic Widgets plugin.
  2. Go to Appearance → Widgets in the WordPress admin.
  3. Add a Custom HTML widget and enter multiline HTML.
  4. Deactivate the Classic Widgets plugin.
  5. Verify that:
    • Line numbers no longer overlap the HTML content.
    • Left edge of the HTML is clearly visible.

Screenshots or screencast

Before After
Before_Fix After_Fix

@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Feature] Widgets Screen The block-based screen that replaced widgets.php. [Block] Legacy Widget Affects the Legacy Widget Block - used for displaying Classic Widgets labels Jun 28, 2025
@R1shabh-Gupta R1shabh-Gupta marked this pull request as ready for review July 14, 2025 07:00
@github-actions
Copy link

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.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @francisbarton.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: francisbarton.

Co-authored-by: R1shabh-Gupta <rishabhwp@git.wordpress.org>
Co-authored-by: noisysocks <noisysocks@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Legacy Widget Affects the Legacy Widget Block - used for displaying Classic Widgets [Feature] Widgets Screen The block-based screen that replaced widgets.php. [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Block content (Custom HTML) overlaps with line numbers and left edge not visible

2 participants