Skip to content

Commit

Permalink
fixed format spitting out %XXX for characters that got formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
Deutscher775 committed Nov 17, 2024
1 parent 2942fde commit abc3929
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ async def post_endpoint(
message_reply_message=message_reply_message,
message_reply_author=message_reply_author,
message_author_id=message_author_id,
message_content=message_content,
message_content=astroidapi.formatter.Format.unformat_urlsafe(message_content),
message_attachments=message_attachments,
message_embed=message_embed,
selfuse=selfuse,
Expand Down
4 changes: 4 additions & 0 deletions src/astroidapi/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ def format_username(cls, username: str):
@classmethod
def format_urlsafe(cls, message: str):
message = message.replace("?", "%3F").replace("&", "%26")

@classmethod
def unformat_urlsafe(cls, message: str):
message = message.replace("%3F", "?").replace("%26", "&")

0 comments on commit abc3929

Please sign in to comment.