Skip to content

Commit ffa9309

Browse files
authored
Merge pull request #356 from storybookjs/fix-images-page-tabs
Fix broken images in sub-pages
2 parents 09fc1eb + fc7d9cb commit ffa9309

File tree

1 file changed

+1
-3
lines changed
  • apps/frontpage/components/docs/mdx

1 file changed

+1
-3
lines changed

apps/frontpage/components/docs/mdx/img.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ interface ImgProps extends ImageProps {
1515
}
1616

1717
export function Img({ src, alt, activeVersion }: ImgProps) {
18-
const pathWithoutRoot = src
19-
?.replace('../../_assets/', '')
20-
.replace('../_assets/', '');
18+
const pathWithoutRoot = src?.replace(/^(?:\.\.\/)+_assets\//, '');
2119
const path = `/docs-assets/${activeVersion}/${pathWithoutRoot ?? ''}`;
2220
const localPath = `public${path}`;
2321

0 commit comments

Comments
 (0)