Handle inline and block elements