2

After a while looking around on the web i seems can't find any jQuery wysiwyg editors that support html5 formating. Almost every plugin out there use <font font-size="x">text</font> or <big>text</big>.

Both of those are not supported in HTML5. So i would like to kindly ask if anyone know any wysiwyg editor that uses <style> tag to format things.

I really love CLEditor but again there's that <font> tag formating or maybe someone could edit original code of CLEditor to use <span style="font-size:XXpx"> instead.

EDIT: I would actually go without jQuery one even if there is some lightweight standalone javascript wysiwyg.

Thanks.

arma
  • 4,084
  • 10
  • 48
  • 63

1 Answers1

3

CKEditor allows configuration of its styling functionality. For instance:

config.coreStyles_bold = { element : 'span', attributes : {'style': 'font-weight:bold'} };

With this, you can override the default browser behavior which may use unwanted font tags, as well as semantic tags like strong or frowned-upon (but legal) style tags like b. It also allows similar configuration for custom styles, and any attributes (like class) you choose.

Another approach, if you don't find an editor that has the level of sanitization you'd prefer, would be to be more permissive with the client-side editor, processing the input with a translator/whitelist sanitizer* on the server.

* For example, HTMLPurifier (PHP). I've used this together with CKEditor and I'm quite satisfied.

eyelidlessness
  • 62,413
  • 11
  • 90
  • 94
  • CKEditor look really nice and also it has jquery adapter. Thanks for pointing me to that. If i don't find anything else i'll use this. – arma Nov 18 '10 at 07:23