File tree Expand file tree Collapse file tree 3 files changed +29
-434
lines changed
Expand file tree Collapse file tree 3 files changed +29
-434
lines changed Original file line number Diff line number Diff line change 1212 < script type ="text/javascript " src ="../mainmenu.js "> </ script >
1313 < script type ="text/javascript " src ="./page.js "> </ script >
1414
15- < script src ="https://cdn.jsdelivr.net/npm/marked/marked.min.js "> </ script >
16-
15+ <!-- marked -->
16+ <!--
17+ <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
18+ -->
19+
20+ <!-- showdown -->
21+ < script src ="https://cdn.jsdelivr.net/npm/showdown/dist/showdown.min.js "> </ script >
22+
1723</ head >
1824< body >
1925 < div id ="contents ">
2026
2127 < div id ="markdown_view ">
2228 </ div >
2329
24- < div id ="markdown_view2 ">
25- </ div >
26-
2730 < script >
2831
2932 function renderMarkdwon ( markdown_view_id , markdown_url ) {
3033 var xmlhttp = new XMLHttpRequest ( ) ;
3134 xmlhttp . onreadystatechange =
3235 function ( ) {
3336 if ( this . readyState == 4 && this . status == 200 ) {
34- const html = marked . parse ( this . responseText ) ;
37+ const markdown = this . responseText ;
38+ //marked
39+ //const html = marked.parse(markdown); // marked
40+ //showdown
41+ const converter = new showdown . Converter ( ) ;
42+ const html = converter . makeHtml ( markdown ) ;
3543 document . getElementById ( markdown_view_id ) . innerHTML = html ;
3644 }
37- } ;
38-
45+ }
46+ ;
3947 xmlhttp . open ( "GET" , markdown_url , true ) ;
4048 xmlhttp . send ( ) ;
4149 }
4250
4351 renderMarkdwon ( "markdown_view" , "./page.md" ) ;
44- renderMarkdwon ( "markdown_view2" , "https://code1009.github.io/web/0000.template_markdown/page.md" ) ;
4552
4653 </ script >
4754 </ div >
You can’t perform that action at this time.
0 commit comments