Skip to content

Commit

Permalink
Text formatting shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Dec 29, 2021
1 parent ba7fe67 commit 25b92b8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';

export const textFormattingShortcuts = [
{
keyCombination: { modifier: 'primary', character: 'b' },
description: __( 'Make the selected text bold.' ),
},
{
keyCombination: { modifier: 'primary', character: 'i' },
description: __( 'Make the selected text italic.' ),
},
{
keyCombination: { modifier: 'primary', character: 'k' },
description: __( 'Convert the selected text into a link.' ),
},
{
keyCombination: { modifier: 'primaryShift', character: 'k' },
description: __( 'Remove a link.' ),
},
{
keyCombination: { modifier: 'primary', character: 'u' },
description: __( 'Underline the selected text.' ),
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { useSelect } from '@wordpress/data';
/**
* Internal dependencies
*/
import { textFormattingShortcuts } from './config';
import Shortcut from './shortcut';
import DynamicShortcut from './dynamic-shortcut';

Expand Down Expand Up @@ -125,6 +126,10 @@ export default function KeyboardShortcutHelpModal( {
},
] }
/>
<ShortcutSection
title={ __( 'Text formatting' ) }
shortcuts={ textFormattingShortcuts }
/>
</Modal>
);
}

0 comments on commit 25b92b8

Please sign in to comment.