feat: add keyboard shortcuts for notes, the note list and the app
This commit is contained in:
parent
ed2de5e67f
commit
722390ecec
9 changed files with 532 additions and 60 deletions
|
|
@ -89,6 +89,22 @@ void main() {
|
|||
});
|
||||
});
|
||||
|
||||
group('toggleEmphasis', () {
|
||||
test('wraps, unwraps and inserts empty pairs', () {
|
||||
final bold = toggleEmphasis(_value('a word', 2, 6), '**');
|
||||
expect(bold.text, 'a **word**');
|
||||
expect(bold.selection, const TextSelection(baseOffset: 4, extentOffset: 8));
|
||||
expect(toggleEmphasis(bold, '**').text, 'a word');
|
||||
|
||||
final boldItalic = toggleEmphasis(bold, '*');
|
||||
expect(boldItalic.text, 'a ***word***');
|
||||
expect(toggleEmphasis(boldItalic, '*').text, 'a **word**');
|
||||
expect(toggleEmphasis(boldItalic, '**').text, 'a *word*');
|
||||
|
||||
expect(_marked(toggleEmphasis(_caret('x|'), '*')), 'x*|*');
|
||||
});
|
||||
});
|
||||
|
||||
group('highlightMarkdown', () {
|
||||
test('line and inline syntax', () {
|
||||
final classes = _classes(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue