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

Comments ( without new line above them result in babel error #243

Closed
DavidWells opened this issue Aug 31, 2018 · 1 comment
Closed

Comments ( without new line above them result in babel error #243

DavidWells opened this issue Aug 31, 2018 · 1 comment

Comments

@DavidWells
Copy link

Ref: #184 (comment)

It looks like this is working for most comments but I just ran into an error with comments in MD

The markdown looks like this:

# login

<!-- AUTO-GENERATED-CONTENT:START (TOC) -->
- [login](#login-1)
<!-- AUTO-GENERATED-CONTENT:END -->

It replaces the top <!-- AUTO-GENERATED-CONTENT:START (TOC) --> correctly but passes over the second comment <!-- AUTO-GENERATED-CONTENT:END --> because there is no newline

This results in a babel error:

Error: Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: Unexpected token (15:1)

  13 | <MDXTag name="li" components={components} parentName="ul">
  14 | <MDXTag name="p" components={components} parentName="li"><MDXTag name="a" components={components} parentName="p" props={{"href":"#login-1"}}>{`login`}</MDXTag></MDXTag>
> 15 | <!-- AUTO-GENERATED-CONTENT:END -->
     |  ^
  16 | </MDXTag>
  17 | </MDXTag>
  18 | {/* AUTO-GENERATED-CONTENT:START (GENERATE_COMMANDS_DOCS) */}

I was able to work around it by adding a newline after the list. This markdown works because there is a newline after the list

# login

<!-- AUTO-GENERATED-CONTENT:START (TOC) -->
- [login](#login-1)

<!-- AUTO-GENERATED-CONTENT:END -->

Is there a way to support this without the newline? Thanks!

Loving MDX btw it's freaking sweet

@DavidWells
Copy link
Author

weird duplicate 🙈#244

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

No branches or pull requests

1 participant