Skip to content

fix: [DEFECT] block-editor-renderer heading not applying correct level in @dotcms/angular (#34297)#34756

Merged
zJaaal merged 3 commits intomainfrom
34297-defect-dotcms-block-editor-renderer-in-dotcmsangular-is-not-properly-applying-headers-set-in-block-editor
Feb 24, 2026
Merged

fix: [DEFECT] block-editor-renderer heading not applying correct level in @dotcms/angular (#34297)#34756
zJaaal merged 3 commits intomainfrom
34297-defect-dotcms-block-editor-renderer-in-dotcmsangular-is-not-properly-applying-headers-set-in-block-editor

Conversation

@zJaaal
Copy link
Contributor

@zJaaal zJaaal commented Feb 24, 2026

Fixes #34297

Summary

  • Fixed DotHeadingBlock to accept level as a number or string — the Block Editor serializes heading levels as numbers, causing the @switch to always fall through to @default and render <h1>.
  • Added a normalizedLevel getter that coerces level to a string before the switch comparison.
  • Replaced multiple <ng-content /> usages inside @switch branches with a single <ng-template #content> + *ngTemplateOutlet to fix Angular's "duplicated ng-content" content projection error.
  • Added style input to DotHeadingBlock to accept style attributes from block editor node attrs.
  • Added unit tests covering numeric level handling and heading content rendering.

Test plan

  • Verify headings h1h6 render with the correct tag when level is a number
  • Verify heading content (text, marks) is projected correctly inside each heading level
  • Run nx test sdk-angular — all new and existing tests should pass

🤖 Generated with Claude Code

This PR fixes: #34297

@zJaaal zJaaal marked this pull request as ready for review February 24, 2026 17:01
@zJaaal zJaaal added the Area : Frontend PR changes Angular/TypeScript frontend code label Feb 24, 2026
@github-actions github-actions bot added the Area : SDK PR changes SDK libraries label Feb 24, 2026
@zJaaal zJaaal removed the Area : Frontend PR changes Angular/TypeScript frontend code label Feb 24, 2026
@zJaaal zJaaal enabled auto-merge February 24, 2026 17:17
@github-actions github-actions bot added the Area : Frontend PR changes Angular/TypeScript frontend code label Feb 24, 2026
@zJaaal zJaaal added this pull request to the merge queue Feb 24, 2026
Merged via the queue into main with commit 321fc24 Feb 24, 2026
19 checks passed
@zJaaal zJaaal deleted the 34297-defect-dotcms-block-editor-renderer-in-dotcmsangular-is-not-properly-applying-headers-set-in-block-editor branch February 24, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area : Frontend PR changes Angular/TypeScript frontend code Area : SDK PR changes SDK libraries

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[DEFECT] <dotcms-block-editor-renderer> in @dotcms/angular is not properly applying headers set in Block Editor.

4 participants