From 521717af922c00306e74d80ebcaa1405da72e1ac Mon Sep 17 00:00:00 2001 From: Konrad Rudolph Date: Sun, 20 Jun 2021 14:47:13 +0100 Subject: [PATCH 1/3] Add expected syntax highlighting --- test/markup/csharp/try-catch.expect.txt | 8 ++++++++ test/markup/csharp/try-catch.txt | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 test/markup/csharp/try-catch.expect.txt create mode 100644 test/markup/csharp/try-catch.txt diff --git a/test/markup/csharp/try-catch.expect.txt b/test/markup/csharp/try-catch.expect.txt new file mode 100644 index 0000000000..2925c46c70 --- /dev/null +++ b/test/markup/csharp/try-catch.expect.txt @@ -0,0 +1,8 @@ +try +{ + throw new InvalidCastException(); +} +catch (InvalidCastException e) when (e.Data != null) +{ + throw; +} \ No newline at end of file diff --git a/test/markup/csharp/try-catch.txt b/test/markup/csharp/try-catch.txt new file mode 100644 index 0000000000..c9f0430dc0 --- /dev/null +++ b/test/markup/csharp/try-catch.txt @@ -0,0 +1,8 @@ +try +{ + throw new InvalidCastException(); +} +catch (InvalidCastException e) when (e.Data != null) +{ + throw; +} From c7410d1403f76de5a267246d15d4c487d06b2f11 Mon Sep 17 00:00:00 2001 From: Konrad Rudolph Date: Sun, 20 Jun 2021 14:47:21 +0100 Subject: [PATCH 2/3] Add missing `catch` keyword --- src/languages/csharp.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/languages/csharp.js b/src/languages/csharp.js index 6696d4f060..b89704d4bc 100644 --- a/src/languages/csharp.js +++ b/src/languages/csharp.js @@ -59,6 +59,7 @@ export default function(hljs) { 'base', 'break', 'case', + 'catch', 'class', 'const', 'continue', From 04f64108b347d3349662bd12e2e0d0e4f7d98263 Mon Sep 17 00:00:00 2001 From: Konrad Rudolph Date: Sun, 20 Jun 2021 14:48:46 +0100 Subject: [PATCH 3/3] Document change --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 2858a2b664..a5eb85b1b1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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][]