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

Mobile: Fixes #382: Implemented new search engine for mobile and highlight searched words in notes

This commit is contained in:
Laurent Cozic
2018-12-16 18:32:42 +01:00
parent 3231bfaff0
commit b1898141c3
9 changed files with 112 additions and 56 deletions

View File

@ -224,4 +224,8 @@ function escapeHtml(s) {
.replace(/'/g, "'");
}
module.exports = { removeDiacritics, escapeFilename, wrap, splitCommandString, padLeft, toTitleCase, escapeHtml };
function pregQuote(str, delimiter) {
return (str + '').replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\' + (delimiter || '') + '-]', 'g'), '\\$&');
}
module.exports = { removeDiacritics, escapeFilename, wrap, splitCommandString, padLeft, toTitleCase, escapeHtml, pregQuote };