Skip to content

Commit 4781680

Browse files
save file
1 parent b07de7b commit 4781680

File tree

1 file changed

+49
-8
lines changed

1 file changed

+49
-8
lines changed

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

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,14 @@
3131
<input type=checkbox checked>
3232
html
3333
</span>
34-
34+
<span id=breaks class=radio>
35+
<input type=checkbox checked>
36+
breaks
37+
</span>
38+
<span id=linkify class=radio>
39+
<input type=checkbox checked>
40+
linkify
41+
</span>
3542
</div>
3643

3744
<div id=output class=markdown-body>
@@ -44,17 +51,22 @@
4451
<script>
4552

4653
(function output_md({mod,dom,host}){
47-
console.log('output');
54+
4855
var obj = {
4956
version : 'v2.0',
5057
};
5158

52-
var $
59+
var df=true,did='output_mod'
60+
;
61+
62+
63+
var $,debug
5364
;
5465

5566
obj.initmod = function(params){
5667

57-
$ = params.$;
68+
$ = mod.rd(params,'$',$);
69+
debug = mod.rd(params,'debug',debug);
5870

5971
}//initmod
6072

@@ -73,6 +85,9 @@
7385

7486
obj.init = async function(){
7587

88+
debugger;
89+
debug = eval(debug);
90+
7691
await libs();
7792

7893
}//init
@@ -119,13 +134,36 @@
119134
//:
120135

121136

122-
137+
/*
138+
139+
html : true, // allow raw HTML
140+
xhtmlOut : false, // use <br> instead of <br />
141+
breaks : false, // convert \n to <br>
142+
langPrefix : 'language-', // CSS class prefix for fenced code blocks
143+
linkify : false, // autolink plain URLs
144+
typographer : false, // smart quotes, dashes, ellipses
145+
quotes : '“”‘’', // quote characters when typographer is on
146+
highlight : (str, lang) => { // custom code highlighting
147+
return ''; // return HTML or empty string to skip
148+
},
149+
maxNesting : 100, // block nesting limit
150+
validateLink : (url) => true,// custom link validation
151+
linkTarget : '', // e.g. '_blank' to force new tab
152+
renderer : null, // custom renderer instance
153+
inline : null // custom inline parser instance
154+
155+
*/
156+
123157
obj.display = async function(txt){
124158
debug('display');
125159
await libs;
126160

127-
var opts = {};
161+
var opts = {
162+
linkTarget : '_blank',
163+
};
128164
opts.html = chk.html.checked;
165+
opts.breaks = chk.breaks.checked;
166+
opts.linkify = chk.linkify.checked;
129167
debug(opts);
130168
var md = markdownit(opts);
131169
var html = md.render(txt);
@@ -151,8 +189,11 @@
151189
}//vert
152190

153191

154-
155-
192+
//:
193+
194+
195+
196+
156197
return obj;
157198

158199
//output_md

0 commit comments

Comments
 (0)