Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: AutoDocs code view tags escaped and unusable #26681

Open
dgibson666 opened this issue Mar 28, 2024 · 1 comment
Open

[Bug]: AutoDocs code view tags escaped and unusable #26681

dgibson666 opened this issue Mar 28, 2024 · 1 comment

Comments

@dgibson666
Copy link

dgibson666 commented Mar 28, 2024

Describe the bug

Since upgrading to Storybook 8 (web components + Vite), when I view the code in the AutoDocs page, the tags are escaped (they were not in Storybook 7). It also shows a ton of whitespace (which has always been an issue).

Is there a way to clean this up, e.g., using Prettier, to be consistent with the HTML Addon? It's odd that Storybook has this functionality built in but I need a third-party plugin for the addon panel and the two views differ significantly.

Here's code for a simple button story (it's also showing the decorator-specified wrapping tag, which I would rather not):

<cbp-app theme="light"> 
      <cbp-button
        
        type=button
        
        
        
        
        
        fill=solid
        color=primary
        
        
        
        
      >
        Default
      </cbp-button>
    </cbp-app>

To Reproduce

I'm building components in Stencil JS 4.13, but I don't see this behavior in your storybook.new environments (tried HTML and Lit). I can update with a link to my actual repo once committed.

System

Storybook Environment Info:

  System:
    OS: Windows 11 10.0.22631
    CPU: (24) x64 13th Gen Intel(R) Core(TM) i7-13700F
  Binaries:
    Node: 18.18.2 - C:\Program Files\nodejs\node.EXE
    npm: 9.8.1 - C:\Program Files\nodejs\npm.CMD <----- active
  Browsers:
    Edge: Chromium (122.0.2365.80)
  npmPackages:
    @storybook/addon-essentials: ^8.0.4 => 8.0.4
    @storybook/addon-links: ^8.0.4 => 8.0.4
    @storybook/blocks: ^8.0.4 => 8.0.4
    storybook: ^8.0.4 => 8.0.4

Additional context

No response

@dgibson666 dgibson666 changed the title [Bug]: AutoDocs code view escaped an unusable [Bug]: AutoDocs code view tags escaped and unusable Mar 28, 2024
@vasicvuk
Copy link

vasicvuk commented Mar 29, 2024

I have the same problem on Storybook 7.6.17 and 7.5.3 so I guess it's not related to 8.0 version, on the other hand, lit render works but it causes double calls to constructor of components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants