TextTransformationConfig (typing)
@ckeditor/ckeditor5-typing/src/texttransformation
The configuration of the text transformation feature.
ClassicEditor
.create( editorElement, {
typing: {
transformations: ... // Text transformation feature options.
}
} )
.then( ... )
.catch( ... );
By default, the feature comes pre-configured
(via config.typing.transformations.include
) with the
following groups of transformations:
- Typography (group name:
typography
)ellipsis
: transforms...
to…
enDash
: transforms--
to–
emDash
: transforms---
to—
- Quotations (group name:
quotes
)quotesPrimary
: transforms"Foo bar"
to“Foo bar”
quotesSecondary
: transforms'Foo bar'
to‘Foo bar’
- Symbols (group name:
symbols
)trademark
: transforms(tm)
to™
registeredTrademark
: transforms(r)
to®
copyright
: transforms(c)
to©
- Mathematical (group name:
mathematical
)oneHalf
: transforms1/2
to:½
oneThird
: transforms1/3
to:⅓
twoThirds
: transforms2/3
to:⅔
oneForth
: transforms1/4
to:¼
threeQuarters
: transforms3/4
to:¾
lessThanOrEqual
: transforms<=
to:≤
greaterThanOrEqual
: transforms>=
to:≥
notEqual
: transforms!=
to:≠
arrowLeft
: transforms<-
to:←
arrowRight
: transforms->
to:→
- Misc:
quotesPrimaryEnGb
: transforms'Foo bar'
to‘Foo bar’
quotesSecondaryEnGb
: transforms"Foo bar"
to“Foo bar”
quotesPrimaryPl
: transforms"Foo bar"
to„Foo bar”
quotesSecondaryPl
: transforms'Foo bar'
to‚Foo bar’
In order to load additional transformations, use the
transformations.extra
option.
In order to narrow down the list of transformations, use the
transformations.remove
option.
In order to completely override the supported transformations, use the
transformations.include
option.
Examples:
const transformationsConfig = {
include: [
// Use only the 'quotes' and 'typography' groups.
'quotes',
'typography',
// Plus, some custom transformation.
{ from: 'CKE', to: 'CKEditor' }
]
};
const transformationsConfig = {
// Remove the 'ellipsis' transformation loaded by the 'typography' group.
remove: [ 'ellipsis' ]
}
Filtering
Properties
-
extra : Array.<TextTransformationDescription>
module:typing/texttransformation~TextTransformationConfig#extra
Additional text transformations that are added to the transformations defined in
transformations.include
.const transformationsConfig = { extra: [ { from: 'CKE', to: 'CKEditor' } ] };
-
include : Array.<TextTransformationDescription>
module:typing/texttransformation~TextTransformationConfig#include
The standard list of text transformations supported by the editor. By default it comes pre-configured with a couple dozen of them (see
TextTransformationConfig
for the full list). You can override this list completely by setting this option or use the other two options (transformations.extra
,transformations.remove
) to fine-tune the default list. -
remove : Array.<TextTransformationDescription>
module:typing/texttransformation~TextTransformationConfig#remove
The text transformation names that are removed from transformations defined in
transformations.include
ortransformations.extra
.const transformationsConfig = { remove: [ 'ellipsis', // Remove only 'ellipsis' from the 'typography' group. 'mathematical' // Remove all transformations from the 'mathematical' group. ] }
Every day, we work hard to keep our documentation complete. Have you spotted an outdated information? Is something missing? Please report it via our issue tracker.