diff options
author | Leonard Richardson <leonardr@segfault.org> | 2019-07-21 15:50:49 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2019-07-21 15:50:49 -0400 |
commit | 41c2b7c056e73c63c872eeb0a5e3a1f65473eaf0 (patch) | |
tree | 514f0a3ccd449c74d847917471ec6c09642e1318 /bs4/builder/_lxml.py | |
parent | b2294f4f05d9e8583613560986f8aa64b18866b9 (diff) |
Implemented line number tracking for html5lib.
Diffstat (limited to 'bs4/builder/_lxml.py')
-rw-r--r-- | bs4/builder/_lxml.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bs4/builder/_lxml.py b/bs4/builder/_lxml.py index 27cadcb..85be1b5 100644 --- a/bs4/builder/_lxml.py +++ b/bs4/builder/_lxml.py @@ -57,6 +57,12 @@ class LXMLTreeBuilderForXML(TreeBuilder): DEFAULT_NSMAPS_INVERTED = _invert(DEFAULT_NSMAPS) + # NOTE: If we parsed Element objects and looked at .sourceline, + # we'd be able to see the line numbers from the original document. + # But instead we build an XMLParser or HTMLParser object to serve + # as the target of parse messages, and those messages don't include + # line numbers. + def initialize_soup(self, soup): """Let the BeautifulSoup object know about the standard namespace mapping. |