On Thu, Apr 7, 2011 at 6:03 PM, Boris Zbarsky <[email protected]> wrote: >> So browsers must be special-casing how execCommand() affects >> selections somehow > > That's certainly what Gecko is doing, yes.
Thanks for the info. In the end, I managed to define a reasonably clean way of getting good enough results: http://aryeh.name/gitweb.cgi?p=editcommands;a=blob_plain;f=editcommands.html;hb=d2481d02#preserving-ranges There are some cases where its behavior is slightly unexpected, in terms of putting the ends of the selection inside vs. outside elements, but it's good enough for now.
