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", diff --git a/src/index.ts b/src/index.ts index f8a3668..1a22aab 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') } } @@ -251,7 +252,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..ff619bc 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()) }) @@ -566,9 +568,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()) })