WYSIWIG JavaScript HTML editor with API and advanced text processing support (like word detection)
===

I\`m looking for WYSYWIG JavaScript HTML editor for my app. I\`ve already tried some of them, for example from this list: http://www.queness.com/post/212/10-jquery-and-non-jquery-javascript-rich-text-editors but some are too complex and some are missing basic features...

Requirements:

 - It should work with newest stable release of: Mozilla Firefox, Google Chrome, Opera, Internet Explorer (and also Apple Safari support would be nice).

 - It should have basic features like bold, italic, color change, headers, paragraphs, no-formatting, aligns - those are basic options that browser may handle (it is how it`s done in most WYSIWIG editors).

 - I don`t need any UI - so if it comes with UI - I should be able to easily remove it.

 - Instead of UI I need complex API where I can for example extract selected/full text/HTML, insert text/HTML, replace text/HTML.

 - I need advanced text processing support - this is what I\`m looking for and cannot find anywhere - **I need to detect what word is under cursor**. For example we have "This is sample text" and User clicks on "sample" - I need to know it\`s position, text and HTML.  
I found something like this: http://stackoverflow.com/questions/8131830/javascript-rich-text-editor-with-get-and-set-cursor-position-support - but it\`s not full answer for this problem.

 - It would be great if it`s easy to embed (not to much files), lightweight and fast.

 - It should be licensed by opensource/GPL/or some other open/free license.

If I miss any info - please let me know and I\`ll update them.

Maybe some of You know some nice libraries? Or maybe there are other nice solutions to achieve my goals?

Thanks in advance,  
Jakub K.