File tree Expand file tree Collapse file tree 1 file changed +23
-9
lines changed
Expand file tree Collapse file tree 1 file changed +23
-9
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 ">
2531 < script >
2632
2733 function renderMarkdwon ( markdown_view_id , markdown_url ) {
28- var xmlhttp = new XMLHttpRequest ( ) ;
29- xmlhttp . onreadystatechange =
30- function ( ) {
31- if ( this . readyState == 4 && this . status == 200 ) {
32- const html = marked . parse ( this . responseText ) ;
33- document . getElementById ( markdown_view_id ) . innerHTML = html ;
34- }
34+ var xmlhttp = new XMLHttpRequest ( ) ;
35+ xmlhttp . onreadystatechange =
36+ function ( ) {
37+ if ( this . readyState == 4 && this . status == 200 ) {
38+
39+ //marked
40+ //const html = marked.parse(this.responseText); // marked
41+
42+ // showdown
43+ const converter = new showdown . Converter ( ) ;
44+ const html = converter . makeHtml ( markdown ) ;
45+
46+ document . getElementById ( markdown_view_id ) . innerHTML = html ;
47+
48+ }
3549 } ;
3650
3751 xmlhttp . open ( "GET" , markdown_url , true ) ;
You can’t perform that action at this time.
0 commit comments