valentinnodan / mdx-intellij-plugin

MIT License
8 stars 2 forks source link

Syntax highlight error for comments #7

Closed archangel-irk closed 3 years ago

archangel-irk commented 3 years ago

Hello guys, thank you for this amazing plugin! I found a problem with comments and highlights for them. See a screenshot below.

image

Source:

<!--<Meta
  title="Button"
  component={Button}
  argTypes={{
    disabled: {
      name: 'disabled',
      description: 'Disabled state of button',
      defaultValue: false,
      type: 'boolean',
      control: 'boolean',
    },
  }}
/>

<!-- https://github.com/storybookjs/storybook/issues/11542 -->
<!-- https://github.com/storybookjs/storybook/issues/11813 -->

<!-- export const Template = (args) => <Button {...args} style={{ marginRight: 'var(--fr-size-xs)' }} />; -->

<!-- How to write styles
<style>{`
  .subheading {
    --mediumdark: '#999999';
    font-weight: 900;
    font-size: 13px;
  }
`}</style>
-->

I found that this syntax <!--I'm a comment--> will be removed in favor of {/*I'm a comment*/}, but I think it's good to support both. https://github.com/mdx-js/mdx/pull/1039

anstarovoyt commented 3 years ago

fixed the MDX part (so no any errors now). Unfortunately "proper" comments-like highlighting should be implemented on the markdown plugin side.

The fix is available only for the upcoming 2020.3. If it is a big issue for you, please let me know. I will try to backport the fix to 2020.2.