From 3e8af30e80c442b9eaa54f98f0c320bd9d65f780 Mon Sep 17 00:00:00 2001 From: Sukhendu Sekhar Guria Date: Mon, 28 Apr 2025 13:38:54 +0530 Subject: [PATCH 1/2] Fix: Improve warning message and add bottom margin in HTMLElementControl --- .../block-editor/src/components/block-inspector/style.scss | 6 ++++-- .../src/components/html-element-control/index.js | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/block-editor/src/components/block-inspector/style.scss b/packages/block-editor/src/components/block-inspector/style.scss index dd9d8f254ff76b..4913b4c5f8f27d 100644 --- a/packages/block-editor/src/components/block-inspector/style.scss +++ b/packages/block-editor/src/components/block-inspector/style.scss @@ -11,7 +11,8 @@ } .components-base-control, - .components-radio-control { + .components-radio-control, + .block-editor-html-element-control { &:where(:not(:last-child)) { margin-bottom: $grid-unit-20; } @@ -20,7 +21,8 @@ // Reset unwanted margin-bottom from being applied to BaseControls within certain components. .components-focal-point-picker-control, .components-query-controls, - .components-range-control { + .components-range-control, + .block-editor-html-element-control { .components-base-control { margin-bottom: 0; } diff --git a/packages/block-editor/src/components/html-element-control/index.js b/packages/block-editor/src/components/html-element-control/index.js index 3024301f19eaee..ea99b31000ad74 100644 --- a/packages/block-editor/src/components/html-element-control/index.js +++ b/packages/block-editor/src/components/html-element-control/index.js @@ -86,7 +86,7 @@ export default function HTMLElementControl( { } ); return ( - + { __( - 'Multiple
elements detected. This is not valid HTML and may cause accessibility issues. Please change this HTML element.' + 'Multiple
elements detected. The duplicate may be in your content or in the page template. This is not valid HTML and may cause accessibility issues. Please change this HTML element.' ) } ) } From d22292c9fe5314e8b3ac51ee0dbbe7fd2441db48 Mon Sep 17 00:00:00 2001 From: Sukhendu Sekhar Guria Date: Wed, 30 Apr 2025 14:18:06 +0530 Subject: [PATCH 2/2] Simplify warning message --- .../block-editor/src/components/html-element-control/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/html-element-control/index.js b/packages/block-editor/src/components/html-element-control/index.js index ea99b31000ad74..301b5e04946161 100644 --- a/packages/block-editor/src/components/html-element-control/index.js +++ b/packages/block-editor/src/components/html-element-control/index.js @@ -100,7 +100,7 @@ export default function HTMLElementControl( { { tagName === 'main' && hasMainElementElsewhere && ( { __( - 'Multiple
elements detected. The duplicate may be in your content or in the page template. This is not valid HTML and may cause accessibility issues. Please change this HTML element.' + 'Multiple
elements detected. The duplicate may be in your content or template. This is not valid HTML and may cause accessibility issues. Please change this HTML element.' ) } ) }