diff options
| author | 2020-06-21 01:45:54 +0200 | |
|---|---|---|
| committer | 2020-06-21 01:45:54 +0200 | |
| commit | e11c5a35f8f494f13323d53c0c514524902b2ae7 (patch) | |
| tree | add2b3144873e23c353f8bad3730a95236ab89e5 | |
| parent | Account for `NavigableString`s when gathering text. (diff) | |
Also check signatures before selected symbol when collecting 3 signatures.
| -rw-r--r-- | bot/cogs/doc.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bot/cogs/doc.py b/bot/cogs/doc.py index d64e6692f..b0adc52ba 100644 --- a/bot/cogs/doc.py +++ b/bot/cogs/doc.py @@ -363,7 +363,11 @@ class Doc(commands.Cog): description_pos = html.find(str(description_element)) description = "".join(cls.find_all_text_until_tag(description_element, ("dt",))) - for element in [heading] + heading.find_next_siblings("dt", limit=2): + for element in ( + *reversed(heading.find_previous_siblings("dt", limit=2)), + heading, + *heading.find_next_siblings("dt", limit=2), + )[-3:]: signature = UNWANTED_SIGNATURE_SYMBOLS_RE.sub("", element.text) if signature and html.find(str(element)) < description_pos: |