justarandomgeek / vscode-factoriomod-debug

Factorio Mod Tool Kit
Other
121 stars 26 forks source link

Some URLs in MD are getting mangled when I publish. #147

Open kryojenik opened 1 month ago

kryojenik commented 1 month ago

I have the following line in my README.MD:

[![shield](https://img.shields.io/badge/Ko--fi-Donate%20-hotpink?logo=kofi&logoColor=white)](https://ko-fi.com/M4M2LCWTH) [![shield](https://img.shields.io/badge/dynamic/json?color=orange&label=Factorio&query=downloads_count&suffix=%20downloads&url=https%3A%2F%2Fmods.factorio.com%2Fapi%2Fmods%2Floaders-modernized)](https://mods.factorio.com/mod/loaders-modernized)

That gets some characters escaped to this when I publish. [![shield](https://img.shields.io/badge/Ko--fi-Donate%20-hotpink?logo=kofi\&logoColor=white)](https://ko-fi.com/M4M2LCWTH) [![shield](https://img.shields.io/badge/dynamic/json?color=orange\&label=Factorio\&query=downloads_count\&suffix=%20downloads\&url=https%3A%2F%2Fmods.factorio.com%2Fapi%2Fmods%2Floaders-modernized)](https://mods.factorio.com/mod/loaders-modernized)

I have to manually remove the '\' from the links for them to display properly. Both of them seem to render here correctly, but the bottom one does not on the mod portal.

justarandomgeek commented 3 weeks ago

i've investigated this some and it does not seem to be any of the specific processing i'm doing that does this, but rather simply the act of passing it through remark. I've not yet pinned down exactly how or why they mangle links in this way or what to do about it though.

justarandomgeek commented 3 weeks ago

okay so apparently the deal is: escaped characters in the URL are apparently correct under CommonMark spec (and remark has closed it as not-a-bug previously, and it may actually be a mod portal bug that they're not handled correctly

https://babelmark.github.io/?text=%5B!%5Bshield%5D(https%3A%2F%2Fimg.shields.io%2Fbadge%2FKo--fi-Donate%2520-hotpink%3Flogo%3Dkofi%5C%26logoColor%3Dwhite)%5D(https%3A%2F%2Fko-fi.com%2FM4M2LCWTH)+%5B!%5Bshield%5D(https%3A%2F%2Fimg.shields.io%2Fbadge%2Fdynamic%2Fjson%3Fcolor%3Dorange%5C%26label%3DFactorio%5C%26query%3Ddownloads_count%5C%26suffix%3D%2520downloads%5C%26url%3Dhttps%253A%252F%252Fmods.factorio.com%252Fapi%252Fmods%252Floaders-modernized)%5D(https%3A%2F%2Fmods.factorio.com%2Fmod%2Floaders-modernized) shows almost all implementations handle this correctly - but not python-markdown, which i believe is what the portal uses

kryojenik commented 3 weeks ago

Then does that mean a bug needs to be filed against the mod portal?