html5lib / gcode-import

Automatically exported from code.google.com/p/html5lib. Purely archival.
Other
7 stars 8 forks source link

element.sourceline is None #213

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When using lxml tree builder, source line of elements is not populated.

div_html = "<div>"

parser =  html5lib.HTMLParser(tree=html5lib.getTreeBuilder("lxml"))
root = html5lib.parse(div_html)
div = list(root.iter())[-1] # <div> element
print(div.sourceline) # -> None

div = lxml.html.from_string(div_html)
print(div.sourceline) # -> 1

Original issue reported on code.google.com by mtjahan...@gmail.com on 13 Sep 2012 at 9:38

GoogleCodeExporter commented 9 years ago
Off-hand, I believe there is no API to set sourceline, so we cannot (even if we 
had the data) expose it in such a way.

Original comment by geoffers on 19 Sep 2012 at 3:01

GoogleCodeExporter commented 9 years ago
WontFix, per the above.

Original comment by geoffers on 9 Apr 2013 at 8:48