Skip to content

Commit

Permalink
fix(theme): only parse HTML- and JSX-style comments in MD code (#7033)
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena authored Mar 28, 2022
1 parent 57f7881 commit 755b038
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/docusaurus-theme-common/src/utils/codeBlockUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[]);
Expand Down

0 comments on commit 755b038

Please sign in to comment.