-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Expand file tree
/
Copy pathsubscriptconfig.ts
More file actions
50 lines (47 loc) · 1.75 KB
/
subscriptconfig.ts
File metadata and controls
50 lines (47 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/
/**
* @module basic-styles/subscriptconfig
*/
/**
* The configuration of the {@link module:basic-styles/subscript~Subscript subscript feature}.
* Nested under {@link module:basic-styles/basicstylesconfig~BasicStylesConfig#subscript `config.basicStyles.subscript`}.
*
* ```ts
* ClassicEditor
* .create( editorElement, {
* basicStyles: {
* subscript: {
* allowNesting: true
* }
* }
* } )
* .then( ... )
* .catch( ... );
* ```
*
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
*/
export interface BasicStyleSubscriptConfig {
/**
* Whether `subscript` and `superscript` attributes are allowed to coexist on the same text.
*
* By default this is `false`: applying subscript to text that is already superscript removes the
* superscript attribute (and vice versa), matching the behavior of common word processors.
*
* Set to `true` to restore the historical behavior where both attributes can be applied to the same
* text. This is useful for content such as isotope notation (`¹⁴₆C`) or tensor indices (`T^i_j`).
*
* The flag is symmetric with
* {@link module:basic-styles/superscriptconfig~BasicStyleSuperscriptConfig#allowNesting `config.basicStyles.superscript.allowNesting`}:
* if either is set to `true`, both commands skip the mutual-exclusion step.
*
* The flag only affects command execution. Content set through the data pipeline (for example
* `editor.setData( '<sub><sup>x</sup></sub>' )`) keeps both attributes regardless of this option.
*
* @default false
*/
allowNesting?: boolean;
}