fix: escape markdown in link labels only
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.
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)
That's what I thought... I actually had this, but removed it in 5025aa093725da1d8943df6e64e819f9ebc7e197 as it wasn't working as intended, unfortunately.