Skip to content

Commit

Permalink
Merge branch 'i/3204-table-caption' into i/9105-table-algorithms
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbarnas committed Apr 16, 2021
2 parents 2ad76b9 + 4fd63b7 commit 7be53fd
Show file tree
Hide file tree
Showing 141 changed files with 4,721 additions and 853 deletions.
24 changes: 7 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,27 @@
sudo: required
dist: xenial
addons:
chrome: stable
language: node_js
services:
- xvfb
cache:
yarn: true
node_js:
- "12"
cache:
- node_modules
cache: yarn
before_install:
- export START_TIME=$( date +%s )
- export COVERALLS_SERVICE_JOB_ID=$( TRAVIS_JOB_ID )
- export COVERALLS_SERVICE_NAME="CKEditor5 code coverage"
- npm i -g yarn
install:
- yarn install
# The "./manual/all-features-dll.js" test requires building DLL.
- yarn run dll:build
script:
- node ./scripts/continuous-integration-script.js
- yarn run lint
- yarn run stylelint
- ./scripts/check-manual-tests.sh -r ckeditor5 -f ckeditor5
- yarn run docs --strict
- 'if [ $TRAVIS_TEST_RESULT -eq 0 ]; then
travis_wait 30 yarn run docs:build-and-publish-nightly;
fi'
- ./scripts/ci/travis-check.js
# "travis_wait" does not work in child processes. Hence, it must be called from the configuration file.
- if [[ $TRAVIS_JOB_TYPE == "Validation" && $TRAVIS_TEST_RESULT -eq 0 ]]; then travis_wait 30 yarn run docs:build-and-publish-nightly; fi
after_script:
- export END_TIME=$( date +%s )
- ckeditor5-dev-tests-notify-travis-status
env:
global:
- secure: RO140EQDHmEOPJPikk8eCY5IdHpnEKGm41p5U1ewAbeZv1DpCG+rSumR2JdYl75kFAaZvCSm1NuVMM+kmYd+/z+LQbKj7QH5G/UHNho3H89blIU6WlJhT0YR5vclm9rvnEvOtxnfODca1Qrw+CaCoJks2o4VYbJB7mOBVNsh7Bc=
jobs:
- TRAVIS_JOB_TYPE=Tests
- TRAVIS_JOB_TYPE=Validation
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ Changelog

### Release highlights

We are happy to announce the release of CKEditor 5 v27.0.0.
We are happy to announce the release of CKEditor 5 v27.0.0 that contains security fixes for multiple packages: `ckeditor5-engine`, `ckeditor5-font`, `ckeditor5-image`, `ckeditor5-list`, `ckeditor5-markdown-gfm`, `ckeditor5-media-embed`, `ckeditor5-paste-from-office`, `ckeditor5-widget`. Even though this is a low impact issue and only affects the victim's browser with no risk of data leakage, an upgrade is highly recommended! You can read more details in the relevant [security advisory](https://github.com/ckeditor/ckeditor5/security/advisories/GHSA-3rh3-wfr4-76mj) and [contact us](https://ckeditor.com/contact/) if you have more questions.

The CKEditor 5 team would like to thank Yeting Li for recognizing and reporting these vulnerabilities.

Starting from this version, collaboration features release notes will be included in the CKEditor 5 changelog. Changes for the previous releases are available on https://ckeditor.com/collaboration/changelog/.

This release introduces some new features:

* The new [text part language](https://github.com/ckeditor/ckeditor5/issues/8989) feature allows you to define the language for each passage of content written in multiple languages. This helps satisfy the WCAG Success Criterion 3.1.2 Language of Parts.
* The new [text part language](https://ckeditor.com/docs/ckeditor5/latest/features/language.html) feature allows you to define the language for each passage of content written in multiple languages. This helps satisfy the WCAG Success Criterion 3.1.2 Language of Parts.
* Support for [drag and dropping of textual content and block objects](https://ckeditor.com/docs/ckeditor5/latest/features/pasting/drag-drop.html) (like images and tables) within the editor.
* Support for [dropping HTML content from outside of the editor](https://ckeditor.com/docs/ckeditor5/latest/features/pasting/drag-drop.html) into the editor.
* [Alignment can now be set using classes](https://github.com/ckeditor/ckeditor5/issues/8516).
Expand Down
5 changes: 3 additions & 2 deletions docs/_snippets/builds/frameworks/framework-integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@

/* globals document */

// Sometimes the request to `badge.fury.io` fails for unknown reason, so ignore it.
// Sometimes the request to external resources (like `badge.fury.io` or `emojics.com`) fails for unknown reasons,
// so ignore all navigation timeouts for framework integration docs.
const metaElement = document.createElement( 'meta' );

metaElement.name = 'x-cke-crawler-ignore-patterns';
metaElement.content = JSON.stringify( {
'request-failure': 'badge.fury.io'
'navigation-error': 'timeout'
} );

document.head.appendChild( metaElement );
7 changes: 5 additions & 2 deletions docs/_snippets/features/wproofreader.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<div id="snippet-wproofreader">
<p>Typos hapen. We striving to correct them. Hover on the marked words for instant correction suggestions or click the dialoge icon in the bottom right corner to have the whole text proofread at once.</p>
<p>You can also paste your own text here to have its spelling and grammar checked.</p>
<p>Warsaw is the capital adn largest city of Poland. The metropolis stands on the Vistula River in east-central Poland and its population is officially estimatd at 1.8 million residents within a greater metropolitan area of 3.1 million residents, which makes Warsaw the 7th most-populous capital city in the European Union. Warsaw is an alpha-global city, a major international tourist destination, and a significaant cultural, political, and economic hub. Its historical Old Town was designated a UNESCO World Heritage Site.</p>

<p>Warschau ist seit 1596 die Hauptstadt Polens und die fl&auml;chenm&auml;&szlig;ig gr&ouml;&szlig;te sowie mit &uuml;ber 1,75 Mio. Einwonern bev&ouml;lkerungsreichste Staddt des Landes. Als eines der wichtigsten Verkehrs-, Wirtschafts- und Handelszentren Mittel- und Osteeuropas genie&szlig;t Warschau gro&szlig;e politische und kulturelle Bedetung. In der Stadt befinden sich zahlreiche Institutionen, Universit&auml;ten, Theater, Museen und Baudenkm&auml;ler.</p>

<p>Варша́ва является столицей и крупнейшим по населению, и территории городом Польшй. Город стал фактической столицей в 1596 году, коггда после пожара в Вавельском замке в Кракове король Сигизмунд III перёнёс свою резиденцию суда, при этом столичный статус города был подтверждён только в Конституции 1791 года. Через город протекает река Висла, разделяющая город приблизительно поровну.</p>
</div>
2 changes: 1 addition & 1 deletion docs/_snippets/features/wproofreader.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ClassicEditor
plugins: [ ArticlePluginSet, EasyImage, ImageUpload, CloudServices, WProofreader ],
wproofreader: {
serviceId: '1:Eebp63-lWHbt2-ASpHy4-AYUpy2-fo3mk4-sKrza1-NsuXy4-I1XZC2-0u2F54-aqYWd1-l3Qf14-umd',
lang: 'en_AI',
lang: 'auto',
srcUrl: 'https://svc.webspellchecker.net/spellcheck31/wscbundle/wscbundle.js'
},
cloudServices: CS_CONFIG,
Expand Down
Binary file added docs/assets/img/spellcheck-dictionary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions docs/builds/guides/migration/migration-to-27.1.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
category: builds-migration
menu-title: Migration to v27.1.0
order: 10
---

# Migration to CKEditor 5 v27.1.0

For the entire list of changes introduced in version 27.1.0, see the [changelog for CKEditor 5 v27.1.0](https://github.com/ckeditor/ckeditor5/blob/master/CHANGELOG.md#TODO).

Listed below are the most important changes that require your attention when upgrading to CKEditor 5 v27.1.0.

## Disallowing nesting block quotes

Prior to version 27.1.0 inserting a block quote into another block quote was not allowed.

If you wish to bring back this restriction, see the {@link features/block-quote#disallow-nesting-block-quotes Disallow nesting block quotes} section in the block quote feature guide.
12 changes: 6 additions & 6 deletions docs/features/spelling-and-grammar-checking.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ The proofreader badge in the bottom-right corner shows you the number of mistake

{@snippet features/wproofreader}

## Supported languages
## Multi-language support

By default the spell checker supports 18 languages: AI-based English (default), American English, Brazilian Portuguese, British English, Canadian English, Canadian French, Danish, Dutch, Finnish, French, German, Greek, Italian, Norwegian Bokmål, Portuguese, Spanish, Swedish and Ukrainian. Grammar checking is available for 16 of them &mdash; there is no grammar checking for Finnish and Norwegian.
As seen in the demo, the spell checking and grammar feature can support multilingual content. If the proofreader language is set to Auto Detect (or the `auto` language is set in the configuration), the feature will automatically recognize the text language and suggest error corrections and grammar specifically for that language.

There are also over 150 additional languages and specialized dictionaries such as medical and legal available for an additional fee. You can check the full list [here](https://webspellchecker.com/additional-dictionaries/).
{@img assets/img/spellcheck-dictionary.png 800 Setting the spell checker dictionary to auto.}

## Related features
## Supported languages

There are other language-related CKEditor 5 features you may want to check:
By default the spell checker supports 18 languages: AI-based English (default), American English, Brazilian Portuguese, British English, Canadian English, Canadian French, Danish, Dutch, Finnish, French, German, Greek, Italian, Norwegian Bokmål, Portuguese, Spanish, Swedish and Ukrainian. Grammar checking is available for 16 of them &mdash; there is no grammar checking for Finnish and Norwegian.

* {@link features/language Text part Language} &ndash; Set the language of the selected content part to support multilingual texts.
There are also over 150 additional languages and specialized dictionaries such as medical and legal available for an additional fee. You can check the full list [here](https://webspellchecker.com/additional-dictionaries/).

## Installation

Expand Down
8 changes: 7 additions & 1 deletion packages/ckeditor5-alignment/docs/features/text-alignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ClassicEditor

### Using classes instead of inline style

By default alignment is set inline using `text-align` CSS property. If you wish the feature to output more semantic content that uses classes instead of inline styles, you can specify class names by using the `className` property in `config.alignment.options` and style them by using a stylesheet.
By default, alignment is set inline using the `text-align` CSS property. If you wish the feature to output more semantic content that uses classes instead of inline styles, you can specify class names by using the `className` property in `config.alignment.options` and style them by using a stylesheet.

<info-box>
Once you decide to use classes for the alignment, you must define `className` for **all** alignment entries in {@link module:alignment/alignment~AlignmentConfig#options `config.alignment.options`}.
Expand Down Expand Up @@ -139,6 +139,12 @@ The {@link module:alignment/alignment~Alignment} plugin registers:
We recommend using the official {@link framework/guides/development-tools#ckeditor-5-inspector CKEditor 5 inspector} for development and debugging. It will give you tons of useful information about the state of the editor such as internal data structures, selection, commands, and many more.
</info-box>

## Content compatibility

The {@link module:alignment/alignment~Alignment} plugin provides support for the deprecated `align` attribute.

Block elements such as `<p>` with the `align` attribute are accepted by the plugin, but the editor always returns the markup in a modern format, so the transformation is one way only.

## Contribute

The source code of the feature is available on GitHub in https://github.com/ckeditor/ckeditor5/tree/master/packages/ckeditor5-alignment.
41 changes: 41 additions & 0 deletions packages/ckeditor5-alignment/lang/translations/de-ch.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
#
# !!! IMPORTANT !!!
#
# Before you edit this file, please keep in mind that contributing to the project
# translations is possible ONLY via the Transifex online service.
#
# To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
#
# To learn more, check out the official contributor's guide:
# https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
#
msgid ""
msgstr ""
"Language-Team: German (Switzerland) (https://www.transifex.com/ckeditor/teams/11143/de_CH/)\n"
"Language: de_CH\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

msgctxt "Toolbar button tooltip for aligning the text to the left."
msgid "Align left"
msgstr "Linksbündig"

msgctxt "Toolbar button tooltip for aligning the text to the right."
msgid "Align right"
msgstr "Rechtsbündig"

msgctxt "Toolbar button tooltip for aligning the text to center."
msgid "Align center"
msgstr "Zentriert"

msgctxt "Toolbar button tooltip for making the text justified."
msgid "Justify"
msgstr "Blocksatz"

msgctxt "Dropdown button tooltip for the text alignment feature."
msgid "Text alignment"
msgstr "Textausrichtung"

msgctxt "Label used by assistive technologies describing the text alignment feature toolbar."
msgid "Text alignment toolbar"
msgstr "Text-Ausrichtung Toolbar"
6 changes: 3 additions & 3 deletions packages/ckeditor5-alignment/src/alignment.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ export default class Alignment extends Plugin {
* .then( ... )
* .catch( ... );
*
* By default the alignment is set inline using `text-align` CSS property. To further customize the alignment you can
* provide names of classes for each alignment option using `className` property.
* By default the alignment is set inline using the `text-align` CSS property. To further customize the alignment,
* you can provide names of classes for each alignment option using the `className` property.
*
* **Note:** Once you define `className` property for one option, you need to specify it for all other options.
* **Note:** Once you define the `className` property for one option, you need to specify it for all other options.
*
* ClassicEditor
* .create( editorElement, {
Expand Down
28 changes: 28 additions & 0 deletions packages/ckeditor5-alignment/src/alignmentediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ export default class AlignmentEditing extends Plugin {
editor.conversion.for( 'upcast' ).attributeToAttribute( definition );
}

const upcastCompatibilityDefinitions = buildUpcastCompatibilityDefinitions( optionsToConvert );

// Always upcast from deprecated `align` attribute.
for ( const definition of upcastCompatibilityDefinitions ) {
editor.conversion.for( 'upcast' ).attributeToAttribute( definition );
}

editor.commands.add( 'alignment', new AlignmentCommand( editor ) );
}
}
Expand Down Expand Up @@ -122,6 +129,27 @@ function buildUpcastInlineDefinitions( options ) {
return definitions;
}

// Prepare upcast definitions for deprecated `align` attribute.
// @private
function buildUpcastCompatibilityDefinitions( options ) {
const definitions = [];

for ( const { name } of options ) {
definitions.push( {
view: {
key: 'align',
value: name
},
model: {
key: 'alignment',
value: name
}
} );
}

return definitions;
}

// Prepare conversion definitions for upcast and downcast alignment with classes.
// @private
function buildClassDefinition( options ) {
Expand Down
72 changes: 72 additions & 0 deletions packages/ckeditor5-alignment/tests/alignmentediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,78 @@ describe( 'AlignmentEditing', () => {
} );
} );

describe( 'deprecated `align` attribute', () => {
it( 'should support allowed `align` values in LTR content', () => {
const data = '<p align="left">A</p>' +
'<p align="center">B</p>' +
'<p align="right">C</p>' +
'<p align="justify">D</p>';

editor.setData( data );

const expectedModelData = '<paragraph>[]A</paragraph>' +
'<paragraph alignment="center">B</paragraph>' +
'<paragraph alignment="right">C</paragraph>' +
'<paragraph alignment="justify">D</paragraph>';

const expectedData = '<p>A</p>' +
'<p style="text-align:center;">B</p>' +
'<p style="text-align:right;">C</p>' +
'<p style="text-align:justify;">D</p>';

expect( getModelData( model ) ).to.equal( expectedModelData );
expect( editor.getData() ).to.equal( expectedData );
} );

it( 'should support allowed `align` values in RTL content', async () => {
const newEditor = await VirtualTestEditor
.create( {
language: {
content: 'ar'
},
plugins: [ AlignmentEditing, Paragraph ]
} );
const model = newEditor.model;
const data = '<p align="left">A</p>' +
'<p align="center">B</p>' +
'<p align="right">C</p>' +
'<p align="justify">D</p>';

newEditor.setData( data );

const expectedModelData = '<paragraph alignment="left">[]A</paragraph>' +
'<paragraph alignment="center">B</paragraph>' +
'<paragraph>C</paragraph>' +
'<paragraph alignment="justify">D</paragraph>';

const expectedData = '<p style="text-align:left;">A</p>' +
'<p style="text-align:center;">B</p>' +
'<p>C</p>' +
'<p style="text-align:justify;">D</p>';

expect( getModelData( model ) ).to.equal( expectedModelData );
expect( newEditor.getData() ).to.equal( expectedData );

return newEditor.destroy();
} );

it( 'should ignore invalid values', () => {
const data = '<p align="">A</p>' +
'<p align="not-valid">B</p>';

editor.setData( data );

const expectedModelData = '<paragraph>[]A</paragraph>' +
'<paragraph>B</paragraph>';

const expectedData = '<p>A</p>' +
'<p>B</p>';

expect( getModelData( model ) ).to.equal( expectedModelData );
expect( editor.getData() ).to.equal( expectedData );
} );
} );

describe( 'should be extensible', () => {
it( 'converters in the data pipeline', () => {
blockDefaultConversion( editor.data.downcastDispatcher );
Expand Down
45 changes: 45 additions & 0 deletions packages/ckeditor5-alignment/tests/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,49 @@ describe( 'Alignment integration', () => {
);
} );
} );

describe( 'compatibility with \'to-model-attribute\' converter', () => {
it( 'should not set the "alignment" attribute if the schema does not allow', () => {
// See: https://github.com/ckeditor/ckeditor5/pull/9249#issuecomment-815658459.
editor.model.schema.register( 'div', {
inheritAllFrom: '$block',
allowAttributes: [ 'customAlignment' ]
} );

// Does not allow for setting the "alignment" attribute for `div` elements.
editor.model.schema.addAttributeCheck( ( context, attributeName ) => {
if ( context.endsWith( 'div' ) && attributeName == 'alignment' ) {
return false;
}
} );

editor.conversion.elementToElement( { model: 'div', view: 'div' } );

editor.conversion.attributeToAttribute( {
model: {
name: 'div',
key: 'customAlignment',
values: [ 'right' ]
},
view: {
right: {
key: 'style',
value: {
'text-align': 'right'
}
}
}
} );

// Conversion for the `style[text-align]` attribue will be called twice.
// - The first one comes from the AlignmentEditing plugin,
// - The second one from the test.
editor.setData( '<div style="text-align: right;">foo</div>' );

// As we do not allow for the `alignment` attribute for the `div` element, we expect
// that the `customAlignment` property will be set.
expect( getModelData( editor.model, { withoutSelection: true } ) ).to.equal( '<div customAlignment="right">foo</div>' );
expect( editor.getData() ).to.equal( '<div style="text-align:right;">foo</div>' );
} );
} );
} );
Loading

0 comments on commit 7be53fd

Please sign in to comment.