You can decorate the $sanitize service to avoid changing the source files. Here's an example that just logs what happens inside $sanitize. You can do what you need to filter unwanted elements.
var app = angular.module("app", ["ngSanitize"]);
app.config(function($provide){
$provide.decorator("$sanitize", function($delegate, $log){
return function(text, target){
var result = $delegate(text, target);
$log.info("$sanitize input: " + text);
$log.info("$sanitize output: " + result);
return result;
};
});
});
Note that inside of the decorator, $delegate refers to the $santize. You'll filter what you want out of the input before calling $delegate(text, target) then return the result.