@@ -19,6 +19,9 @@ require('./lib/common/login')
1919require ( '../vendor/md-toc' )
2020var Viz = require ( 'viz.js' )
2121
22+ import getUIElements from './lib/editor/ui-elements'
23+ const ui = getUIElements ( )
24+
2225// auto update last change
2326window . createtime = null
2427window . lastchangetime = null
@@ -634,7 +637,7 @@ function generateCleanHTML (view) {
634637}
635638
636639export function exportToRawHTML ( view ) {
637- const filename = `${ renderFilename ( window . ui . area . markdown ) } .html`
640+ const filename = `${ renderFilename ( ui . area . markdown ) } .html`
638641 const src = generateCleanHTML ( view )
639642 $ ( src ) . find ( 'a.anchor' ) . remove ( )
640643 const html = src [ 0 ] . outerHTML
@@ -646,8 +649,8 @@ export function exportToRawHTML (view) {
646649
647650// extract markdown body to html and compile to template
648651export function exportToHTML ( view ) {
649- const title = renderTitle ( window . ui . area . markdown )
650- const filename = `${ renderFilename ( window . ui . area . markdown ) } .html`
652+ const title = renderTitle ( ui . area . markdown )
653+ const filename = `${ renderFilename ( ui . area . markdown ) } .html`
651654 const src = generateCleanHTML ( view )
652655 // generate toc
653656 const toc = $ ( '#ui-toc' ) . clone ( )
0 commit comments