diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 9f19ec5f4..a1c1ccf9c 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,5 +1,25 @@ # Changelog +## [v2.4.0] + +### Enhancements + +- Added search context to the note list [#2424](https://github.com/Automattic/simplenote-electron/pull/2424) +- Use the Tab key to indent nested list items from anywhere within the line [#2515](https://github.com/Automattic/simplenote-electron/pull/2515), [#2518](https://github.com/Automattic/simplenote-electron/pull/2518) + +### Fixes + +- Fixed a crash when entering a multi-word search term in Expanded display mode [#2516](https://github.com/Automattic/simplenote-electron/pull/2516) +- Show error message when trying to import invalid JSON [#2446](https://github.com/Automattic/simplenote-electron/pull/2446) +- Fixed buggy cursor when hitting enter on an empty list item [#2519](https://github.com/Automattic/simplenote-electron/pull/2519) +- Made sidebar icons the correct shade of blue [#2513](https://github.com/Automattic/simplenote-electron/pull/2513) +- Fixed a crash when clicking on a tag suggestion from search [#2529](https://github.com/Automattic/simplenote-electron/pull/2529) + +### Other Changes + +- Only linkify HTTP and simplenote protocols in note preview [#2505](https://github.com/Automattic/simplenote-electron/pull/2505) +- Tab panels: Add some TypeScript declarations (props to @ubaidisaev) [#2489](https://github.com/Automattic/simplenote-electron/pull/2489) + ## [v2.3.0] ### Fixes diff --git a/lib/utils/note-utils.ts b/lib/utils/note-utils.ts index 9f10ae8b7..75dedcc97 100644 --- a/lib/utils/note-utils.ts +++ b/lib/utils/note-utils.ts @@ -55,23 +55,27 @@ const getPreview = (content: string, searchQuery?: string) => { const terms = getTerms(searchQuery); // use only the first term of a multi-term query - const firstTerm = terms[0].toLocaleLowerCase(); - const leadingChars = 30 - firstTerm.length; - - // prettier-ignore - const regExp = new RegExp( - '(?<=\\s|^)[^\n]' + // split at a word boundary (pattern must be preceded by whitespace or beginning of string) - '{0,' + leadingChars + '}' + // up to leadingChars of text before the match - escapeRegExp(firstTerm) + - '.{0,200}(?=\\s|$)', // up to 200 characters of text after the match, splitting at a word boundary - 'ims' - ); - const matches = regExp.exec(content); - if (matches && matches.length > 0) { - preview = matches[0]; - - // don't return half of a surrogate pair - return isLowSurrogate(preview.charCodeAt(0)) ? preview.slice(1) : preview; + if (terms.length > 0) { + const firstTerm = terms[0].toLocaleLowerCase(); + const leadingChars = 30 - firstTerm.length; + + // prettier-ignore + const regExp = new RegExp( + '(?<=\\s|^)[^\n]' + // split at a word boundary (pattern must be preceded by whitespace or beginning of string) + '{0,' + leadingChars + '}' + // up to leadingChars of text before the match + escapeRegExp(firstTerm) + + '.{0,200}(?=\\s|$)', // up to 200 characters of text after the match, splitting at a word boundary + 'ims' + ); + const matches = regExp.exec(content); + if (matches && matches.length > 0) { + preview = matches[0]; + + // don't return half of a surrogate pair + return isLowSurrogate(preview.charCodeAt(0)) + ? preview.slice(1) + : preview; + } } } diff --git a/package-lock.json b/package-lock.json index be2cc5eae..7741b5ad6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "simplenote", - "version": "2.2.0-beta1", + "version": "2.4.0-beta1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f98c23a13..9a3f21d0f 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "email": "support@simplenote.com" }, "productName": "Simplenote", - "version": "2.3.0", + "version": "2.4.0-beta2", "main": "desktop/index.js", "license": "GPL-2.0", "homepage": "https://simplenote.com",