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

MDX2: HTML comments break transcluded Markdown #18554

Closed
shilman opened this issue Jun 23, 2022 · 2 comments
Closed

MDX2: HTML comments break transcluded Markdown #18554

shilman opened this issue Jun 23, 2022 · 2 comments

Comments

@shilman
Copy link
Member

shilman commented Jun 23, 2022

Originally posted by @pixelass in #18383 (comment)

Looks like I found the issue while trying to build the repro.

It is an HTML comment within the markdown

README.md

# This file will not work

<!-- Because of this comment -->

Test.stories.mdx

import { Meta } from "@storybook/addon-docs";
import Readme from "../README.md";

<Meta title="Just / A /Test" />

<Readme />

which is then reactified via:

.stroybook/main.js (partial)

    {
      name: "@storybook/addon-docs",
      options: {
        configureJSX: true,
        sourceLoaderOptions: null,
        transcludeMarkdown: true,
      },
    },

Here's the very minimal repro: https://github.com/pixelass/sb-repro-mdx

There is only one story and a readme.md that should be rendered.

We used npm since this is how our project is set up but I expect the same issue to occur with yarn.


EDIT: I want to mention that removing the comments from all markdown files is not an option (it is also valid md and therefore should not cause issues)

@shilman shilman added this to the 6.5 stabilization milestone Jun 23, 2022
@shilman shilman added the linear label Jun 23, 2022
@zhyd1997
Copy link
Contributor

it's mdx issue:

Screen Shot 2022-07-13 at 18 14 46

@shilman
Copy link
Member Author

shilman commented Dec 12, 2022

Closing as dupe to #20200

@shilman shilman closed this as completed Dec 12, 2022
@shilman shilman moved this to Done in MDX2 Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants