Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ckeditor/ckeditor5-find-and-replace

Package Overview
Dependencies
Maintainers
1
Versions
675
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ckeditor/ckeditor5-find-and-replace - npm Package Compare versions

Comparing version 28.0.1 to 29.0.0

28

package.json
{
"name": "@ckeditor/ckeditor5-find-and-replace",
"version": "28.0.1",
"version": "29.0.0",
"description": "Find and replace feature for CKEditor 5.",

@@ -14,5 +14,5 @@ "keywords": [

"dependencies": {
"@ckeditor/ckeditor5-ui": "^28.0.0",
"@ckeditor/ckeditor5-utils": "^28.0.0",
"ckeditor5": "^28.0.0",
"@ckeditor/ckeditor5-ui": "^29.0.0",
"@ckeditor/ckeditor5-utils": "^29.0.0",
"ckeditor5": "^29.0.0",
"lodash-es": "^4.17.15"

@@ -22,12 +22,12 @@ },

"@ckeditor/ckeditor5-dev-utils": "^25.0.0",
"@ckeditor/ckeditor5-basic-styles": "^28.0.0",
"@ckeditor/ckeditor5-core": "^28.0.0",
"@ckeditor/ckeditor5-editor-classic": "^28.0.0",
"@ckeditor/ckeditor5-editor-decoupled": "^28.0.0",
"@ckeditor/ckeditor5-engine": "^28.0.0",
"@ckeditor/ckeditor5-essentials": "^28.0.0",
"@ckeditor/ckeditor5-font": "^28.0.0",
"@ckeditor/ckeditor5-highlight": "^28.0.0",
"@ckeditor/ckeditor5-paragraph": "^28.0.0",
"@ckeditor/ckeditor5-theme-lark": "^28.0.0",
"@ckeditor/ckeditor5-basic-styles": "^29.0.0",
"@ckeditor/ckeditor5-core": "^29.0.0",
"@ckeditor/ckeditor5-editor-classic": "^29.0.0",
"@ckeditor/ckeditor5-editor-decoupled": "^29.0.0",
"@ckeditor/ckeditor5-engine": "^29.0.0",
"@ckeditor/ckeditor5-essentials": "^29.0.0",
"@ckeditor/ckeditor5-font": "^29.0.0",
"@ckeditor/ckeditor5-highlight": "^29.0.0",
"@ckeditor/ckeditor5-paragraph": "^29.0.0",
"@ckeditor/ckeditor5-theme-lark": "^29.0.0",
"webpack": "^4.43.0",

@@ -34,0 +34,0 @@ "webpack-cli": "^3.3.11"

CKEditor 5 find and replace feature
===========================
[![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-find-and-replace.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-find-and-replace)
[![Coverage Status](https://coveralls.io/repos/github/ckeditor/ckeditor5/badge.svg?branch=master)](https://coveralls.io/github/ckeditor/ckeditor5?branch=master)
[![Build Status](https://travis-ci.com/ckeditor/ckeditor5.svg?branch=master)](https://travis-ci.com/ckeditor/ckeditor5)
This package implements the find and replace feature for CKEditor 5.
## Demo
Check out the demo in the [Find and replace feature](https://ckeditor.com/docs/ckeditor5/latest/features/find-and-replace.html) guide.
## Documentation
See the [`@ckeditor/ckeditor5-find-and-replace` package](https://ckeditor.com/docs/ckeditor5/latest/api/find-and-replace.html) page in [CKEditor 5 documentation](https://ckeditor.com/docs/ckeditor5/latest/).
## License
Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html). For full details about the license, please check the `LICENSE.md` file or [https://ckeditor.com/legal/ckeditor-oss-license](https://ckeditor.com/legal/ckeditor-oss-license).

@@ -107,17 +107,16 @@ /**

function regexpMatchToFindResult( matchResult ) {
// In case of match words option the matching results contain indices so that we work on
// offset where a subject match group was (as opposed to working on entire matched string).
if ( matchResult.indices ) {
return {
label: matchResult[ 1 ],
start: matchResult.indices[ 1 ][ 0 ],
end: matchResult.indices[ 1 ][ 1 ]
};
} else {
return {
label: matchResult[ 1 ],
start: matchResult.index,
end: matchResult.index + matchResult[ 1 ].length
};
const lastGroupIndex = matchResult.length - 1;
let startOffset = matchResult.index;
// Searches with match all flag have an extra matching group with empty string or white space matched before the word.
if ( matchResult.length === 3 ) {
startOffset += matchResult[ 1 ].length;
}
return {
label: matchResult[ lastGroupIndex ],
start: startOffset,
end: startOffset + matchResult[ lastGroupIndex ].length
};
}

@@ -143,7 +142,5 @@

if ( options.wholeWords ) {
flags += 'd'; // Special groups so that regexp indices are available.
const nonLetterGroup = '[^a-zA-Z\u00C0-\u024F\u1E00-\u1EFF]';
regExpQuery = `(?:^|${ nonLetterGroup }|_)` + regExpQuery + `(?:_|${ nonLetterGroup }|$)`;
regExpQuery = `(^|${ nonLetterGroup }|_)` + regExpQuery + `(?:_|${ nonLetterGroup }|$)`;
}

@@ -150,0 +147,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc