Comment ignored
pieterhartel opened this issue · comments
pieterhartel commented
The first section of code below returns the empty list, but it should produce an insert action:
from xmldiff import main
print( main.diff_texts( '<html></html>', '<html></html><!--comment-->' ) )
The second section of code below is correct in that it produces [InsertComment(target='/html[1]', position=0, text='comment')]
:
from xmldiff import main
print( main.diff_texts( '<html></html>', '<html><!--comment--></html>' ) )
$ py -m pip list
xmldiff 2.4
Lennart Regebro commented
xmldiff
uses lxml
which returns the root node of the document. Any comments outside that root node will be ignored. I can't see any way of changing that.