Skip to content

Commit

Permalink
Address issue with links for Google Sites connector
Browse files Browse the repository at this point in the history
  • Loading branch information
Weves committed Nov 3, 2023
1 parent b0f76b9 commit 329824a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/danswer/connectors/google_site/connector.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import re
import urllib.parse
from typing import Any
from typing import cast
Expand Down Expand Up @@ -29,7 +30,9 @@ def process_link(element: BeautifulSoup | Tag) -> str:
href = urllib.parse.unquote(href)
href = href.rstrip(".html").lower()
href = href.replace("_", "")
href = href.replace(" ", "-")
href = re.sub(
r"([\s-]+)", "-", href
) # replace all whitespace/'-' groups with a single '-'

return href

Expand Down

1 comment on commit 329824a

@vercel
Copy link

@vercel vercel bot commented on 329824a Nov 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.