GHSFullPageConfig
interface
The configuration of the Full page editing feature.
Properties
-
allowRenderStylesFromHead : boolean | undefined
module:html-support/generalhtmlsupportconfig~GHSFullPageConfig#allowRenderStylesFromHead
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 : ( css: string ) => GHSCssSanitizeOutput | undefined
module:html-support/generalhtmlsupportconfig~GHSFullPageConfig#sanitizeCss
Callback used to sanitize the CSS provided by the user in editor content when option
htmlSupport.fullPage.allowRenderStylesFromHead
is set totrue
.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
GHSCssSanitizeOutput
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( ... );