Skip to content

fix: escape markdown special characters in /ls command#9

Open
michaelansel wants to merge 1 commit intoRichardAtCT:mainfrom
michaelansel:fix/ls-markdown-escaping
Open

fix: escape markdown special characters in /ls command#9
michaelansel wants to merge 1 commit intoRichardAtCT:mainfrom
michaelansel:fix/ls-markdown-escaping

Conversation

@michaelansel
Copy link

Filenames containing Telegram markdown special characters (_, *, [, ], etc.) were breaking message rendering with "Can't parse entities" errors.

Changes:

  • Add _escape_markdown() helper function to escape special chars
  • Apply escaping to all filenames in both /ls command and callback handler
  • Ensures filenames display correctly regardless of special characters

Fixes Telegram markdown parsing errors when listing files with special characters in their names.

Filenames containing Telegram markdown special characters (_, *, [, ], etc.)
were breaking message rendering with "Can't parse entities" errors.

Changes:
- Add _escape_markdown() helper function to escape special chars
- Apply escaping to all filenames in both /ls command and callback handler
- Ensures filenames display correctly regardless of special characters

Fixes Telegram markdown parsing errors when listing files with special
characters in their names.
@michaelansel
Copy link
Author

I'm not 100% confident that this one was necessary; it might have been an unnecessary change along the way of fixing something else; I haven't gone back to retest just this specific change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant