Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_handleAllFontFamilyValues( conversion ) {
const fontFamilyOptions = normalizeOptions( this.editor.config.get( 'fontFamily.options' ) );
// Add special catch-all converter for font-family feature.
// The font-family feature expects that multi-word font family names are defined in CSS as: 'Font Family Name'.
// Also the number of font names and their order is important, so below are different font-names:
//
// 1. 'Lucida Sans Unicode', Lucida Grande, sans-serif // This CSS is generated by the editor.
// 2. 'Lucida Sans Unicode', sans-serif // fewer font names.
// 3. "Lucida Sans Unicode", Lucida Grande, sans-serif // Different quotes.
// 4. 'Lucida Sans Unicode', sans-serif, Lucida Grande // Different order.
//
// This is due to the fact that by default CKEditor 5 expects font names to be defined the editor.
// The below converter extends this behavior and tries to match font name from input HTML to
// the font family names defined in the configuration.
conversion.for( 'upcast' ).elementToAttribute( {
view: {
name: 'span',