From e4f53a48d2af20f7ad31d336b711c450a64222fd Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Sat, 31 Oct 2020 13:01:40 +0000 Subject: [PATCH 1/3] Desktop: Fixed handling of Option key for shortcuts in macOS --- ReactNativeClient/lib/services/KeymapService.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ReactNativeClient/lib/services/KeymapService.ts b/ReactNativeClient/lib/services/KeymapService.ts index 4b65dacdf..6e51e6d82 100644 --- a/ReactNativeClient/lib/services/KeymapService.ts +++ b/ReactNativeClient/lib/services/KeymapService.ts @@ -352,7 +352,10 @@ export default class KeymapService extends BaseService { public domToElectronAccelerator(event: KeyboardEvent) { const parts = []; - const { key, ctrlKey, metaKey, altKey, shiftKey } = event; + + // We use the "keyCode" and not "key" because the modifier keys + // would change the "key" value. eg "Option+U" would give "ยบ" as a key instead of "U" + const { keyCode, ctrlKey, metaKey, altKey, shiftKey } = event; // First, the modifiers if (ctrlKey) parts.push('Ctrl'); @@ -368,7 +371,7 @@ export default class KeymapService extends BaseService { } // Finally, the key - const electronKey = KeymapService.domToElectronKey(key); + const electronKey = KeymapService.domToElectronKey(String.fromCharCode(keyCode)); if (electronKey) parts.push(electronKey); return parts.join('+'); From d19796f14c46e6e5e6005dfb36ee0979a4fa53bb Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Sat, 31 Oct 2020 13:02:14 +0000 Subject: [PATCH 2/3] Electron release v1.3.11 --- ElectronClient/package-lock.json | 2 +- ElectronClient/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ElectronClient/package-lock.json b/ElectronClient/package-lock.json index d5173f143..10a00103b 100644 --- a/ElectronClient/package-lock.json +++ b/ElectronClient/package-lock.json @@ -1,6 +1,6 @@ { "name": "Joplin", - "version": "1.3.10", + "version": "1.3.11", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/ElectronClient/package.json b/ElectronClient/package.json index fdb0d793d..4c225f62e 100644 --- a/ElectronClient/package.json +++ b/ElectronClient/package.json @@ -1,6 +1,6 @@ { "name": "Joplin", - "version": "1.3.10", + "version": "1.3.11", "description": "Joplin for Desktop", "main": "main.js", "scripts": { From 08c2a7ad648726ac622ef10820f326c24d7fd0bd Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Sat, 31 Oct 2020 13:05:46 +0000 Subject: [PATCH 3/3] Tools: Improved HTML escape in git-changelog --- Tools/git-changelog.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Tools/git-changelog.js b/Tools/git-changelog.js index c07f632e1..9e78a2ef9 100644 --- a/Tools/git-changelog.js +++ b/Tools/git-changelog.js @@ -10,12 +10,13 @@ const { execCommand, githubUsername } = require('./tool-utils.js'); // From https://stackoverflow.com/a/6234804/561309 function escapeHtml(unsafe) { + // We only escape <> as this is enough for Markdown return unsafe - .replace(/&/g, '&') + // .replace(/&/g, '&') .replace(//g, '>') - .replace(/"/g, '"') - .replace(/'/g, '''); + .replace(/>/g, '>'); + // .replace(/"/g, '"') + // .replace(/'/g, '''); } async function gitLog(sinceTag) {