~facelessuser/beautifulsoup/lxml-fix

« back to all changes in this revision

Viewing changes to bs4/builder/_lxml.py

  • Committer: Leonard Richardson
  • Date: 2019-07-21 19:50:49 UTC
  • Revision ID: leonardr@segfault.org-20190721195049-vzupkzxai3bx3r8t
Implemented line number tracking for html5lib.

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
 
58
58
    DEFAULT_NSMAPS_INVERTED = _invert(DEFAULT_NSMAPS)
59
59
 
 
60
    # NOTE: If we parsed Element objects and looked at .sourceline,
 
61
    # we'd be able to see the line numbers from the original document.
 
62
    # But instead we build an XMLParser or HTMLParser object to serve
 
63
    # as the target of parse messages, and those messages don't include
 
64
    # line numbers.
 
65
    
60
66
    def initialize_soup(self, soup):
61
67
        """Let the BeautifulSoup object know about the standard namespace
62
68
        mapping.