Skip to content

[Bug]: Angular [Show code] should render self-closing tags #32975

@NateRadebaugh

Description

@NateRadebaugh

Describe the bug

Self-closing tags are supported in Angular templates since v16. .

Before

<hello-world></hello-world>

After

<hello-world />

Reproduction link

https://stackblitz.com/github/storybookjs/sandboxes/tree/next/angular-cli/default-ts/after-storybook?file=src%2Fstories%2Fbutton.stories.ts&preset=node

Image

Reproduction steps

  1. Open any Angular Docs page with [Show code]
  2. Click [Show code]

Expected: examples should be rendered as self-closing
Actual: examples show with a separate closing tag

System

Storybook Environment Info:

  System:
    OS: Windows 11 10.0.22631
    CPU: (20) x64 13th Gen Intel(R) Core(TM) i7-13800H
  Binaries:
    Node: 22.14.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD <----- active
  Browsers:
    Edge: Chromium (134.0.3124.68)
  npmPackages:
    @storybook/addon-docs: ^10.0.5 => 10.0.5 
    @storybook/angular: ^10.0.5 => 10.0.5    
    storybook: ^10.0.5 => 10.0.5

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions