Skip to content

Commit 97f013d

Browse files
save file
1 parent 408cb32 commit 97f013d

File tree

1 file changed

+25
-22
lines changed

1 file changed

+25
-22
lines changed

utils/editors/markdown-editor/html/output-md/v2.0/output-md-v2.0.html

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
<output-root>
3+
<output-md v2.0>
44

55
<template shadowrootmode=open>
66

@@ -18,11 +18,14 @@
1818

1919
<script>
2020

21-
(function output({mod,root,node}){
21+
(function output_md({mod,dom,host}){
2222
console.log('output');
23-
var obj = {};
23+
var obj = {
24+
version : 'v2.0',
25+
};
2426

25-
var $;
27+
var $
28+
;
2629

2730
obj.initmod = function(params){
2831

@@ -44,32 +47,32 @@
4447
//:
4548

4649

47-
obj.init = function(){
50+
obj.init = async function(){
4851

52+
await libs();
4953

5054
}//init
5155

5256

53-
libs();
5457

5558
function libs(){
5659

57-
libs = new Promise(resolve=>{
60+
var resolve,promise=new Promise(res=>resolve=res);
61+
62+
var script = document.createElement('script');
63+
script.src = 'https://cdn.jsdelivr.net/npm/markdown-it/dist/markdown-it.min.js';
64+
script.onload = onload;
65+
document.head.append(script);
66+
67+
return promise;
68+
69+
70+
function onload(){
5871

59-
var script = document.createElement('script');
60-
script.src = 'https://cdn.jsdelivr.net/npm/markdown-it/dist/markdown-it.min.js';
61-
script.onload = onload;
62-
document.head.append(script);
63-
64-
65-
function onload(){
66-
67-
md = markdownit();
68-
resolve();
69-
70-
}//onload
72+
md = markdownit();
73+
resolve();
7174

72-
});
75+
}//onload
7376

7477
}//libs
7578

@@ -105,9 +108,9 @@
105108

106109
return obj;
107110

108-
});//output
111+
})//output_md
109112

110113
</script>
111114

112-
</output-root>
115+
</output-md>
113116

0 commit comments

Comments
 (0)