50
submitted 2 years ago* (last edited 2 years ago) by AlmightySnoo@lemmy.world to c/lemmy@lemmy.ml

Right now Lemmy is unusable for writing code that contains less than/greater than signs because Lemmy's sanitizer treats that as potentially malicious HTML code.

Here's an example:

if(x < y)
{
/* ... */
}

The listing becomes littered with < gibberish.

top 7 comments
sorted by: hot top controversial new old
[-] ticoombs@reddthat.com 24 points 2 years ago

Don't forget & in community names and sidebars.

Constantly getting trolled by &

[-] TheYear2525@lemmy.world 22 points 2 years ago* (last edited 2 years ago)

What’re you talking about?

[-] Amir@lemmy.ml 17 points 2 years ago

It actually looks perfectly fine on Sync for Lemmy so I assume this is only a front-end problem. There are alternative front-ends that you could try.

[-] jmcs@discuss.tchncs.de 8 points 2 years ago

This is what it looks in the web UI: Screenshot showing the bracket turns to ampersand lt

[-] NinjaFox 11 points 2 years ago

This is how it looks on Sync, seems like he's a front end issue.

[-] Crul@lemm.ee 6 points 2 years ago* (last edited 2 years ago)

There are alternative front-ends that you could try.

The 3 frontends for browser / PC that I know (default, mlmym and alexandrite) have this problem. Do you know of any other one that works?

Thanks!

[-] mark@programming.dev 6 points 2 years ago* (last edited 2 years ago)

Yeah I think this was hastily done to prevent the XSS injection attacks that were happening IIRC. They implemented encoding for content, but looks like they never got around to fully decoding it.

Issue could've been avoided by just restricting the encoding to when the user types content in (and before database insertion), and decoding when showing the content in the UI.

this post was submitted on 28 Aug 2023
50 points (100.0% liked)

Lemmy

13045 readers
1 users here now

Everything about Lemmy; bugs, gripes, praises, and advocacy.

For discussion about the lemmy.ml instance, go to !meta@lemmy.ml.

founded 5 years ago
MODERATORS