Thanks to some experiments with @ambihelical, we've characterized the particular way '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')

@radehi @ambihelical

Is there going to be a fix for the Markup bugs? I ran into it posting some C++ a few days ago, and freemo acknowledged there was a problem. I even looked at the GIT repository but decided it was beyond me.

Follow

@rmerriam @ambihelical I don't know, I'm going to wait until tomorrow before I ask him again.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.