Comment on Bird
SomethingBurger@jlai.lu 1 week agoURLs inside code fragments should not be clickable. This is a Markdown parsing error.
PieFed L
Comment on Bird
SomethingBurger@jlai.lu 1 week agoURLs inside code fragments should not be clickable. This is a Markdown parsing error.
PieFed L
StrixUralensis@tarte.nuage-libre.fr 1 week ago
Why shouldn't they be ?
markz@suppo.fi 1 week ago
Code blocks are for displaying raw text, ignoring all formatting.
mic_check_one_two@lemmy.dbzer0.com 1 week ago
Because it’s meant to be a block of code, not something that the user is able to interact with. The point of code blocks is that you can use special characters and have them rendered as plaintext, instead of actually working as special characters. For instance, here’s the classic Reddit shrug:
¯_(ツ)_/¯
Notice that the left arm is missing? That’s because the backslash and underscores are both special characters. The backslash cancels out the underscore, making the backslash disappear. Now here’s the same shrug formatted as code:
¯\_(ツ)_/¯
Notice that the left arm is visible, (or at least, it should be), because none of the characters were treated as special characters. If the left arm is invisible on your client, that is actually an error in parsing the MarkDown formatting.
cypherpunks@lemmy.ml 1 week ago
compare the rendering of the test output (which i also wrapped in backticks to tell the markdown rendering to render it as code) on lemmy vs on piefed.
Essentially, it is not possible to reliably identify the URLs in code (in a language that is not known to either PyFedi or its markdown parser), because they be adjacent to URL-valid characters which actually terminate the URL in whatever syntax is being used inside the code block. So, even though it is sometimes harmless to auto-linkify inside a code block, it is also often wrong and therefore should not be (and generally is not) done.
StrixUralensis@tarte.nuage-libre.fr 1 week ago
Oh ok, I see
Thank you for explaining !
cypherpunks@lemmy.ml 1 week ago
hmm, i see my first edit to this comment got federated to piefed but subsequent edits did not; the version after subsequent edits can be seen here on the lemmy instance i’m posting from