Skip to content

Commit

Permalink
Merge stable into master
Browse files Browse the repository at this point in the history
  • Loading branch information
CKEditorBot authored Nov 20, 2023
2 parents 3388cfc + a64db62 commit ad94655
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 24 deletions.
14 changes: 7 additions & 7 deletions docs/framework/contributing/code-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ A couple of useful links:

## Visibility levels

Each class property (including methods, symbols, getters or setters) can be public, protected or private. The default visibility is public, so you should not document that a property is public – there is no need to do this.
Each class property (including methods, symbols, getters, or setters) can be public, protected, or private. The default visibility is public, so you should not document that a property is public – there is no need to do this.

Additional rules apply to private properties:

Expand Down Expand Up @@ -513,19 +513,19 @@ There are some special rules and tips for tests.

Using titles like *"utils"* is not fine as there are multiple utils in the entire project. *"Table utils"* would be better.
* Test descriptions (`it()`) should be written like documentation (what you do and what should happen), e.g. *"the foo dialog closes when the X button is clicked"*. Also, *"...case 1"*, *"...case 2"* in test descriptions are not helpful.
* Avoid test descriptions like *"does not crash when two ranges get merged"* – instead explain what is actually expected to happen. For instance: *"leaves 1 range when two ranges get merged"*.
* Most often, using words like "correctly", "works fine" is a code smell. Thing about the requirements – when writing them you do not say that feature X should "work fine". You document how it should work.
* Avoid test descriptions like *"does not crash when two ranges get merged"*. Instead, explain what is actually expected to happen. For instance: *"leaves 1 range when two ranges get merged"*.
* Most often, using words like "correctly", "works fine" is a code smell. Think about the requirements – when writing them you do not say that feature X should "work fine". You document how it should work.
* Ideally, it should be possible to recreate an algorithm just by reading the test descriptions.
* Avoid covering multiple cases under one `it()`. It is OK to have multiple assertions in one test, but not to test e.g. how method `foo()` works when it is called with 1, then with 2, then 3, etc. There should be a separate test for each case.
* Every test should clean after itself, including destroying all editors and removing all elements that have been added.

### Test implementation

* Avoid using real timeouts. Use [fake timers](https://sinonjs.org/releases/latest/fake-timers/) instead **when possible**. Timeouts make tests really slow.
* However – do not overoptimize (especially that performance is not a priority in tests). In most cases it is completely fine (and hence recommended) to create a separate editor for every `it()`.
* We aim at having 100% coverage of *all distinctive scenarios*. Covering 100% branches in the code is not the goal here – it is a byproduct of covering real scenarios.
* However, do not overoptimize (especially that performance is not a priority in tests). In most cases it is completely fine (and hence recommended) to create a separate editor for every `it()`.
* We aim at having 100% coverage of *all distinctive scenarios*. Covering 100% branches in the code is not the goal here – it is a by-product of covering real scenarios.

Think about this – when you fix a bug by adding a parameter to an existing function call you do not affect code coverage (that line was called anyway). However, you had a bug, meaning that your test suite did not cover it. Therefore, a test must be created for that code change.
Think about this: when you fix a bug by adding a parameter to an existing function call, you do not affect code coverage (that line was called anyway). However, you had a bug, meaning that your test suite did not cover it. Therefore, a test must be created for that code change.
* It should be `expect( x ).to.equal( y )`. **NOT**: ~~`expect( x ).to.be.equal( y )`~~.
* When using Sinon spies, pay attention to the readability of assertions and failure messages.
* Use named spies, for example:
Expand Down Expand Up @@ -693,7 +693,7 @@ this.env;

### Acronyms and proper names

Acronyms and, partially, proper names are naturally written in uppercase. This may stand against code style rules described above – especially when there is a need to include an acronym or a proper name in a variable or class name. In such case, one should follow the following rules:
Acronyms and, partially, proper names are naturally written in uppercase. This may stand against code style rules described above – especially when there is a need to include an acronym or a proper name in a variable or class name. In such case, one should follow these rules:

* Acronyms:
* All lowercase if at the beginning of the variable name: `let domError`.
Expand Down
2 changes: 1 addition & 1 deletion docs/installation/getting-started/predefined-builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ During its initialization the editor hides the used editable element on the page
In CKEditor 5 the concept of the "boxed" editor was reinvented:

* The toolbar is now always visible when the user scrolls the page down.
* The editor content is now placed inline in the page (without the surrounding `<iframe>` element) &ndash; it is now much easier to style it.
* The editor content is now placed inline in the page (without the surrounding `<iframe>` element). It is now much easier to style it.
* By default the editor now grows automatically with the content.

{@img assets/img/editor-classic.png 778 Screenshot of a classic editor.}
Expand Down
2 changes: 1 addition & 1 deletion docs/installation/getting-started/quick-start-other.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Once you have chosen all the desired plugins, press the **Next step** button on

### Toolbar composition

The next step allows you to compose the toolbar. A simple drag-and-drop workspace allows adding buttons (representing the plugins chosen in the previous step) to the toolbar. You may also change the order of the buttons and dropdowns and group them accordingly. Note that online builder allows you to create a multiline toolbar layout, too &ndash; just drag any button below the already placed ones to create a new toolbar line.
The next step allows you to compose the toolbar. A simple drag-and-drop workspace allows adding buttons (representing the plugins chosen in the previous step) to the toolbar. You may also change the order of the buttons and dropdowns and group them accordingly. Note that online builder allows you to create a multiline toolbar layout, too. Just drag any button below the already placed ones to create a new toolbar line.

{@img assets/img/online-builder-04-toolbar-configurator.gif 753 The toolbar drag-and-drop configurator.}

Expand Down
2 changes: 1 addition & 1 deletion docs/installation/integrations/angular.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ export class AppComponent {

### Using the editor with collaboration plugins

The easiest way to integrate {@link features/collaboration collaboration plugins} in an Angular application is to create a custom build first and then import it from the Angular application &ndash; see [Using a custom CKEditor&nbsp;5 build](#using-a-custom-ckeditor-5-build).
The easiest way to integrate {@link features/collaboration collaboration plugins} in an Angular application is to create a custom build first and then import it from the Angular application. See [Using a custom CKEditor&nbsp;5 build](#using-a-custom-ckeditor-5-build).

<info-box>
For such a scenario we provide a few **ready-to-use integrations** featuring collaborative editing in Angular applications:
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/widgets/implementing-a-block-widget.md
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ Once you have converters, you can try to see the simple box in action. You have
</html>
```

Rebuild your project and voila &ndash; that's your first simple box instance:
Rebuild your project and voilà &ndash; this is your first simple box instance:

{@img assets/img/tutorial-implementing-a-widget-3.png Screenshot of a classic editor with an instance of a simple box inside.}

Expand Down
2 changes: 1 addition & 1 deletion packages/ckeditor5-basic-styles/src/attributecommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default class AttributeCommand extends Command {
}

/**
* Executes the command &mdash; applies the attribute to the selection or removes it from the selection.
* Executes the command &ndash; applies the attribute to the selection or removes it from the selection.
*
* If the command is active (`value == true`), it will remove attributes. Otherwise, it will set attributes.
*
Expand Down
2 changes: 1 addition & 1 deletion packages/ckeditor5-core/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export default class Context {
/**
* Returns the context configuration which will be copied to the editors created using this context.
*
* The configuration returned by this method has the plugins configuration removed &mdash; plugins are shared with all editors
* The configuration returned by this method has the plugins configuration removed &ndash; plugins are shared with all editors
* through another mechanism.
*
* This method should only be used by the editor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default class HtmlDataProcessor implements DataProcessor {

/**
* Converts a provided {@link module:engine/view/documentfragment~DocumentFragment document fragment}
* to data format &mdash; in this case to an HTML string.
* to data format &ndash; in this case to an HTML string.
*
* @returns HTML string.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default class XmlDataProcessor implements DataProcessor {

/**
* Converts the provided {@link module:engine/view/documentfragment~DocumentFragment document fragment}
* to data format &mdash; in this case an XML string.
* to data format &ndash; in this case an XML string.
*
* @returns An XML string.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/ckeditor5-engine/src/model/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ export default class Model extends ObservableMixin() {
* This is a high-level method. It takes the {@link #schema schema} into consideration when inserting
* the content, clears the given selection's content before inserting nodes and moves the selection
* to its target position at the end of the process.
* It can split elements, merge them, wrap bare text nodes with paragraphs, etc. &mdash; just like the
* It can split elements, merge them, wrap bare text nodes with paragraphs, etc. &ndash; just like the
* pasting feature should do.
*
* For lower-level methods see {@link module:engine/model/writer~Writer `Writer`}.
Expand Down
6 changes: 3 additions & 3 deletions packages/ckeditor5-engine/src/model/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ export default class Schema extends ObservableMixin() {
* ```
*
* Note: When verifying whether the given node can be a child of the given context, the
* schema also verifies the entire context &mdash; from its root to its last element. Therefore, it is possible
* schema also verifies the entire context &ndash; from its root to its last element. Therefore, it is possible
* for `checkChild()` to return `false` even though the context's last element can contain the checked child.
* It happens if one of the context's elements does not allow its child.
*
Expand Down Expand Up @@ -421,7 +421,7 @@ export default class Schema extends ObservableMixin() {
/**
* Checks whether the given element (`elementToMerge`) can be merged with the specified base element (`positionOrBaseElement`).
*
* In other words &mdash; whether `elementToMerge`'s children {@link #checkChild are allowed} in the `positionOrBaseElement`.
* In other words &ndash; whether `elementToMerge`'s children {@link #checkChild are allowed} in the `positionOrBaseElement`.
*
* This check ensures that elements merged with {@link module:engine/model/writer~Writer#merge `Writer#merge()`}
* will be valid.
Expand Down Expand Up @@ -1490,7 +1490,7 @@ interface SchemaCompiledItemDefinitionInternal {
type TypeNames = Array<'isBlock' | 'isContent' | 'isInline' | 'isLimit' | 'isObject' | 'isSelectable'>;

/**
* A schema context &mdash; a list of ancestors of a given position in the document.
* A schema context &ndash; a list of ancestors of a given position in the document.
*
* Considering such position:
*
Expand Down
2 changes: 1 addition & 1 deletion packages/ckeditor5-markdown-gfm/src/gfmdataprocessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class GFMDataProcessor implements DataProcessor {
}

/**
* Converts the provided {@link module:engine/view/documentfragment~DocumentFragment} to data format &mdash; in this
* Converts the provided {@link module:engine/view/documentfragment~DocumentFragment} to data format &ndash; in this
* case to a Markdown string.
*
* @returns Markdown string.
Expand Down
2 changes: 1 addition & 1 deletion packages/ckeditor5-style/src/stylecommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export default class StyleCommand extends Command {
}

/**
* Executes the command &mdash; applies the style classes to the selection or removes it from the selection.
* Executes the command &ndash; applies the style classes to the selection or removes it from the selection.
*
* If the command value already contains the requested style, it will remove the style classes. Otherwise, it will set it.
*
Expand Down
2 changes: 1 addition & 1 deletion packages/ckeditor5-typing/src/typingconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export interface TextTransformationConfig {
* * If an array is passed, it has to have the same number of elements as there are capturing groups in the input value regular expression.
* Each capture group will be replaced with a corresponding string from the passed array. If a given capturing group should not be replaced,
* use `null` instead of passing a string.
* * If a function is used, it should return an array as described above. The function is passed one parameter &mdash; an array with matches
* * If a function is used, it should return an array as described above. The function is passed one parameter &ndash; an array with matches
* by the regular expression. See the examples below.
*
* A simple string-to-string replacement:
Expand Down
4 changes: 2 additions & 2 deletions packages/ckeditor5-utils/src/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if ( globalThis.CKEDITOR_VERSION ) {
* that it contains all the necessary code from e.g. `@ckeditor/ckeditor5-engine` and `@ckeditor/ckeditor5-utils`.
*
* However, the `Highlight` plugin imports some of the modules from these packages, too. If you ask webpack to
* build such a project, you will end up with the modules being included (and run) twice &mdash; first, because they are
* build such a project, you will end up with the modules being included (and run) twice &ndash; first, because they are
* included inside the build package, and second, because they are required by the `Highlight` plugin.
*
* Therefore, **you must never add plugins to an existing build** unless your plugin has no dependencies.
Expand Down Expand Up @@ -131,7 +131,7 @@ if ( globalThis.CKEDITOR_VERSION ) {
* asking the author of the third-party package to upgrade its depdendencies (or forking their project and doing this yourself).
*
* **Note:** All official CKEditor 5 packages (excluding integrations and `ckeditor5-dev-*` packages) are released in the
* same major version. This is &mdash; in the `x.y.z`, the `x` is the same for all packages. This is the simplest way to check
* same major version. This means that in the `x.y.z` version, the `x` is the same for all packages. This is the simplest way to check
* whether you use packages coming from the same CKEditor 5 version. You can read more about versioning in the
* {@glink updating/versioning-policy Versioning policy} guide.
*
Expand Down
3 changes: 3 additions & 0 deletions scripts/vale/styles/CKEditor/Terms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ swap:
boolean: Boolean
bugfix: bug fix
bugfixes: bug fixes
byproduct: by-product
builtin|built in: built-in
can not: cannot
check box: checkbox
Ckeditor|CKeditor|CK Editor|CK editor: CKEditor
Cksource|CKsource|CK Source: CKSource
clean-up: cleanup
click on: click|click in
config: configuration
data are: data is
Expand Down Expand Up @@ -73,3 +75,4 @@ swap:
utils: utilities
webpage: web page|page|website
web site: website
yarn: Yarn
1 change: 1 addition & 0 deletions scripts/vale/styles/Vocab/Docs/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ Vite
Vue
webpack
Wirtz
Wolt
WProofreader
wproofreader
Zendesk

0 comments on commit ad94655

Please sign in to comment.