Skip to content

Commit

Permalink
Merge pull request mailhog#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 authored Apr 16, 2017
2 parents b803e47 + 996f8e6 commit 82586dc
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 82586dc

Please sign in to comment.