Skip to content

Commit 8494519

Browse files
authoredOct 5, 2021
GraphQl: Optimized regexes (#3136)
1 parent 05e7ab0 commit 8494519

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎components/prism-graphql.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ Prism.languages.graphql = {
2424
alias: 'function'
2525
},
2626
'attr-name': {
27-
pattern: /[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,
27+
pattern: /\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,
2828
greedy: true
2929
},
3030
'atom-input': {
31-
pattern: /[A-Z]\w*Input(?=!?.*$)/m,
31+
pattern: /\b[A-Z]\w*Input\b/,
3232
alias: 'class-name'
3333
},
3434
'scalar': /\b(?:Boolean|Float|ID|Int|String)\b/,

‎components/prism-graphql.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.