Skip to content

Commit 1104e91

Browse files
author
minjk-bl
committed
Fix bug: generated code bug on Markdown app
1 parent 6640067 commit 1104e91

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

js/com/component/PopupComponent.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,7 @@ define([
683683
let code = this.generateCode();
684684
let mode = this.config.executeMode;
685685
let sigText = '';
686+
vpLog.display(VP_LOG_TYPE.DEVELOP, sigText, mode, code);
686687
// check if it's block
687688
if (this.getTaskType() == 'block') {
688689
let block = this.taskItem;

js/m_apps/Markdown.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ define([
126126
var page = new com_String();
127127
page.appendLine('<div class="vp-divide-top">');
128128
page.appendLine(this.templateForToolbar());
129-
page.appendFormatLine('<textarea id="{0}">{1}</textarea>', 'vp_markdownEditor', this.state.editor);
129+
page.appendFormatLine('<textarea id="{0}" class="vp-state">{1}</textarea>', 'vp_markdownEditor', this.state.editor);
130130
page.appendFormatLine('<div id="{0}"></div>', "vp_attachEncodedDataArea");
131131
page.appendLine('</div>');
132132
page.appendFormatLine('<div id="{0}" class="vp-divide-bot">{1}</div>', 'vp_markdownPreview', this.state.preview);
@@ -148,10 +148,6 @@ define([
148148
</div>`;
149149
}
150150

151-
templateForDataView() {
152-
return `<textarea id="vp_markdownPreview"></textarea>`;
153-
}
154-
155151
render() {
156152
super.render();
157153

@@ -213,14 +209,9 @@ define([
213209
preview = '';
214210
}
215211
that.state.preview = preview;
216-
document.getElementById("vp_markdownPreview").innerHTML = preview;
212+
$(that.wrapSelector("#vp_markdownPreview")).html(preview);
217213

218214
MathJax.Hub.Queue(["Typeset", MathJax.Hub, "vp_markdownPreview"]);
219-
220-
// re render block
221-
if (block) {
222-
block.render();
223-
}
224215
});
225216
}
226217

@@ -306,6 +297,7 @@ define([
306297
// repace selection
307298
cm.replaceSelection(adjustText);
308299
// TODO: set block code
300+
cm.focus();
309301
}
310302

311303
/**

0 commit comments

Comments
 (0)