diff --git a/packages/docusaurus-theme-common/src/utils/codeBlockUtils.ts b/packages/docusaurus-theme-common/src/utils/codeBlockUtils.ts index 3d545655f673..f93ef96be7c9 100644 --- a/packages/docusaurus-theme-common/src/utils/codeBlockUtils.ts +++ b/packages/docusaurus-theme-common/src/utils/codeBlockUtils.ts @@ -107,9 +107,11 @@ function getAllMagicCommentDirectiveStyles( case 'lua': case 'haskell': - case 'sql': return getCommentPattern(['lua'], magicCommentDirectives); + case 'sql': + return getCommentPattern(['lua', 'jsBlock'], magicCommentDirectives); + case 'wasm': return getCommentPattern(['wasm'], magicCommentDirectives); diff --git a/website/_dogfooding/_pages tests/code-block-tests.mdx b/website/_dogfooding/_pages tests/code-block-tests.mdx index 6c294b11c38a..83454500f7b2 100644 --- a/website/_dogfooding/_pages tests/code-block-tests.mdx +++ b/website/_dogfooding/_pages tests/code-block-tests.mdx @@ -358,6 +358,19 @@ WHERE customer_id IN ( ) ``` +```sql title="sql_query_block.sql" +/* highlight-start */ +SELECT * +FROM orders +/* highlight-end */ +WHERE customer_id IN ( + SELECT customer_id + /* highlight-next-line */ + FROM customers + WHERE country = 'USA' +) +``` + ```matlab title="matlab.m" % highlight-start function result = times2(n)