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?
@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.
@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!
@radehi @pwinn @ambihelical @freemo it's not visible to me from my instance, but I clicked the menu and opened up the original and saw it, so totally understrood.
Vanilla mastodon cant see markdown, it shows as plain text.. some servers do have it enabled though.
@mmasnick @ambihelical @freemo I see, thanks! So @pwinn was totally right, which explains a lot.
@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.