Code Blocks and Syntax Highlighting

Discourse started to behave strangely when formatted code contains:

  1. empty line
  2. line indented with four or more spaces (not necessarily followed by other characters)
  3. 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

hm… @sam - have you had reports of this regression?

Yes I noticed this, but I’ve just been puttting a space or two on the blank lines.