aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Numerlor <[email protected]>2019-11-10 19:34:28 +0100
committerGravatar Numerlor <[email protected]>2019-11-10 19:34:28 +0100
commit4d5d307f9a499cd874d90e6500f877ce560c012f (patch)
tree495e926e51109994be6f6bb164d414d12fd14f0f
parentMake sure only signatures belonging to the symbol are fetched (diff)
fix signatures and descriptions not being found when present
-rw-r--r--bot/cogs/doc.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/bot/cogs/doc.py b/bot/cogs/doc.py
index dcbcfe3ad..6e50cd27d 100644
--- a/bot/cogs/doc.py
+++ b/bot/cogs/doc.py
@@ -271,19 +271,19 @@ class Doc(commands.Cog):
description_start_index = search_html.find(str(start_tag.parent)) + len(str(start_tag.parent))
description_end_index = search_html.find(str(end_tag))
- description = search_html[description_start_index:description_end_index].replace('¶', '')
+ description = search_html[description_start_index:description_end_index]
signatures = None
else:
- description = str(symbol_heading.find_next_sibling("dd")).replace('¶', '')
+ description = str(symbol_heading.find_next_sibling("dd"))
description_pos = search_html.find(description)
# Get text of up to 3 signatures, remove unwanted symbols
for element in [symbol_heading] + symbol_heading.find_next_siblings("dt", limit=2):
signature = UNWANTED_SIGNATURE_SYMBOLS_RE.sub("", element.text)
- if signature and search_html.find(signature) < description_pos:
+ if signature and search_html.find(str(element)) < description_pos:
signatures.append(signature)
- return signatures, description
+ return signatures, description.replace('¶', '')
@async_cache(arg_offset=1)
async def get_symbol_embed(self, symbol: str) -> Optional[discord.Embed]: