Skip to content

Commit 328cd69

Browse files
committed
Fix(DOM): merged fix from Hike-zzz: fixing issue #616 #1174
1 parent c2185a8 commit 328cd69

6 files changed

+21
-4
lines changed

dist/textAngular-rangy.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/textAngular.js

+3
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,9 @@ angular.module('textAngular.DOM', ['textAngular.factories'])
575575
}
576576
}
577577
}
578+
_nodes = _nodes.filter(function(value, index, self) {
579+
return self.indexOf(value) === index;
580+
});
578581
if(angular.element(_nodes[0]).hasClass('ta-bind')){
579582
$target = angular.element(options);
580583
$target[0].innerHTML = _nodes[0].innerHTML;

dist/textAngular.min.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/textAngular.umd.js

+3
Original file line numberDiff line numberDiff line change
@@ -1426,6 +1426,9 @@ angular.module('textAngular.DOM', ['textAngular.factories'])
14261426
}
14271427
}
14281428
}
1429+
_nodes = _nodes.filter(function(value, index, self) {
1430+
return self.indexOf(value) === index;
1431+
});
14291432
if(angular.element(_nodes[0]).hasClass('ta-bind')){
14301433
$target = angular.element(options);
14311434
$target[0].innerHTML = _nodes[0].innerHTML;

src/DOM.js

+3
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ angular.module('textAngular.DOM', ['textAngular.factories'])
175175
}
176176
}
177177
}
178+
_nodes = _nodes.filter(function(value, index, self) {
179+
return self.indexOf(value) === index;
180+
});
178181
if(angular.element(_nodes[0]).hasClass('ta-bind')){
179182
$target = angular.element(options);
180183
$target[0].innerHTML = _nodes[0].innerHTML;

test/taExecCommand/taExecCommand.formatBlock.spec.js

+8
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ describe('taExecCommand', function(){
7777
expect($element.html()).toBe('<blockquote><p>Some <b>test</b> content</p><p><br></p><p>Some <b>test</b> content</p></blockquote>');
7878
$element.remove();
7979
}));
80+
it('selection with multiple nested inline nodes', inject(function($document, taExecCommand, taSelection){
81+
$element = angular.element('<div class="ta-bind"><p><i>Try</i><b>me!</b></p></div>');
82+
$document.find('body').append($element);
83+
taSelection.element = $element.find('p')[0];
84+
taExecCommand()('formatBlock', false, '<BLOCKQUOTE>');
85+
expect($element.html()).toBe('<blockquote><p><i>Try</i><b>me!</b></p></blockquote>');
86+
$element.remove();
87+
}));
8088
});
8189
});
8290
describe('unwraps elements', function(){

0 commit comments

Comments
 (0)