         t0 = misc.mswalltime()
         @_update_preview_lock = true
         #console.log("update_preview")
-        @to_html (err, source) =>
+        @to_html (err, source, warnings) =>
             @_update_preview_lock = false
             if err
                 console.log("failed to render preview: #{err}")

        cb(undefined, m.s)

    rmd_to_html: (cb) =>
        @to_html_via_exec
            command     : "smc-rmd2html"
            args        : [@filename]
            cb          : cb

    rst_to_html: (cb) =>

            elt.find('link').remove()
            source = elt.html()

            if warnings
                @preview_content.html("<pre><code>#{warnings}</code></pre>")
            else
                # finally set html in the live DOM
                @preview_content.html(source)

                @localize_image_links(@preview_content)

                ## this would disable clickable links...
                #@preview.find("a").click () =>
                #    return false
                # Make it so preview links can be clicked, don't close SMC page.
                @preview_content.find("a").attr("target","_blank")
                @preview_content.find("table").addClass('table')  # bootstrap table

                @preview_content.mathjax()

                #@preview_content.find(".smc-html-cursor").scrollintoview()
                #@preview_content.find(".smc-html-cursor").remove()

            #console.log("update_preview time=#{misc.mswalltime(t0)}ms")
            if @_update_preview_redo
