     if $html.is(':visible')
       return
 
-    $html.val tpl.editor.pretty()
+    $html.val BlogEditor.make(tpl).pretty()
     setEditMode tpl, 'html'
     $html.height($editable.height())
 

    if tpl.$('.editable').is(':visible')
      return

    tpl.editor.highlightSyntax()
    setEditMode tpl, 'visual'

  'click .html-toggle': (e, tpl) ->

    i++

  # Highlight code blocks
  editor.highlightSyntax()

  if $editable.is(':visible')
    body = editor.contents()
  else
    body = $('.html-editor', $form).val().trim()

