                 cb(null, line, x)
             ,
             (err, line, x) ->
-                input_lines_process()
+                input_lines_process(final = true)
                 if err
                     msg = "error processing line #{line}: '#{x}'"
                     console.error(msg)

                            min-width: 2rem;
                            text-align: right;
                        }
                        div.output:before {
                            margin-left: -3rem;
                            counter-increment: line;
                            content: counter(line);
                            display: inline-block;
                            padding: 0 .5rem 0 0;
                            margin-right: .5rem;
                            color: #888;
                            min-width: 2rem;
                            text-align: right;
                            font-family: monospace;
                        }
                        footer {
                            margin-top: 1rem;
                            border-top: .1rem solid #888;

            CodeMirror.runMode(line, mode, code)
            return code.outerHTML

        input_lines_process = (final = false) =>
            # final: if true, filter out the empty lines at the bottom
            while final and input_lines.length > 0
                line = input_lines[input_lines.length - 1]
                console.log("last line:", line)
                if line.length == 0
                    input_lines.pop()
                else
                    break
            if input_lines.length > 0
                input_lines = input_lines.map(process_line).join('') # no \n linebreaks!
                #@_html.push("<div class='mode'>#{input_lines_mode ? input_lines_default_mode} mode")
