fix: stop using lookbehind for backwards compat (#7824)

This commit is contained in:
David Luzar 2024-03-28 17:32:38 +01:00 committed by GitHub
parent 550a388b2b
commit 1d71f84515
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions

View File

@ -91,13 +91,14 @@ const CommandShortcutHint = ({
className?: string;
children?: React.ReactNode;
}) => {
const shortcuts = shortcut.split(/(?<!\+)(?:\+)/g);
const shortcuts = shortcut.replace("++", "+$").split("+");
return (
<div className={clsx("shortcut", className)}>
{shortcuts.map((item) => {
{shortcuts.map((item, idx) => {
return (
<div className="shortcut-wrapper" key={item}>
<div className="shortcut-key">{item}</div>
<div className="shortcut-key">{item === "$" ? "+" : item}</div>
</div>
);
})}