Interface

FullPageConfig (html-support)

@ckeditor/ckeditor5-html-support/src/generalhtmlsupportconfig

interface

The configuration of the Full page editing feature.

Filtering

Properties

  • allowRenderStylesFromHead : boolean | undefined

    Whether the feature should allow the editor to render styles from the <head> section of editor data content.

    When set to true, the editor will render styles from the <head> section of editor data content.

    ClassicEditor
    	.create( {
    		htmlSupport: {
    			fullPage: {
    				allowRenderStylesFromHead: true
    			}
    		}
    	} )
    	.then( ... )
    	.catch( ... );
    

    Defaults to false

  • sanitizeCss : ( string ) => CssSanitizeOutput | undefined

    Callback used to sanitize the CSS provided by the user in editor content when option htmlSupport.fullPage.allowRenderStylesFromHead is set to true.

    We strongly recommend overwriting the default function to avoid XSS vulnerabilities.

    The function receives the CSS (as a string), and should return an object that matches the CssSanitizeOutput interface.

    ClassicEditor
    	.create( editorElement, {
    		htmlSupport: {
    			fullPage: {
    				allowRenderStylesFromHead: true,
    
    				sanitizeCss( CssString ) {
    					const sanitizedCss = sanitize( CssString );
    
    					return {
    						css: sanitizedCss,
    						// true or false depending on whether the sanitizer stripped anything.
    						hasChanged: ...
    					};
    				}
    			}
    		}
    	} )
    	.then( ... )
    	.catch( ... );