Search code examples
javascripthtmlapiwysiwygtext-processing

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 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. I mean I don`t need any buttons, color pickers, image insert dialogs etc. - I will build my-own menus

  • 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: 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


Solution

  • Not a WYSIWYG editor as such, but my Rangy library may help you build a simple editor. In particular, the new TextRange module provides methods that work with words.