         else if mesg.stderr?
             out = "<div class='output stderr'>#{mesg.stderr}</div>"
         else if mesg.html?
-            $html = $(mesg.html).wrap('<div>')
+            $html = $("<div>#{mesg.html}</div>")
             @editor.syncdoc.process_html_output($html)
             out = "<div class='output html'>#{$html.html()}</div>"
         else if mesg.md?

                            text-align: right;
                            font-family: monospace;
                        }
                    </style>

                    <script type="text/javascript">window.MathJax = #{misc.to_json(MathJaxConfig)};</script>
                    <script type="text/javascript" async
                        src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
                    </script>
                    <!-- https://highlightjs.org/usage/ -->
                    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/styles/default.min.css">
                    <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.4.0/languages/go.min.js"></script>
                    <script>hljs.initHighlightingOnLoad();</script>
                </head>

                <body>
                <div class="header">
                    <h1><%= title %></h1>
                    <div>generated <%= timestamp %></div>
                </div>
                <%= content %>
                <div class="footer">
                </div>
                </body>
                </html>"""
        return @_html_tmpl(data)

                            x
                        when MARKERS.output
                            # assume, all cells are evaluated and hence mark.rendered contains the html
                            console.log 'output mark', mark
                            for mesg_ser in mark.rendered.split(MARKERS.output)
                                if mesg_ser.length == 0
                                    continue
