storybook: Addon-docs: can't set link with absolute path.

Describe the bug When I try add link to some external page, either with markdown or anchor element, this URL automatically added to path parameter instead. On other hand, if I add URL without leading slash, it works as expected - as relative link.

To Reproduce Steps to reproduce the behavior:

  1. Create new or open existing .mdx doc.
  2. Add link to some external page, e.g. /example/:
    [absolute example](/example/)
    [relative example](example/)
    
  3. Go to this page in started or builded storybook
  4. First link points to ?path=/example/, and second points to %storybook_path%/example

Expected behavior

  1. Both links should work similarly. Either point to pages inside storybook, or to external pages
  2. There should be clear way to add links to other parts within same domain.

Screenshots code rendered result

Code snippets

[absolute example](/example/)
<a href="/example">absolute example</a>
[relative example](example/)
<a href="example">relative example</a>

System:

$ npx -p @storybook/cli@next sb info

Environment Info:

  System:
    OS: Linux 4.19 Ubuntu 18.04.3 LTS (Bionic Beaver)
    CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
  Binaries:
    Node: 10.16.3 - ~/.nodenv/versions/10/bin/node
    Yarn: 1.19.1 - /usr/bin/yarn
    npm: 6.9.0 - ~/.nodenv/versions/10/bin/npm
  npmPackages:
    @storybook/addon-a11y: ^5.3.0-beta.10 => 5.3.0-beta.10
    @storybook/addon-docs: ^5.3.0-beta.10 => 5.3.0-beta.10
    @storybook/preset-typescript: ^1.1.0 => 1.1.0
    @storybook/react: ^5.3.0-beta.10 => 5.3.0-beta.10

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 5
  • Comments: 24 (12 by maintainers)

Most upvoted comments

@stefan-schweiger Updated our storybook to 6.3.3, still same behavior.

It’s also a problem for me. I had to refactor all links, as they stopped working.

Tried with Storybook 6.5.0-alpha.50 and this issue still reproduces. It’s quite challenging because we have to write links in .mdx files using HTML syntax and character escaping for them to work properly (e.g.: <a target="_blank" href="https://www.somelink.com">https&#58;//www&#46;somelink.com</a>).

Same after bumping to 6.5.0-alpha.49

I am curious about the status of this issue. Are there plans to address this? I am running 6.4.12 and still annoyed that the only way is to right-click the link so that I can open it in another tab. Not something our users naturally think of doing.

Same problem here, then link inside our markdown file (typography)[?path=/story/foundation-typography--page] will result in http://localhost/iframe.html?path=/story/foundation-typography--page