Skip to content

Commit

Permalink
fix: Node.appendChildren
Browse files Browse the repository at this point in the history
  • Loading branch information
alextekartik committed Feb 24, 2025
1 parent aef1fe1 commit 7bb8283
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/html.dart
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ extension TekartikHtmlNodeExt on Node {

/// Trim inner nodes
List<Node> appendChildren(List<Node> children) {
for (var element in children) {
for (var element in List.of(children)) {
appendChild(element);
}
return children;
Expand Down
4 changes: 4 additions & 0 deletions test/node_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ void nodeTestGroup(final HtmlProvider html) {

expect(() => element.removeChild(textNode), throwsA(isA<StateError>()));
});
test('appendChildren', () {
var element = html.createElementTag('div');
element.appendNodesHtml('<p>t1<p><p>t2<p>');
});
test('child replace', () {
var element = html.createElementTag('div');
var textNode = html.createTextNode('hello');
Expand Down

0 comments on commit 7bb8283

Please sign in to comment.