fix(theme-common): code block magic comments should support SQL block comments (#10782)

This commit is contained in:
William Black 2024-12-20 09:16:59 -07:00 committed by GitHub
parent 87a5ab9177
commit 2565601af3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 1 deletions

View file

@ -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);

View file

@ -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)