     vm.set_title(title) if title?
     vm.set_md_and_update_editor(md) if md?
     # render html
-    vm.render_html($('#md_html_div'))
+    enmlRenderer.render_html($('#md_html_div'), vm.get_md())
     # save current note guid to local storage
     localStorageService.set(vm.SETTINGS_KEY.CURRENT_NOTE_GUID, guid)
 

# ----------------------------------------------------------------------------------------------------------------------
# Service: enmlRenderer
# ----------------------------------------------------------------------------------------------------------------------
markever.factory 'enmlRenderer', ['imageManager', (imageManager) ->
  get_enml_and_title_promise = (jq_html_div, html_render_func, markdown) ->
    # html_render_func has to be a promise
    return html_render_func(jq_html_div).then () =>
      # further post process
      # remove all script tags
      jq_html_div.find('script').remove()

          noteManager.fetch_remote_note(guid).then(
            (note) ->
              console.log('loading note ' + note.guid + ' with status ' + note.status + ' from remote')
              vm.change_current_note(note.guid, note.title, note.md)
              vm.close_loading_modal()
              console.log('loading note ' + note.guid + ' finished')
              # updating note list
