Sanitize message text content only if the type of current message in the ng-repeat loop is "text"

In case of image message, the body can be a JSON object (ImageInfo) and ngSanitize does not like that (ie it generates exception in the console)
paul/schema_breaking_changes
Emmanuel ROHEE 2014-08-20 15:41:14 +02:00
parent e8244c23ba
commit da2f5aac0e
1 changed files with 2 additions and 2 deletions

View File

@ -40,8 +40,8 @@
<td ng-class="!msg.content.membership_target ? (msg.content.msgtype === 'm.emote' ? 'emote text' : 'text') : 'membership text'"> <td ng-class="!msg.content.membership_target ? (msg.content.msgtype === 'm.emote' ? 'emote text' : 'text') : 'membership text'">
<div class="bubble"> <div class="bubble">
<span ng-hide='msg.content.msgtype !== "m.emote"' ng-bind-html="'* ' + (members[msg.user_id].displayname || msg.user_id) + ' ' + msg.content.body | linky:'_blank'"/> <span ng-hide='msg.content.msgtype !== "m.emote"' ng-bind-html="'* ' + (members[msg.user_id].displayname || msg.user_id) + ' ' + msg.content.body | linky:'_blank'"/>
<span ng-hide='msg.content.msgtype !== "m.text"' ng-bind-html="msg.content.body | linky:'_blank'"/> <span ng-hide='msg.content.msgtype !== "m.text"' ng-bind-html="((msg.content.msgtype === 'm.text') ? msg.content.body : '') | linky:'_blank'"/>
<img class="image" ng-hide='msg.content.msgtype !== "m.image"' ng-src="{{ msg.content.url }}" alt="{{ msg.content.body }}"/> <img class="image" ng-hide='msg.content.msgtype !== "m.image"' ng-src="{{ msg.content.url }}"/>
</div> </div>
</td> </td>
<td class="rightBlock"> <td class="rightBlock">