Thanks to some experiments with @ambihelical, we've characterized the particular way #Qoto's Markdown support is broken with respect to code blocks.
Its Markdown mode is exactly backwards with respect to newlines: are ignored inside code blocks, but inside normal paragraphs newlines are treated as `<br>`. But another bug in Markdown support partly cancels this out if the code block is at the beginning of the post, because then, treats the code block as a normal paragraph.
This suggests a straightforward, if inconvenient, workaround: instead of using a code block, use a normal paragraph, but wrap each line within the paragraph in `` ` ``. Unfortunately, due to a third bug in Markdown support, this doesn't actually work; the first line is fine, but the typewriter text on subsequent lines incorrectly fails to be recognized:
`def main():`
` print('hello')`
` print('world')`
A fourth bug means that newlines after the first one are ignored, perhaps because are incorrectly parsed as being part of another code block; I think in a case like this you don't have that problem:
def main():
print('hello')
print('world')
@ambihelical @radehi @freemo This is some great spelunking! I would love to have a working solution for code blocks, even knowing posts lose their markdown once they leave Qoto.
@pwinn @ambihelical @freemo Don't lose their #Markdown once they leave #Qoto! Is not like the (also broken) #Mathjax support. People on other instances can see them. I don't yet know how this works. The other instances have Markdown that's broken in exactly the same way? The JSON-LD contains the incorrectly rendered HTML and the other instances check it against a whitelist of allowed HTML tags?
There is a list of open Qoto bugs so people can find this information after today?
@ambihelical @radehi @freemo My understanding is that mastodon itself does not support markdown in any way, shape or form, and in fact removes what it identifies as potential markdown deliberately. The creator of mastodon is not a fan.
Qoto has added markdown support that can only be seen on qoto.org, but once posts are federated out, the formatting is literally stripped from what I’ve seen.
@pwinn @ambihelical @freemo hmm, the fact that @mmasnick boosted and faved my post earlier today about #Markdown in https://qoto.org/@radehi/109384717356546713 led me to believe that he could see the formatting on mastodon.social (administered by Gargron himself), but technically he didn't actually *say* that.
The formatting is visible to you, Mike? Help us out here.
Vanilla mastodon cant see markdown, it shows as plain text.. some servers do have it enabled though.
@freemo Thank you for explaining! Which source file do I need to look at to understand why it's totally broken even within #Qoto?