fix(theme): only parse HTML- and JSX-style comments in MD code (#7033)

This commit is contained in:
Joshua Chen 2022-03-28 09:57:04 +08:00 committed by GitHub
parent 57f7881a3d
commit 755b03861c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -61,6 +61,10 @@ function getAllMagicCommentDirectiveStyles(lang: string) {
case 'py':
return getCommentPattern(['python']);
case 'markdown':
case 'md':
return getCommentPattern(['html', 'jsx']);
default:
// all comment types
return getCommentPattern(Object.keys(commentPatterns) as CommentType[]);