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 in code is considered as focus #367

Open
loicsay opened this issue May 16, 2023 · 2 comments
Open

Comments in code is considered as focus #367

loicsay opened this issue May 16, 2023 · 2 comments

Comments

@loicsay
Copy link

loicsay commented May 16, 2023

Hi @pomber and thanks for this awesome work!

I'm facing an issue but not sure if it's a bug or if I'm not using it the right way. The following .mdx triggers this error:
error running remarkCodeHike FocusNumberError: Invalid number "" in focus string

```js
export const sorts = [
//   {
//     label: 'My label',
//     value: 'my_value',
//   }
];

It looks like the comments in the code are considered as a focus comment syntax by Code Hike 🤔
Is it a bug or something expected? Moreover, I'm using contentlayer on top of it but I'm not sure this is related.

Thanks!

@pomber
Copy link
Contributor

pomber commented May 16, 2023

Oh, that's because Code Hike has a label annotation, and it's interpreting // label: 'My label', as an annotation.

Two things we need to improve:

  • a better error message
  • a way to escape annotations

@loicsay
Copy link
Author

loicsay commented May 16, 2023

Thanks for the clarification!

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

No branches or pull requests

2 participants