File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22
33angular . module ( 'diff' , [ ] )
4- . filter ( 'diff' , function ( ) {
4+ . filter ( 'diff' , function ( $sce ) {
55
66 /*
77 * Javascript Diff Algorithm
@@ -173,6 +173,6 @@ angular.module('diff', [])
173173
174174 // Actual filter
175175 return function ( input , match ) {
176- return diffString ( input , match ) ;
176+ return $sce . trustAsHtml ( diffString ( input , match ) ) ;
177177 } ;
178178} ) ;
Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ describe('filter', function() {
99 it ( 'should convert a string to the diff value with another string' , inject ( function ( diffFilter ) {
1010 expect ( diffFilter (
1111 'The red brown fox jumped over the rolling log.' ,
12- 'The brown spotted fox leaped over the rolling log' ) ) . toBe (
12+ 'The brown spotted fox leaped over the rolling log' )
13+ . $$unwrapTrustedValue ( ) ) . toBe (
1314 ' The <del>red </del> brown <ins>spotted </ins> fox <del>jumped </del><ins>leaped </ins> over the rolling <del>log.\n</del><ins>log\n</ins>' ) ;
1415 } ) ) ;
1516 } ) ;
You can’t perform that action at this time.
0 commit comments