Discourse started to behave strangely when formatted code contains:
- empty line
- line indented with four or more spaces (not necessarily followed by other characters)
- The then following line looses its indentation (in the example, the return statements all are preceded by four spaces).
Normally characters within code markup (```) should not be parsed as markdown or otherwise touched.
Test:
def test
if __FILE__ =~ /thomthom/
# empty line followed by line starting with 4 spaces
return Cookie.new
elsif __LINE__ == 42
return Answer.new
else
# everything normal
return Beer.new
end
end