Skip to content

Commit

Permalink
Merge pull request #24 from kieran/patch-1
Browse files Browse the repository at this point in the history
replace all occurrences of the same CID reference
  • Loading branch information
ian-kent committed Apr 16, 2017
2 parents 84f2493 + d245cfb commit 8d31ba0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion assets/js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,9 @@ mailhogApp.controller('MailCtrl', function ($scope, $http, $sce, $timeout) {

h = $scope.getMessageHTML(data)
for(c in data.$cidMap) {
h = h.replace("cid:" + c, data.$cidMap[c])
str = "cid:" + c;
pat = str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
h = h.replace(new RegExp(pat, 'g'), data.$cidMap[c])
}
data.previewHTML = $sce.trustAsHtml(h);
$scope.preview = data;
Expand Down

0 comments on commit 8d31ba0

Please sign in to comment.