             # 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

        )

        content = @generate_html
            title     : @editor.filename
            filename  : @editor.filename
            content   : (h for h in @_html).join('\n')
            timestamp : "#{(new Date()).toISOString()}"

        progress(.95, "Saving to #{@output_file} ...")
        salvus_client.write_text_file_to_project

            # ignored
        else
            console.warn "ignored mesg", mesg
        html = @html_post_process(out)
        if html?
            @_html.push(html)

    html_post_process: (html) ->
        # embedding images and detecting a title
        if not html?
            return html
        $html = $(html)
        if not @_title
            for tag in ['h1', 'h2', 'h3']
                $hx = $html.find(tag + ':first')
                if $hx.length > 0
                    @_title = $hx.text()
        for img in $html.find('img')
            if img.src.startsWith('data:')
                continue
