Skip to content

Commit

Permalink
Merge pull request #612 from freelawproject/fix-clean-only-brackets-f…
Browse files Browse the repository at this point in the history
…or-embedded-links

fix(bluesky): Refines _clean_text method
  • Loading branch information
mlissner authored Sep 25, 2024
2 parents 411efa1 + 188ba89 commit 6db8208
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bc/channel/utils/connectors/bluesky_api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def _clean_text(sef, text: str) -> str:
str: string containing the original text with all link markup
notations removed.
"""
return re.sub(r"(?<=])\(\S+\)|[\[]|[\]]", "", text)
return re.sub(r"\[([^\[\]]*)\]\((.*?)\)", r"\g<1>", text)

def _parse_text_facets(self, text) -> list[TextAnnotation]:
"""
Expand Down

0 comments on commit 6db8208

Please sign in to comment.