question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

validateDOMNesting error when displaying a URL generated by compodocs

See original GitHub issue

Bug

In an Angular project Storybook is displaying this console error for a link generated by Compodocs

Warning: validateDOMNesting(...): <a> cannot appear as a descendant of <a>.
    in a (created by Markdown)
    in a (created by Markdown)
    in p (created by Markdown)
    in Markdown (created by ArgRow)
    in div (created by Context.Consumer)
    in Styled(div) (created by ArgRow)
    ...

Steps to reproduce

Add JSDocs to an @Input in an angular component

/**
     * This is a test
     * https://example.com
*/

or

/**
     * This is a test
     * {@link https://example.com|Example}
*/

Then run storybook to generate the docs and start the site

Compodocs generates this in documentation.json

<p>This is a test\n<a href=\"https://example.com\">https://example.com</a></p>

and then Storybook wraps this in another pair of <a> tags

<p>This is a test
    <a href="https://example.com">
        <a href="https://example.com">https://example.com</a>
     </a>
</p>

Please specify which version of Storybook and optionally any affected addons that you’re running

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
TheMightyPenguincommented, May 28, 2021

@shilman @dexster my PR to the library has been merged 😄 and now I opened a PR to Storybook to update the library version: https://github.com/storybookjs/storybook/pull/15083

1reaction
TheMightyPenguincommented, Mar 14, 2021

@dexster @shilman I opened a PR to markdown-to-jsx fixing this issue, if it does get merged we can update the library version here to fix this issue probablyup/markdown-to-jsx#381

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix Warning: validateDOMNesting(...): <div> cannot ...
This is why get the error. A fix would be to wrap the Spinner into a td that spans the whole row: if...
Read more >
validatedomnesting(...): <li> cannot appear as a descendant of ...
I am using react ı take a bootsrap navbar and changed the a to Link but now ı get a error message like...
Read more >
storybookjs/storybook (Raised $170.00) - Issuehunt
validateDOMNesting error when displaying a URL generated by compodocs. Unfunded#14176created bydexster. $0.00. Add option to show globalTypes name in ...
Read more >
comment js Code Example - Code Grepper
node_modules/sass-loader/lib/loader.js): Error: ENOENT: no such file or directory, scandir ... javascript generate random color site:stackoverflow.com ...
Read more >
vue 3 router 404 - Indusan
... using OSX dark theme, validateDOMNesting error when displaying a URL generated by compodocs, Add an option to nuxt generate to generate a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found