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/element.py | |
parent | b2294f4f05d9e8583613560986f8aa64b18866b9 (diff) |
Implemented line number tracking for html5lib.
Diffstat (limited to 'bs4/element.py')
-rw-r--r-- | bs4/element.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bs4/element.py b/bs4/element.py index 41acf45..a610008 100644 --- a/bs4/element.py +++ b/bs4/element.py @@ -724,7 +724,7 @@ class Tag(PageElement): def __init__(self, parser=None, builder=None, name=None, namespace=None, prefix=None, attrs=None, parent=None, previous=None, - is_xml=None, lineno=None, offset=None): + is_xml=None, sourceline=None, sourcepos=None): "Basic constructor." if parser is None: @@ -739,9 +739,9 @@ class Tag(PageElement): self.namespace = namespace self.prefix = prefix if ((not builder or builder.store_line_numbers) - and (lineno is not None or offset is not None)): - self.lineno = lineno - self.offset = offset + and (sourceline is not None or sourcepos is not None)): + self.sourceline = sourceline + self.sourcepos = sourcepos if attrs is None: attrs = {} elif attrs: |