Skip to content

Commit

Permalink
fix(csharp) Add missing highlighting catch keyword (#3251)
Browse files Browse the repository at this point in the history
  • Loading branch information
klmr committed Jun 21, 2021
1 parent bc78477 commit ce9fb2c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
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;
}

0 comments on commit ce9fb2c

Please sign in to comment.