Skip to content

Commit 7f000bf

Browse files
committed
Use unknown key on error
1 parent 1909a66 commit 7f000bf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Elastic.Markdown/Myst/Roles/Kbd/Kbd.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class KeyboardShortcut(IReadOnlyList<IKeyNode> keys)
1414
{
1515
private IReadOnlyList<IKeyNode> Keys { get; } = keys;
1616

17-
public static KeyboardShortcut Empty { get; } = new([]);
17+
public static KeyboardShortcut Unknown { get; } = new([new CharacterKeyNode { Key = '?' }]);
1818

1919
public static KeyboardShortcut Parse(string input)
2020
{

src/Elastic.Markdown/Myst/Roles/Kbd/KbdRole.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public KbdRole(string role, string content, InlineProcessor parserContext) : bas
2020
catch (Exception ex)
2121
{
2222
parserContext.EmitError(this, Role.Length + content.Length, $"Failed to parse keyboard shortcut: \"{content}\"", ex);
23-
KeyboardShortcut = KeyboardShortcut.Empty;
23+
KeyboardShortcut = KeyboardShortcut.Unknown;
2424
}
2525
}
2626
public KeyboardShortcut KeyboardShortcut { get; }

0 commit comments

Comments
 (0)