fix(a11y): inline placeholder title uses <p>, not <h4>#482
Merged
skerbis merged 1 commit intoMay 21, 2026
Merged
Conversation
The inline placeholder for blocked third-party embeds (YouTube, Vimeo, …) hard-wired a <h4> element for the service title. When the placeholder is rendered inside arbitrary page content, this almost always breaks the document outline (a <section> already running on <h2>/<h3> suddenly contains a stray <h4> with no parent heading). Lighthouse and other a11y audits flag this as a heading-order issue. Switches the tag to <p> so it no longer participates in the heading outline, but keeps the existing .consent-inline-title class plus the Bootstrap-style .h4 utility class. Themes/styles that already target the class or .h4 typography stay visually identical; no CSS change needed (consent_inline.css selectors are class-based). Themes that *do* want a real heading can still override the fragment locally via theme/private/fragments/ConsentManager/inline_placeholder.php.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The inline placeholder rendered by
InlineConsent::renderPlaceholderHTML()hard-wires a<h4>for the service title (fragments/ConsentManager/inline_placeholder.php). When the placeholder is rendered inside arbitrary page content, this almost always breaks the document outline: a<section>already running on<h2>/<h3>suddenly contains a stray<h4>with no parent heading. Lighthouse and other a11y audits flag this as a heading-order issue (we noticed it dropping our score on a fully-clean page from 100 to 98).This PR switches the tag to
<p>so the placeholder no longer participates in the heading outline, while keeping.consent-inline-titleplus the Bootstrap-style.h4utility class so themes that style by either selector stay visually identical.Change
assets/consent_inline.csstargets.consent-inline-title(class only, not tag) → no CSS update needed, visual rendering unchanged.box_bootstrap5.phpalready uses the sameclass="… h4 …"pattern on non-heading elements, so adding.h4here is consistent with the addon.theme/private/fragments/ConsentManager/inline_placeholder.php(REDAXO fragment override).Test plan
.consent-inline-titlekeep working (class-only selectors).