[测试篇]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