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

@ckeditor/ckeditor5-page-break

Package Overview
Dependencies
Maintainers
1
Versions
687
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ckeditor/ckeditor5-page-break - npm Package Compare versions

Comparing version 20.0.0 to 21.0.0

lang/translations/tk.po

22

package.json
{
"name": "@ckeditor/ckeditor5-page-break",
"version": "20.0.0",
"version": "21.0.0",
"description": "Page break feature for CKEditor 5.",

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

"dependencies": {
"@ckeditor/ckeditor5-core": "^20.0.0",
"@ckeditor/ckeditor5-ui": "^20.0.0",
"@ckeditor/ckeditor5-widget": "^20.0.0"
"@ckeditor/ckeditor5-core": "^21.0.0",
"@ckeditor/ckeditor5-ui": "^21.0.0",
"@ckeditor/ckeditor5-widget": "^21.0.0"
},
"devDependencies": {
"@ckeditor/ckeditor5-cloud-services": "^20.0.0",
"@ckeditor/ckeditor5-engine": "^20.0.0",
"@ckeditor/ckeditor5-editor-classic": "^20.0.0",
"@ckeditor/ckeditor5-easy-image": "^20.0.0",
"@ckeditor/ckeditor5-image": "^20.0.0",
"@ckeditor/ckeditor5-paragraph": "^20.0.0",
"@ckeditor/ckeditor5-utils": "^20.0.0"
"@ckeditor/ckeditor5-cloud-services": "^21.0.0",
"@ckeditor/ckeditor5-engine": "^21.0.0",
"@ckeditor/ckeditor5-editor-classic": "^21.0.0",
"@ckeditor/ckeditor5-easy-image": "^21.0.0",
"@ckeditor/ckeditor5-image": "^21.0.0",
"@ckeditor/ckeditor5-paragraph": "^21.0.0",
"@ckeditor/ckeditor5-utils": "^21.0.0"
},

@@ -27,0 +27,0 @@ "engines": {

@@ -110,3 +110,3 @@ /**

if ( parent.isEmpty && !parent.is( '$root' ) ) {
if ( parent.isEmpty && !parent.is( 'element', '$root' ) ) {
return parent.parent;

@@ -113,0 +113,0 @@ }

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

import { toWidget } from '@ckeditor/ckeditor5-widget/src/utils';
import first from '@ckeditor/ckeditor5-utils/src/first';

@@ -89,17 +88,27 @@ import '../theme/pagebreak.css';

view: element => {
// The "page break" div must have specified value for the 'page-break-after' definition and single child only.
if ( !element.is( 'div' ) || element.getStyle( 'page-break-after' ) != 'always' || element.childCount != 1 ) {
return;
}
// For upcast conversion it's enough if we check for element style and verify if it's empty
// or contains only hidden span element.
const viewSpan = first( element.getChildren() );
const hasPageBreakBefore = element.getStyle( 'page-break-before' ) == 'always';
const hasPageBreakAfter = element.getStyle( 'page-break-after' ) == 'always';
// The child must be the "span" element that is not displayed and has a space inside.
if ( !viewSpan.is( 'span' ) || viewSpan.getStyle( 'display' ) != 'none' || viewSpan.childCount != 1 ) {
if ( !hasPageBreakBefore && !hasPageBreakAfter ) {
return;
}
const text = first( viewSpan.getChildren() );
// The "page break" div accepts only single child or no child at all.
if ( element.childCount == 1 ) {
const viewSpan = element.getChild( 0 );
if ( !text.is( 'text' ) || text.data !== ' ' ) {
// The child must be the "span" element that is not displayed and has a space inside.
if ( !viewSpan.is( 'element', 'span' ) || viewSpan.getStyle( 'display' ) != 'none' || viewSpan.childCount != 1 ) {
return;
}
const text = viewSpan.getChild( 0 );
if ( !text.is( '$text' ) || text.data !== ' ' ) {
return;
}
} else if ( element.childCount > 1 ) {
return;

@@ -110,3 +119,7 @@ }

},
model: 'pageBreak'
model: 'pageBreak',
// This conversion must be checked before <br> conversion because some editors use
// <br style="page-break-before:always"> as a page break marker.
converterPriority: 'high'
} );

@@ -113,0 +126,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