                     # 'raw' url. later, embed_videos will be replace by the data-uri if there is no error
                     out += "<video src='#{mesg.file.url}' class='sagews-output-video' controls></video>"
                 else
-                    # console.log 'msg.file', mark, mesg
+                    # if DEBUG then console.log 'msg.file', mark, mesg
                     if not @_output_ids[mark.id] # avoid duplicated outputs
                         @_output_ids[mark.id] = true
-                        # console.log "output.file", mark, mesg
+                        # if DEBUG then console.log "output.file", mark, mesg
                         $images = $(mark.widgetNode)
                         for el in $images.find('.sagews-output-image')
                             # innerHTML should just be the <img ... > element

    html_process_output_mesg: (mesg, mark) ->
        # Note: each mesg could contain more than one output type
        out = ''
        # console.log 'html_process_output_mesg', mesg, mark
        if mesg.stdout?
            # assertion: for stdout, `mark` might be undefined
            out += "<div class='output stdout'>#{mesg.stdout}</div>"
        if mesg.stderr?
            out += "<div class='output stderr'>#{mesg.stderr}</div>"
        if mesg.html?

                                    console.warn("invalid output message '#{m}' in line '#{line}'")
                                    continue

                                #if DEBUG then console.log 'sagews2html: output message', mesg
                                if mesg.stdout?
                                    mesg_stdout.stdout.push(mesg.stdout)
                                else
                                    # add non-stdout mesg from this iteration
                                    if mesg.clear
                                        mesg_stdout = {stdout : []}
                                        output_msgs = []
                                    else if mesg.delete_last
                                        mesg_stdout.stdout.pop()
                                    else
                                        output_msgs.push(mesg)
                            # after for-loop over rendered output cells
                            for mesg in output_msgs
                                om = @html_process_output_mesg(mesg, mark)
