https://cdn.jsdelivr.net/npm/marked/marked.min.js </textarea> <script> // $m.innerHTML = marked.parse($t.value); var url = '/data/chinese-poetry/README.md'; // var url = '/data/chinese-poetry/论语/README.md'; var path = getQueryVariable('path'); if(path){ url = path; }
jQuery.get(url, function (s) { $m.innerHTML = marked.parse(s); });
function getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i=0;i<vars.length;i++) { var pair = vars[i].split("="); if(pair[0] == variable){return pair[1];} } return(false); } </script> </body> </html>