glitch-soc / mastodon

A glitchy but lovable microblogging server
https://glitch-soc.github.io/docs/
GNU Affero General Public License v3.0
696 stars 181 forks source link

Markdown links works inline, but broken in the bottom of the post #2003

Open lokedhs opened 1 year ago

lokedhs commented 1 year ago

Steps to reproduce the problem

This could be an upstream bug, but since the link is created using markdown syntax, I suspect it may be Glitch-related.

I have added a link with a description using the markdown syntax where the link itself contains a lot of special characters. In particular, the use of a + in the link seems to be what is causing the problem.

In the resulting post, the link in the text itself works, but the same link at the bottom of the post is incorrect.

This problem can be seen in this post: https://functional.cafe/@loke/109487995368380662

To reproduce, click on the link and then "Send" to evaluate the text. This should evaluate the code and display the result on the screen. If you instead use the link at the bottom (the box containing "KAP Client") and then do the same thing, the interpreter will give an error message about an illegal character.

Now, the details about the KAP interpreter itself are not important. What is clearly a bug is that the two links should be the same. The fact that they are different suggests that there is a problem on the Mastodon side.

Expected behaviour

Both links should result in the same beahviour

Actual behaviour

The two links are different

Detailed description

No response

Specifications

v4.0.2+glitch

Plastikmensch commented 1 year ago

This is indeed an upstream bug. Seems like something goes wrong when saving the url to the database. Link posted: https://kapdemo.dhsdevelopments.com/clientweb2/#(io%3Aprintln%E2%8D%A41)%20%22%20*%22%20%E2%8A%87%E2%8D%A8%20m%20%E2%8D%AA%20(4%209%204%E2%AB%BD0%201%200)%20%E2%8D%AA%20%E2%8A%96m%20%E2%86%90%20n%20%2C%20(%E2%8D%AA4%204%E2%AB%BD0%201)%20%2C%E2%8C%BDn%E2%86%90(e%2Cq)%E2%8D%AA(%E2%8D%89q%E2%86%90%E2%8A%831%E2%8D%B4%E2%8D%A8%C2%A81%2B%E2%8D%B34)%2C%7Ee%E2%86%904%204%E2%8D%B40

Link in preview card/database: https://kapdemo.dhsdevelopments.com/clientweb2/#(io:println%E2%8D%A41)%20%22%20*%22%20%E2%8A%87%E2%8D%A8%20m%20%E2%8D%AA%20(4%209%204%E2%AB%BD0%201%200)%20%E2%8D%AA%20%E2%8A%96m%20%E2%86%90%20n%20,%20(%E2%8D%AA4%204%E2%AB%BD0%201)%20,%E2%8C%BDn%E2%86%90(e,q)%E2%8D%AA(%E2%8D%89q%E2%86%90%E2%8A%831%E2%8D%B4%E2%8D%A8%20%CC%881+%E2%8D%B34),~e%E2%86%904%204%E2%8D%B40

They are indeed different. The second one isn't encoded properly.