• markdown语法


    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>JS Bin</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.7.0/marked.js"></script>
    </head>
    <body>
    <div id="content"></div>
    <script>
    var markdown=`
    # Marked in the browser
    ## Rendered by **marked**.
    [百度](http://baidu.com)
    `
    var html= marked(markdown);
    document.getElementById('content').innerHTML =html;
    </script>
    </body>
    </html>

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>JS Bin</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.7.0/marked.js"></script>
    <link rel="stylesheet" href="https://typo.sofi.sh/typo.css">
    <style>
    padding:16px;
    </style>
    </head>
    <body>
    <div id="content"></div>


    <script>
    var markdown=`
    # 我的第一遍博客

    **小凌**
    >不要相信网上的名人名言。——鲁迅
    大家好我今天学会了markdown语法了。
    ![](https://p0.meituan.net/dpmerchantpic/659eb04d72c3f511dfa6ea9d55fcbd08541010.jpg%40watermark%3D1%26%26r%3D1%26p%3D9%26x%3D2%26y%3D2%26relative%3D1%26o%3D20)
    `
    var html= marked(markdown);
    document.getElementById('content').innerHTML =html;
    </script>
    </body>

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>JS Bin</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.7.0/marked.js"></script>
    <link rel="stylesheet" href="https://typo.sofi.sh/typo.css">
    <style>
    padding:16px;
    </style>
    </head>
    <body>
    <div id="content"></div>


    <script>
    var markdown=`
    # 我的第一遍博客

    **小凌**
    >不要相信网上的名人名言。——鲁迅
    大家好我今天学会了markdown语法了。
    <img src="https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1072406476,383999741&fm=26&gp=0.jpg" 300>
    `
    var html= marked(markdown);
    document.getElementById('content').innerHTML =html;
    </script>
    </body>
    </html>

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>JS Bin</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.7.0/marked.js"></script>
    <link rel="stylesheet" href="https://typo.sofi.sh/typo.css">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <style>
    body{padding:16px;}
    img{
    max-100%;
    }
    </style>
    </head>
    <body>
    <div id="content"></div>
    <script>
    var markdown=`
    # 我的第一遍博客


    **小凌**
    >不要相信网上的名人名言。——鲁迅

    大家好我今天学会了markdown语法了。

    <img src="https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1072406476,383999741&fm=26&gp=0.jpg">
    `
    var html= marked(markdown);
    document.getElementById('content').innerHTML =html;
    </script>
    </body>
    </html>

    <head>
    <meta charset="utf-8">
    <title>JS Bin</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.7.0/marked.js"></script>
    <link rel="stylesheet" href="https://typo.sofi.sh/typo.css">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <style>
    body{padding:16px;}
    img{
    max-100%;
    }
    </style>
    </head>
    <body>
    <div id="content">
    # 我的第一遍博客

    **小凌**

    >不要相信网上的名人名言。——鲁迅

    大家好我今天学会了markdown语法了。

    <img src="https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1072406476,383999741&fm=26&gp=0.jpg">
    </div>
    <script>
    var content=document.getElementById("content");
    var markdown=content.innerHTML
    console.log(markdown);
    </script>
    </body>
    </html>

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>JS Bin</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.7.0/marked.js"></script>
    <link rel="stylesheet" href="https://typo.sofi.sh/typo.css">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <style>
    body{padding:16px;}
    img{
    max-100%;
    }
    </style>
    </head>
    <body>
    <div id="content">
    # 我的第一篇博客

    **小凌**

    __不要相信网上的名人名言。——鲁迅__

    大家好我今天学会了markdown语法了。

    <img src="https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1072406476,383999741&fm=26&gp=0.jpg">
    </div>
    <script>
    var content=document.getElementById("content");
    var markdown=content.innerHTML
    <!-- console.log(markdown); -->
    var html=marked(markdown)
    content.innerHTML=html
    </script>
    </body>
    </html>

  • 相关阅读:
    Python的map、filter、reduce函数 [转]
    CROSS APPLY vs OUTER APPLY
    C# SqlConnection
    Vue中时间的设置
    Entity Framework 应用程序有以下优缺点
    ASP.NET Core学习——3
    面向对象设计原则
    数据结构——HDU1312:Red and Black(DFS)
    数据结构——Currency System in Geraldion
    数据结构——POJ 1686 Lazy Math Instructor 栈的应用
  • 原文地址:https://www.cnblogs.com/sna-ling/p/11982033.html
Copyright © 2020-2023  润新知