lib/literate.js
function appendCode() {
    if (state === "code") {
      state = "text";
      if (!isWhitespace(codeBuffer)) {
        content += codeOpen + codeBuffer.replace(/^(?:\s*\n)+/, "").replace(/[\s\n]*$/, "") + codeClose;
      }
      codeBuffer = "";
    }
  }
function appendCode() {
    if (state === "code") {
      state = "text";
      if (!isWhitespace(codeBuffer)) {
        content += codeOpen + codeBuffer.replace(/^(?:\s*\n)+/, "").replace(/[\s\n]*$/, "") + codeClose;
      }
      codeBuffer = "";
    }
  }
function appendCode ( ) { if ( state === "code" ) { state = "text" ; if ( ! isWhitespace ( codeBuffer ) ) { content += codeOpen + codeBuffer . replace ( / ^(?:\s*\n)+ / , "" ) . replace ( / [\s\n]*$ / , "" ) + codeClose ; } codeBuffer = "" ; } }
buffer for code output
buffer for code output