Add compatibility with ng-maxlength and sanitize markup resulting from pasting