from IPython.core.display import display, HTML display(HTML("""<h1>Hello, world!</h1> <div id="hello"> woo</div> <script> document.getElementById('hello').innerHTML="aaa" </script> """)) [{depth:1,content:['Hello, world!'],type:'Heading'},'woo']