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.

  • ඞmir@lemmy.ml
    link
    fedilink
    English
    arrow-up
    4
    ·
    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.

  • mark@programming.dev
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    2 years ago

    Yeah I think this was hastily done to prevent the XSS injection attacks that were happening IIRC. But it was implemented a little sloppily, imo.

    This could have 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.

  • Tiff@reddthat.com
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 years ago

    Don’t forget & in community names and sidebars.

    Constantly getting trolled by &