Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on May 5, 2023. It is now read-only.

Commit5c1a695

Browse files
committed
Fixhtml5lib#488: append document-child comments in document order in lxml
1 parente749511 commit5c1a695

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

‎.pytest.expect‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,8 +1297,6 @@ u'html5lib/tests/testdata/tree-construction/tests8.dat::5::cElementTree::parser:
12971297
u'html5lib/tests/testdata/tree-construction/tests8.dat::5::cElementTree::parser::void-namespace': FAIL
12981298
u'html5lib/tests/testdata/tree-construction/tests8.dat::5::lxml::parser::namespaced': FAIL
12991299
u'html5lib/tests/testdata/tree-construction/tests8.dat::5::lxml::parser::void-namespace': FAIL
1300-
u'html5lib/tests/testdata/tree-construction/webkit01.dat::22::lxml::parser::namespaced': FAIL
1301-
u'html5lib/tests/testdata/tree-construction/webkit01.dat::22::lxml::parser::void-namespace': FAIL
13021300
u'html5lib/tests/testdata/tree-construction/webkit02.dat::14::DOM::parser::namespaced': FAIL
13031301
u'html5lib/tests/testdata/tree-construction/webkit02.dat::14::DOM::parser::void-namespace': FAIL
13041302
u'html5lib/tests/testdata/tree-construction/webkit02.dat::14::ElementTree::parser::namespaced': FAIL

‎html5lib/treebuilders/etree_lxml.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ def __init__(self):
4444
self._childNodes= []
4545

4646
defappendChild(self,element):
47-
self._elementTree.getroot().addnext(element._element)
47+
last=self._elementTree.getroot()
48+
forlastinself._elementTree.getroot().itersiblings():
49+
pass
50+
51+
last.addnext(element._element)
4852

4953
def_getChildNodes(self):
5054
returnself._childNodes

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp