Skip to content

Commit

Permalink
improve is_in_table_cell check
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyInnowhere authored and CodyInnowhere committed Dec 18, 2024
1 parent 2731eb7 commit 37607b7
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions trafilatura/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,11 +464,4 @@ def copy_attributes(dest_elem: _Element, src_elem: _Element) -> None:

def is_in_table_cell(elem: _Element) -> bool:
'''Check whether an element is in a table cell'''
while elem is not None:
if elem.tag == 'cell':
return True
parent = elem.getparent()
if parent is None:
break
elem = parent
return False
return elem.xpath('//ancestor::cell')

0 comments on commit 37607b7

Please sign in to comment.