Improved escaping for widgets