News for hackers. Stuff that matters.
Re:Aloha Editor - HTML5 WYSIWYG Editor by rjd on Tuesday August 02, 2011 @07:43AM (#2836765)
I built an in page editor like this a few years ago. I took a completely different approach however. I used jQuery to parse the entire page as XML and the used some dom navigation to work out path locations to the node I was on. There are jQuery libraries which will select nodes via xpath queries.

Then with some string functions I managed to break each node down into text runs (just wrapping spans around text blocks) so that I could apply styles to certain segments. Preserved the whole document in valid XHTML.

Just food for thought if you feel like making the editing functions even more granular.

There are no comments on this comment yet.