Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(csharp) Add missing highlighting catch keyword #3251

Merged
merged 3 commits into from Jun 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -2,6 +2,7 @@

Grammars:

- fix(csharp) add missing `catch` keyword (#3251) [Konrad Rudolph][]
- add additional keywords to csp.js (#3244) [Elijah Conners][]
- fix(markdown) Images with empty alt or links with empty text (#3233) [Josh Goebel][]
- enh(powershell) added `pwsh` alias (#3236) [tebeco][]
Expand Down
1 change: 1 addition & 0 deletions src/languages/csharp.js
Expand Up @@ -59,6 +59,7 @@ export default function(hljs) {
'base',
'break',
'case',
'catch',
'class',
'const',
'continue',
Expand Down
8 changes: 8 additions & 0 deletions test/markup/csharp/try-catch.expect.txt
@@ -0,0 +1,8 @@
<span class="hljs-keyword">try</span>
{
<span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> InvalidCastException();
}
<span class="hljs-keyword">catch</span> (InvalidCastException e) <span class="hljs-keyword">when</span> (e.Data != <span class="hljs-literal">null</span>)
{
<span class="hljs-keyword">throw</span>;
}
8 changes: 8 additions & 0 deletions test/markup/csharp/try-catch.txt
@@ -0,0 +1,8 @@
try
{
throw new InvalidCastException();
}
catch (InvalidCastException e) when (e.Data != null)
{
throw;
}