Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump version to 2.4.0-beta2 #2524

Merged
merged 4 commits into from
Dec 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
38 changes: 21 additions & 17 deletions lib/utils/note-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down