1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-23 22:36:32 +02:00

Desktop: Fixes #11409: Goto Anything fails for long strings (#11436)

This commit is contained in:
Laurent Cozic
2024-11-23 16:47:46 +00:00
committed by GitHub
parent 48fd5d30f7
commit e652db05e1
6 changed files with 36 additions and 19 deletions

View File

@@ -100,6 +100,10 @@ export function removeDiacritics(str: string) {
return str;
}
export function escapeRegExp(keyword: string) {
return keyword.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
}
export function wrap(text: string, indent: string, width: number) {
const wrap_ = require('word-wrap');