Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@anodynos
Last active December 28, 2015 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anodynos/7546240 to your computer and use it in GitHub Desktop.
Save anodynos/7546240 to your computer and use it in GitHub Desktop.
Literate coffeescript code fences break on blank line

This is a literate text for jashkenas/coffeescript#3248

cs = 1 # this is the only line of real code

Now I want some code examples, not part of the coffee code

  var js = 2;

  js = 3;

and it works ok. Even if start identing more

            for (var js=1; js<Infinity; js++) {
                    indentedCode = 'works ok'
            }

inside code fences, it just works.

But then it all breaks, even in backtick fenced code, when I leave one blank line:

  for (var js=1; js++; js<largeNum) {

       indentedCode_AfterBlankLine = 'it breaks!';
       stillBroken = true;
  }

However

  for (var js=1; js++; js<largeNum) {

// This fixes it  
       indentedCode = 'it doesn't break!';
  }

Or just remove indentation

for (var js=1; js++; js<largeNum) {

 non_indentedCode_AfterBlankLine = 'it doesn't break!';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment