Skip to content

Block Editor SDK renderer produces excessive DOM wrapper layers (accessibility) #35852

@fmontes

Description

@fmontes

Problem

The dotCMS Angular SDK Block Editor renderer (DotCMSBlockEditorRendererComponent) wraps every content block in a custom element around the real semantic tag. The recursive dispatcher element also renders between a <ul> and its <li> children, breaking the required list → listitem parent/child relationship.

An accessibility scanner on a customer page flagged this as excessive nested wrapper elements, violating semantic HTML and creating accessibility barriers — most visibly in list rendering, where expected <ul>/<li> structures are buried under multiple custom element layers.

Current output for a bullet list:

<dotcms-block-editor-renderer-bullet-list>
  <ul>
    <dotcms-block-editor-renderer-block>
      <dotcms-block-editor-renderer-list-item>
        <li>
          <dotcms-block-editor-renderer-block>
            <dotcms-block-editor-renderer-paragraph><p>text</p>

Expected (clean semantic HTML, as the React SDK already produces):

<ul><li><p>text</p></li></ul>

Because this is a published SDK (@dotcms/angular), the rendered DOM is effectively a public contract — changing the existing component's output would break customers who style or query those wrappers. A new, opt-in component is needed rather than modifying the existing one.

Goal

Provide an accessible Block Editor renderer that emits clean, standards-compliant semantic HTML (no custom-element wrapper layers between semantic tags), so customer pages pass accessibility scanners and work correctly with assistive technology — without breaking existing SDK integrations.

Demo Expectations

In the demo, we will render Block Editor content (lists, headings, paragraphs, blockquote, code) using the new renderer and inspect the DOM to show clean semantic HTML (<ul><li><p>…) with no dotcms-block-editor-renderer-* wrappers between semantic tags, and show an accessibility scan with the wrapper/list-nesting findings resolved.

Acceptance Criteria

  • A new opt-in Block Editor renderer component emits semantic HTML with no custom-element wrappers around/between semantic tags (<ul> directly contains <li>)
  • The new component keeps the same public input API (blocks, customRenderers, class, style)
  • The existing renderer is marked @deprecated and its output is left unchanged (backward compatible)
  • Accessibility scanner no longer reports excessive DOM wrapper layers for content rendered with the new component
  • README / MIGRATION / CHANGELOG document the new component and deprecation

Links

  • Affected component: core-web/libs/sdk/angular/src/lib/components/dotcms-block-editor-renderer/

Metadata

Metadata

Assignees

No fields configured for Feature.

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions