HTML embed feature


This test has changed the CSP definitions:

<meta http-equiv="Content-Security-Policy" content="
    default-src 'none';
    media-src 'self';
    connect-src 'self' https://cksource.com http://*.cke-cs.com;
    script-src 'self' https://cksource.com;
    img-src * data:;
    style-src 'self' 'unsafe-inline';
    frame-src *"
>

After the editor initialization, it should contain 8 widgets with embedded HTML:

By default, the "previews in view" mode is enabled. It means that previews should be visible.

We use the sanitize-html package to clean up the input HTML. It means that some of the elements or attributes may be not rendered in the editing view. However, they still will be returned in the editor's data.

You can disable the preview mode and have the textarea element that will be blocked or enabled (depends on feature state).

For toggling the state (edit source / see preview), click the icon in the right-top corner.


If the HTML snippet is selected none of the commands for inserting an object should be enabled (media, html-embed, table).

Value of the "htmlEmbed.showPreviews":

Language direction:

<video> tag as HTML snippet

<audio> tag as HTML snippet

<picture> tag as HTML snippet

<iframe> tag as HTML snippet

<table> tag as HTML snippet (code coverage report)

File Statements Branches Functions Lines
htmlembed.js
100% 2/2 100% 0/0 100% 2/2 100% 2/2
htmlembedediting.js
100% 81/81 100% 18/18 100% 19/19 100% 81/81
htmlembedcommand.js
100% 18/18 100% 8/8 100% 7/7 100% 18/18
htmlembedui.js
100% 15/15 100% 0/0 100% 3/3 100% 15/15

HTML comments in HTML snippet

fooo

Not previewable content in HTML snippet

Empty HTML snippet