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.
@radehi @pwinn @ambihelical @mmasnick so some instances have markdown and others are waiting for the main repo to implement it. There are some browser extensions that auto-render markdown. Plus most who write in markdown don't mind reading the markdown either.
If you have some programming knowledge, you could create a pull request to fix this bug. Though @freemo has mentioned that there are some fixes lined up for production.
@barefootstache @pwinn the particular thing I'm puzzled about right now is whether #Markdown has to be implemented on the *reader's* instance or only the *sender's* instance. Since Gargron administers mastodon.social, he presumably wouldn't implement it if he thinks is bad, and probably once he does implement it, will be in the main repo. So I'm hoping that Mike answers my question about whether the post he boosted displayed with different typefaces for him.
Really though I need to learn basic things about ActivityPub first. Several steps away from a pull request!