Skip to content

Commit

Permalink
fix: allow comments to contain --
Browse files Browse the repository at this point in the history
  • Loading branch information
jablko committed Sep 14, 2021
1 parent 2a5792f commit 6c2d9dd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/eslint-mdx/src/regexp.ts
Expand Up @@ -23,7 +23,7 @@ export const openTag = '<[A-Za-z]*[A-Za-z0-9\\.\\-]*' + attribute + '*\\s*>'
export const closeTag = '<\\s*\\/[A-Za-z]*[A-Za-z0-9\\.\\-]*\\s*>'
export const selfClosingTag =
'<[A-Za-z]*[A-Za-z0-9\\.\\-]*' + attribute + '*\\s*\\/?>'
export const comment = '<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->'
export const comment = '<!--(?:[^-]|-(?:[^-]|-+[^->]))*-*-->'
export const commentOpen = '(<!---*)'
export const commentClose = '(-*-->)'
export const commentContent = `${commentOpen}([\\s\\S]*?)${commentClose}`
Expand Down
2 changes: 2 additions & 0 deletions test/__snapshots__/fixtures.test.ts.snap
Expand Up @@ -169,6 +169,8 @@ Array [
]
`;

exports[`fixtures should match all snapshots: comments.mdx 1`] = `Array []`;

exports[`fixtures should match all snapshots: details.mdx 1`] = `
Array [
Object {
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/comments.mdx
@@ -0,0 +1 @@
<!-- eslint-disable-next-line no-console -- Here's a description about why this configuration is necessary. -->

0 comments on commit 6c2d9dd

Please sign in to comment.