JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://ckeditor.com/apps/ckeditor/4.3.1/ckeditor.js"></script>
<body>
<table>
<tr><td width="200px">IMG-Tag- Test:</td><td id="img"></td></tr>
<tr><td>"FullRule-Test:</td><td id="imgfull"></td></tr>
</table>
</body>
CSS
#template {
display: none;
}
JavaScript
"use strict";
$(document).ready(function(){
var fullRule = 'img[!src,class](!a,b,c)';
var f = new CKEDITOR.filter(fullRule);
// just the image tag = works
$('#img').html(
toStr(f.check("img"))
);
// now the rule we actually used to create the rule
$('#imgfull').html(
toStr(f.check(fullRule))
);
});
// helper
function toStr(bool) {
if(bool) {
return "true";
}
else {
return "false"
}
}