Skip to content

Commit cc13539

Browse files
authored
fix(transformers): allow SQL comment syntax in notation transformer, fix #654 (#655)
1 parent fc33b7f commit cc13539

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

packages/transformers/src/transformers/notation-map.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function transformerNotationMap(
2424

2525
return createCommentNotationTransformer(
2626
name,
27-
new RegExp(`\\s*(?://|/\\*|<!--|#)\\s+\\[!code (${Object.keys(classMap).map(escapeRegExp).join('|')})(:\\d+)?\\]\\s*(?:\\*/|-->)?`),
27+
new RegExp(`\\s*(?://|/\\*|<!--|#|--)\\s+\\[!code (${Object.keys(classMap).map(escapeRegExp).join('|')})(:\\d+)?\\]\\s*(?:\\*/|-->)?`),
2828
function ([_, match, range = ':1'], _line, _comment, lines, index) {
2929
const lineNum = Number.parseInt(range.slice(1), 10)
3030
lines

packages/transformers/test/fixtures/highlight/query.sql

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/transformers/test/fixtures/highlight/query.sql.output.html

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)