Socket
Socket
Sign inDemoInstall

@ckeditor/ckeditor5-enter

Package Overview
Dependencies
Maintainers
1
Versions
620
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ckeditor/ckeditor5-enter - npm Package Compare versions

Comparing version 0.7.0 to 0.8.0

.github/PULL_REQUEST_TEMPLATE.md

20

package.json
{
"name": "@ckeditor/ckeditor5-enter",
"version": "0.7.0",
"version": "0.8.0",
"description": "Enter feature for CKEditor 5.",
"keywords": [],
"dependencies": {
"@ckeditor/ckeditor5-core": "*",
"@ckeditor/ckeditor5-engine": "*",
"@ckeditor/ckeditor5-utils": "*"
"@ckeditor/ckeditor5-core": "^0.7.0",
"@ckeditor/ckeditor5-engine": "^0.8.0",
"@ckeditor/ckeditor5-utils": "^0.8.0"
},
"devDependencies": {
"@ckeditor/ckeditor5-dev-lint": "^2.0.0",
"@ckeditor/ckeditor5-basic-styles": "*",
"@ckeditor/ckeditor5-editor-classic": "*",
"@ckeditor/ckeditor5-heading": "*",
"@ckeditor/ckeditor5-typing": "*",
"@ckeditor/ckeditor5-undo": "*",
"@ckeditor/ckeditor5-dev-lint": "^2.0.2",
"@ckeditor/ckeditor5-basic-styles": "^0.7.1",
"@ckeditor/ckeditor5-editor-classic": "^0.7.1",
"@ckeditor/ckeditor5-heading": "^0.8.0",
"@ckeditor/ckeditor5-typing": "^0.8.0",
"@ckeditor/ckeditor5-undo": "^0.7.1",
"gulp": "^3.9.0",

@@ -19,0 +19,0 @@ "guppy-pre-commit": "^0.4.0"

@@ -27,3 +27,3 @@ /**

doc.enqueueChanges( () => {
enterBlock( this.editor.data, batch, doc.selection );
enterBlock( this.editor.data, batch, doc.selection, doc.schema );

@@ -40,3 +40,4 @@ this.fire( 'afterExecute', { batch } );

// @param {module:engine/model/selection~Selection} selection Selection on which the action should be performed.
function enterBlock( dataController, batch, selection ) {
// @param {module:engine/model/schema~Schema} schema
function enterBlock( dataController, batch, selection, schema ) {
const isSelectionEmpty = selection.isCollapsed;

@@ -47,2 +48,7 @@ const range = selection.getFirstRange();

// Do nothing if selection starts or ends inside `limit` elements.
if ( schema.limits.has( startElement.name ) || schema.limits.has( endElement.name ) ) {
return;
}
// Don't touch the root.

@@ -49,0 +55,0 @@ if ( startElement.root == startElement ) {

@@ -29,3 +29,13 @@ /**

schema.registerItem( 'h', '$block' );
schema.registerItem( 'inlineLimit' );
schema.registerItem( 'blockLimit' );
schema.allow( { name: 'inlineLimit', inside: 'p' } );
schema.allow( { name: '$text', inside: 'inlineLimit' } );
schema.allow( { name: '$text', inside: '$root' } );
schema.allow( { name: 'blockLimit', inside: '$root' } );
schema.allow( { name: 'p', inside: 'blockLimit' } );
schema.limits.add( 'inlineLimit' );
schema.limits.add( 'blockLimit' );
} );

@@ -111,2 +121,26 @@ } );

test(
'should not break inline limit elements - collapsed',
'<p><inlineLimit>foo[]bar</inlineLimit></p>',
'<p><inlineLimit>foo[]bar</inlineLimit></p>'
);
test(
'should not break inline limit elements',
'<p><inlineLimit>foo[bar]baz</inlineLimit></p>',
'<p><inlineLimit>foo[bar]baz</inlineLimit></p>'
);
test(
'should not break inline limit elements - selection partially inside',
'<p><inlineLimit>ba[r</inlineLimit></p><p>f]oo</p>',
'<p><inlineLimit>ba[r</inlineLimit></p><p>f]oo</p>'
);
test(
'should break paragraph in blockLimit',
'<blockLimit><p>foo[]bar</p></blockLimit>',
'<blockLimit><p>foo</p><p>[]bar</p></blockLimit>'
);
it( 'leaves one empty element after two were fully selected (backward)', () => {

@@ -113,0 +147,0 @@ setData( doc, '<p>[abc</p><p>def]</p>' );

Sorry, the diff of this file is not supported yet

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