fixed bug with bookmarks url retrieval

This commit is contained in:
James Ravenscroft 2022-11-06 07:22:54 +00:00
parent 8d3e24f443
commit d48e5c34ef
1 changed files with 4 additions and 2 deletions

View File

@ -46,7 +46,7 @@ class RafaelBookmarkPlugin:
print(r.json())
return self.session.put(f"{self.wiki_url}/api/pages/{self.bookstack_bookmark_id}", json={
"markdown": r.json()['markdown'] + f"\n\n - {update_html}"
"markdown": r.json()['markdown'] + f"\n\n {update_html}"
})
@ -68,7 +68,9 @@ class RafaelBookmarkPlugin:
for ent in update.message.entities:
if ent.type == "url":
url = update.message.text[ent.offset:ent.length]
print(ent)
url = update.message.text[ent.offset:ent.offset+ent.length]
print("Found URL: ", url)
try:
title = self.get_title(url)
link = f"[{title}]({url})"