(function () {
  'use strict';

  dockerboardApp.registerModule('dockerboard.filters');

  angular.module('dockerboard.filters')
    .filter('sanitize', ['$sce', function ($sce) {
      return function(htmlCode) {
        return htmlCode ? $sce.trustAsHtml(htmlCode + '') : '';
      }
    }])

    .filter('formatImageId', ['limitToFilter', function (limitToFilter) {
      var reg = /[\-_:.]/g;
      function formatImageId(image) {
        if (reg.test(image)) {
          return image;
        }
        return limitToFilter(image, 12);
      }
      return formatImageId;
    }]);

})();
@@ -386,15 +386,46 @@
 /%5B%5C-
-_:.%5D/g;
+%5C:%5C._%5D/;%0A%0A      return formatImageId;%0A
 %0A   
@@ -451,20 +451,17 @@
 mageId(i
-mage
+d
 ) %7B%0A    
@@ -476,18 +476,15 @@
 reg.
-test(image
+exec(id
 )) %7B
@@ -502,20 +502,17 @@
 return i
-mage
+d
 ;%0A      
@@ -545,20 +545,17 @@
 Filter(i
-mage
+d
 , 12);%0A 
@@ -565,36 +565,8 @@
   %7D%0A
-      return formatImageId;%0A
     

fix formatImageId