The visual editor uses a new parser, Parsoid, which has been implemented separately in node.js (iirc). That may be the answer...
I was already pretty far along with my own parser before Parsoid was usable though. (and my parser has its own DOM / hooks)