Open doc-sheet opened 2 weeks ago
Hi @doc-sheet, thanks for filing this issue. This one is interesting.
So when the user posts https://github.com/mattermost/mattermost-data-warehouse/blob/5a88112086f5aefc88ca60ebbbc3668a4ee35ffb/utils/geolite/__main__.py#L10
, we create a post with a link like:
[mattermost/mattermost-data-warehouse/utils/geolite/__main__.py](https://github.com/mattermost/mattermost-data-warehouse/blob/5a88112086f5aefc88ca60ebbbc3668a4ee35ffb/utils/geolite/__main__.py#L10)
, with the underscores being treated as bold instead of preserving them:
@hmhealey What are your thoughts on this? When creating a markdown link with custom text, some characters can be unintentionally treated as markdown formatting, when they are meant to be kept in tact (such as __main__.py
). If I put backslashes in the link, the markdown is correctly ignored, so the plugin could do this for underscores:
[mattermost/mattermost-data-warehouse/utils/geolite/\_\_main\_\_.py](https://github.com/mattermost/mattermost-data-warehouse/blob/5a88112086f5aefc88ca60ebbbc3668a4ee35ffb/utils/geolite/__main__.py#L10)
rendered as this without the bold markdown:
mattermost/mattermost-data-warehouse/utils/geolite/__main__.py
So the solution could just be to have the plugin prepend underscores in the URL with backslashes
Yeah, that makes sense to me. You'd just be escaping the special characters which seems like a decent fix to me
Hi.
I have no idea how to show an example so I'll try to describe it.
When you paste a link to a file with dunders in it's name like
https://github.com/mattermost/mattermost-data-warehouse/blob/5a88112086f5aefc88ca60ebbbc3668a4ee35ffb/utils/geolite/__main__.py#L10
Link above code preview in chat treats
__main__
as markdownLike this: