Improved editor handling of BBCode <-> HTML