Skip to content

Conversation

@rileychh
Copy link
Contributor

This PR correctly escapes markdown characters in link labels to prevent Discord from interpreting formatting characters. This is a fixed version of #69, which was closed accidentally and had a bug where it escaped the entire link string (including URLs and markdown syntax) instead of just the labels.

Changes:

  • Added markdown_link() helper function that escapes only the label text
  • Applied escaping in the render() method at link creation time

Example: A username like @_Mochamoru_ in the author label now displays correctly as plain text instead of rendering with italics due to the underscores.

@rileychh
Copy link
Contributor Author

Discord 2025-10-13 at 15 48 45@2x

Update: Escaping Markdown doesn't work correctly in links in Discord. The same text renders correctly in GitHub. This should not be merged until Discord can correctly render Markdown links.

\_ 
[\_](https://g.co) 
[_italic_](https://g.co) 
[\_escapedItalic_](https://g.co) 
[\_fullyEscapedItalic\_](https://g.co)

_
_
italic
_escapedItalic_
_fullyEscapedItalic_

@rileychh rileychh marked this pull request as draft October 13, 2025 07:55
@Kyrela
Copy link
Owner

Kyrela commented Nov 11, 2025

That's what I thought... I actually had this, but removed it in 5025aa0 as it wasn't working as intended, unfortunately.

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.

3 participants