[測試篇]MarkDown之代碼塊行號+折疊圖片


對比測試代碼編號

$(function(){
    $('pre code').each(function(){
    	texts = $(this).text().replace(/&(?!#?[a-zA-Z0-9]+;)/g, '&')
        .replace(//g, '>').replace(/'/g, ''').replace(/"/g, '"')        
        var codetext = texts.split('\n');
        var code = '';
        $(codetext).each(function(v){
        	code += '
  • '+codetext[v]+'
  • '; }) code = '
      '+code+'
    '; $(this).html(code); }); });

    測試markdown常規代碼塊

        $('pre code').each(function(){
        	texts = $(this).text().replace(/&(?!#?[a-zA-Z0-9]+;)/g, '&')
            .replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/'/g, '&#39;').replace(/"/g, '&quot;')        
            var codetext = texts.split('\n');
            var code = '';
            $(codetext).each(function(v){
            	code += '<li>'+codetext[v]+'</li>';
            })        
            code = '<ol>'+code+'</ol>';
            $(this).html(code);
        });
    });
    

    測試圖片折疊效果

    打開多頁面PDF文件
    <-此處有圖片


    免責聲明!

    本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



     
    粵ICP備18138465號   © 2018-2025 CODEPRJ.COM