handle more terminal cases (though not really)
inject enclosing divs in case there are none and to enable inline iframe