Skip to content

Commit

Permalink
Fix regex
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeguerin committed Dec 4, 2023
1 parent 360add2 commit eb9d838
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/website/src/theme/typespec-lang-prism.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ const lang = {
/(^|[^"#])/.source +
"(?:" +
// multi-line string
/"""(?:\\(?:\$\{(?:[^{}]|\$\{[^{}]*\})*\}|[^(])|[^\\"]|"(?!""))*"""/.source +
/"""(?:\$(?:\{(?:[^{}]|\{[^{}]*\})*\}|[^{])|[^\\"]|"(?!""))*"""/.source +
"|" +
// single-line string
/"(?:\\(?:\$\{(?:[^{}]|\$\{[^{}]*\})*\}|\r\n|[^(])|[^\\\r\n"])*"/.source +
/"(?:\$(?:\{(?:[^{}]|\{[^{}]*\})*\}|\r\n|[^{])|[^\\\r\n"])*"/.source +
")"
),
lookbehind: true,
greedy: true,
inside: {
interpolation: {
pattern: /(\$\{)(?:[^{}]|\$\{[^{}]*\})*(?=\})/,
pattern: /(\$\{)(?:[^{}]|\{[^{}]*\})*(?=\})/,
lookbehind: true,
inside: null, // see below
},
Expand Down

0 comments on commit eb9d838

Please sign in to comment.