From a5624f14d54ac6a364e696e45b94d2ee9257a5e4 Mon Sep 17 00:00:00 2001 From: Sam Partington Date: Mon, 13 Sep 2021 14:10:11 +0100 Subject: [PATCH 1/3] Require pressing shift for the quote hotkey This is to avoid conflicting with github's existing saved-reply shortcut --- src/index.ts | 1 + test/test.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index f8a3668..fd2cbcc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -173,6 +173,7 @@ class MarkdownQuoteButtonElement extends MarkdownButtonElement { connectedCallback() { super.connectedCallback() this.setAttribute('hotkey', '.') + this.setAttribute('hotkey-requires-shift', 'true') } } diff --git a/test/test.js b/test/test.js index f580a4a..c991867 100644 --- a/test/test.js +++ b/test/test.js @@ -468,10 +468,12 @@ describe('markdown-toolbar-element', function () { assert.equal('> |', visualValue()) }) - it('inserts selected quoted sample via hotkey', function () { + it('inserts selected quoted sample via hotkey, requiring shift', function () { focus() setVisualValue('') - pressHotkey('.') + pressHotkey('.', false) + assert.equal('|', visualValue()) + pressHotkey('.', true) assert.equal('> |', visualValue()) }) From b9e64fbb6d3b79ab9e3ad8a37af2b631597bf613 Mon Sep 17 00:00:00 2001 From: Sam Partington Date: Mon, 13 Sep 2021 14:31:11 +0100 Subject: [PATCH 2/3] Changed ordered list hotkey from 9 to 7 --- src/index.ts | 2 +- test/test.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index f8a3668..59a4cda 100644 --- a/src/index.ts +++ b/src/index.ts @@ -251,7 +251,7 @@ class MarkdownOrderedListButtonElement extends MarkdownButtonElement { } connectedCallback() { super.connectedCallback() - this.setAttribute('hotkey', '9') + this.setAttribute('hotkey', '7') this.setAttribute('hotkey-requires-shift', 'true') } } diff --git a/test/test.js b/test/test.js index f580a4a..2124f2e 100644 --- a/test/test.js +++ b/test/test.js @@ -566,9 +566,9 @@ describe('markdown-toolbar-element', function () { it('turns multiple lines into ordered list via hotkey, requiring shift', function () { setVisualValue('One\n|Two\nThree|\n') - pressHotkey('9', false) + pressHotkey('7', false) assert.equal('One\n|Two\nThree|\n', visualValue()) - pressHotkey('9', true) + pressHotkey('7', true) assert.equal('One\n\n|1. Two\n2. Three|\n', visualValue()) }) From 19f5f68d8fd7b70bf2d137d05ce38e7d84d51009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristj=C3=A1n=20Oddsson?= Date: Mon, 13 Sep 2021 17:50:28 +0100 Subject: [PATCH 3/3] 1.5.3 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index e4f602e..26066df 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@github/markdown-toolbar-element", - "version": "1.5.2", + "version": "1.5.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@github/markdown-toolbar-element", - "version": "1.5.0", + "version": "1.5.3", "license": "MIT", "devDependencies": { "@github/prettier-config": "0.0.4", diff --git a/package.json b/package.json index 3e16558..9c25731 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@github/markdown-toolbar-element", - "version": "1.5.2", + "version": "1.5.3", "description": "Markdown formatting buttons for text inputs.", "repository": "github/markdown-toolbar-element", "type": "module",