Skip to content

Commit

Permalink
Add variable syntax & update for recent highlighting (#93)
Browse files Browse the repository at this point in the history
What it says on the tin!
  • Loading branch information
goodroot authored Dec 2, 2024
1 parent 4240247 commit d726f1a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@headlessui/react": "^2.2.0",
"@heroicons/react": "2.2.0",
"@mdx-js/react": "3.1.0",
"@questdb/sql-grammar": "1.1.0",
"@questdb/sql-grammar": "1.2.0",
"@radix-ui/react-dialog": "1.1.2",
"@radix-ui/react-hover-card": "1.1.2",
"@radix-ui/react-slider": "1.2.1",
Expand Down
7 changes: 7 additions & 0 deletions src/internals/prism-dracula.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ const theme = {
color: "rgb(241, 250, 140)",
},
},
{
types: ["variable"],
style: {
color: color.draculaPurple,
fontStyle: "italic",
},
},
],
}

Expand Down
4 changes: 2 additions & 2 deletions src/theme/prism-include-languages.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ const prismIncludeLanguages = (PrismObject) => {
dataType: new RegExp(`\\b(?:${dataTypes.join("|")})\\b`, "i"),
variable: [
{
pattern: /@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,
pattern: /@[\w.$]+/,
greedy: true,
},
/@[\w.$]+/,
/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,
],
string: {
pattern: /(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2477,10 +2477,10 @@
resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.28.tgz#d45e01c4a56f143ee69c54dd6b12eade9e270a73"
integrity sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==

"@questdb/sql-grammar@1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@questdb/sql-grammar/-/sql-grammar-1.1.0.tgz#75b46a86c21fe792cce8bd28950f5871085d3bdb"
integrity sha512-O4tD5PAMC/aV0qzNJ2QbDo6gWO71DqzEnp+EgxYei5PM01x3lAUm7+JhyMlQixoIHvo1i641F8GIjO0ErRTXfw==
"@questdb/sql-grammar@1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@questdb/sql-grammar/-/sql-grammar-1.2.0.tgz#d53324266bf08d76e12d0c4522af89330f8a716e"
integrity sha512-N6/xfe36Lex0os2/MknH+N/sjwc05AsQIZWZ+8Btj6EFvaEgJMZVptpA2dLNG/vu+i3yJ3Q7D+DsFNdfAM2o3A==

"@radix-ui/[email protected]":
version "1.1.0"
Expand Down

0 comments on commit d726f1a

Please sign in to comment.