Interface

CaseChangeTitleCaseConfig (case-change)

@ckeditor/ckeditor5-case-change/src/casechange

interface

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.

Filtering

Properties

  • excludeWords : Array<string> | ExcludeWordsCallback | undefined

    Words which should not be capitalized.