Title case configuration.
It allows setting words that should not be capitalized when formatted as title case.
ClassicEditor
.create( editorElement, {
caseChange: {
titleCase {
excludeWords: [ 'a', 'an', 'the' ]
}
}
} )
.then( /* ... */ )
.catch( /* ... */ );
ClassicEditor
.create( editorElement, {
caseChange: {
titleCase {
excludeWords: ( word ) => [ 'a', 'an', 'the' ].includes( word )
}
}
} )
.then( /* ... */ )
.catch( /* ... */ );
ClassicEditor
.create( editorElement, {
caseChange: {
titleCase {
excludeWords: ( word, { wordIndex } ) => wordIndex > 0 && [ 'a', 'an', 'the' ].includes( word )
}
}
} )
.then( /* ... */ )
.catch( /* ... */ );
See all editor options.