aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/cogs/doc.py6
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: