Skip to content

Commit

Permalink
[html] show table's sibling h1-h6 tags
Browse files Browse the repository at this point in the history
  • Loading branch information
midichef committed Dec 7, 2023
1 parent 38e2e40 commit 221c70f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions visidata/loaders/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class HtmlTablesSheet(IndexSheet):
Column('aria_label', getter=lambda col,row: row.html.attrib.get('aria-label')),
Column('caption', getter=lambda col,row: row.html.xpath('normalize-space(./caption)') if row.html.xpath('./caption') else None, cache=True),
Column('summary', getter=lambda col,row: row.html.attrib.get('summary')),
Column('heading', getter=lambda col,row: row.html.xpath('normalize-space(./preceding-sibling::*[self::h1 or self::h2 or self::h3 or self::h4 or self::h5 or self::h6][1])') or None, cache=True),
]
def iterload(self):
lxml = vd.importExternal('lxml')
Expand Down

0 comments on commit 221c70f

Please sign in to comment.