1+ <!DOCTYPE html>
12< html lang ="en ">
3+
24< head >
35 < meta charset ="UTF-8 ">
46 < meta http-equiv ="X-UA-Compatible " content ="IE=edge ">
79 < meta name ="description " content ="Write Markdown as Task descriptions for your students " />
810 < meta name ="show-in " content ="* " />
911
10- < link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/default.min.css " integrity =" sha512-hasIneQUHlh06VNBe7f6ZcHmeRTLIaQWFd43YriJ0UND19bvYRauxthDg8E4eVNPm9bRUhr5JGeqH7FRFXQu5g== " crossorigin =" anonymous " referrerpolicy =" no-referrer " />
12+ < link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/default.min.css " />
1113 < script src ="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js "> </ script >
14+
15+
16+ < link rel ="stylesheet " href ="https://cdn.jsdelivr.net/npm/markdown-it-texmath/css/texmath.min.css " />
17+ < script src ="https://cdn.jsdelivr.net/npm/markdown-it-texmath/texmath.min.js "> </ script >
18+ < link rel ="stylesheet " href ="https://cdn.jsdelivr.net/npm/katex/dist/katex.min.css ">
19+ < script src ="https://cdn.jsdelivr.net/npm/katex/dist/katex.min.js "> </ script >
20+
1221 < script src ="https://cdnjs.cloudflare.com/ajax/libs/markdown-it/13.0.1/markdown-it.min.js "> </ script >
1322
1423 < script src ="https://edrys-org.github.io/edrys/module/edrys.js "> </ script >
2130 if ( window . md ) return
2231
2332 window . md = markdownit ( )
24-
33+
2534 // enable everything
2635 window . md . options . html = true
2736 window . md . options . linkify = true
3039 window . md . options . highlight = function ( str , lang ) {
3140 if ( lang && hljs . getLanguage ( lang ) ) {
3241 try {
33- return '<pre class="hljs"><code style="border-radius: 0px">' +
34- hljs . highlight ( str , { language : lang , ignoreIllegals : true } ) . value +
35- '</code></pre>' ;
42+ return '<pre class="hljs"><code style="border-radius: 0px">' +
43+ hljs . highlight ( str , {
44+ language : lang ,
45+ ignoreIllegals : true
46+ } ) . value +
47+ '</code></pre>' ;
3648 } catch ( __ ) { }
3749 }
3850
39- return '<pre class="hljs"><code style="border-radius: 0px">' + md . utils . escapeHtml ( str ) + '</code></pre>' ;
51+ return '<pre class="hljs"><code style="border-radius: 0px">' + md . utils . escapeHtml ( str ) +
52+ '</code></pre>' ;
4053 }
54+
55+ window . md . use (
56+ texmath , {
57+ engine : katex ,
58+ delimiters : 'dollars' ,
59+ katexOptions : {
60+ macros : {
61+ "\\RR" : "\\mathbb{R}"
62+ }
63+ }
64+ } ) ;
4165 }
4266
4367 function render ( content ) {
5478 init ( )
5579
5680 if ( Edrys . module . config ) {
57- switch ( Edrys . role ) {
81+ switch ( Edrys . role ) {
5882 case "teacher" : {
5983 render ( Edrys . module . config . teacher || Edrys . module . config . md )
6084 break
7498
7599 < title > Edrys - Markdown-IT module</ title >
76100</ head >
101+
77102< body >
78103 < h1 > Edrys Markdown-IT Module</ h1 >
79104
80105 < p >
81- Please refer to the < a href ="https://github.com/Cross-Lab-Project/edrys_module-markdown-it "> README</ a > of this project.
106+ Please refer to the < a href ="https://github.com/Cross-Lab-Project/edrys_module-markdown-it "> README</ a > of this
107+ project.
82108 </ p >
83109</ body >
110+
84111</ html >
0 commit comments