A bug was reported in Discourse’s Oneboxing URLs with two dashes. danekhollas found that URLs containing -- would be converted incorrectly. A workaround was suggested by sam using <https://cs--preview.khanacademy.org>. However, this method prevents oneboxing.
codinghorror questioned the necessity of having two dashes in the URL, but danekhollas argued that Discourse should handle valid URLs correctly.
After discussing possible solutions, including using HTML entity escaping or adding a space in front of the URL to prevent oneboxing, Vitaly reported that the issue was solved in the linkifier and auto-propagated to markdown-it after a dependencies upgrade. A test URL http://cs--preview.khanacademy.org now works correctly, and the issue can be marked as solved.
Ok, here’s a weird bug. When an URL contains --, the markdown converts it do –
For example, this URL: cs--preview.khanacademy.org
If I explicitly insert a link, it works, even though it is rendered incorectly: [https://cs--preview.khanacademy.org](https://cs--preview.khanacademy.org) https://cs–preview.khanacademy.org
PS: Hm, linkifying seems to be disabled here on meta, but hopefully the second example makes things clear.
<> though is already the escape hatch from inline onebox so this would give it double meaning, it is edge case on top of edge case. Tricky problem, not sure there is trivial solution here. prettify though should ideally apply after linkify not before it, we can fix that.
I guess… the escape from one boxing is also to add a space in front of the URL. I have run into other cases like this on BBS so it is a real problem. I had to use HTML entity escaping to get around it which is even worse.
Sorry, I mean for example: https://unsplash.com/collections/411759/awesome-pictures will become https://unsplash.com/collections/411759/awesome-pictures so the escape hatch is: <https://unsplash.com/collections/411759/awesome-pictures> if you need it or a raw link without inline onebox.
So that means we turn <> into
opt-in to onebox by force
opt-out of inline onebox by force
It kind of has a double meaning, since it is mega ninja territory I guess we can live with it.
I am ok to make this change I guess.
This also raises the question of how do we “force opt-in” an inline onebox which I guess mean punycode url for now.