Skip to content

Commit

Permalink
Visual Basic: Added support for interpolation strings (#1971)
Browse files Browse the repository at this point in the history
This makes string like `$"Foo bar"` highlight with `$`.
  • Loading branch information
dovisutu authored and RunDevelopment committed Jul 11, 2019
1 parent 858201c commit 4a2c90c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/prism-visual-basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Prism.languages['visual-basic'] = {
greedy: true
},
'string': {
pattern: /["“”](?:["“”]{2}|[^"“”])*["“”]C?/i,
pattern: /\$?["“”](?:["“”]{2}|[^"“”])*["“”]C?/i,
greedy: true
},
'date': {
Expand Down
2 changes: 1 addition & 1 deletion components/prism-visual-basic.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion tests/languages/visual-basic/string_feature.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ bar”
"Foo”“ba
r"
"a"c
$"Foobar"

----------------------------------------------------

Expand All @@ -27,7 +28,8 @@ r"
["string", "”“"],
["string", "“\""],
["string", "\"Foo”“ba\r\nr\""],
["string", "\"a\"c"]
["string", "\"a\"c"],
["string", "$\"Foobar\""]
]

----------------------------------------------------
Expand Down

0 comments on commit 4a2c90c

Please sign in to comment.