{"id":117182,"date":"2026-10-22T20:41:00","date_gmt":"2026-10-22T12:41:00","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/117182.html"},"modified":"2026-10-22T20:41:00","modified_gmt":"2026-10-22T12:41:00","slug":"%e6%88%90%e4%b8%ba%e5%85%a8%e6%a0%88%c2%b7taro-%e5%b0%8f%e7%a8%8b%e5%ba%8f%e7%af%87%c2%b7%e5%b0%8f%e7%a8%8b%e5%ba%8f-markdown-%e9%98%85%e8%af%bb%e5%99%a8%ef%bc%9a%e4%bb%8e-ast-%e5%88%b0%e5%8f%97","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/117182.html","title":{"rendered":"\u6210\u4e3a\u5168\u6808\u00b7Taro \u5c0f\u7a0b\u5e8f\u7bc7\u00b7\u5c0f\u7a0b\u5e8f Markdown \u9605\u8bfb\u5668\uff1a\u4ece AST \u5230\u53d7\u63a7\u539f\u751f\u7ec4\u4ef6"},"content":{"rendered":"<p>        \/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/<br \/>\n        #content_views .toc,<br \/>\n        \/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/<br \/>\n        #content_views.markdown_views &gt; p:empty:has(+ .toc),<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty,<br \/>\n        \/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/<br \/>\n        #content_views.htmledit_views #main-toc,<br \/>\n        #content_views.htmledit_views #hr-toc,<br \/>\n        #content_views.htmledit_views p[id*=\\&#8221;-toc\\&#8221;] {<br \/>\n          display: none !important;<br \/>\n        }<br \/>\n        \/* \u76ee\u5f55\u53bb\u6389\u540e\uff0c\u7d27\u8ddf\u7684\u9996\u4e2a\u6807\u9898\u4e0d\u518d\u591a\u51fa\u4e00\u5757\u4e0a\u8fb9\u8ddd *\/<br \/>\n        #content_views.markdown_views &gt; .toc + h1,<br \/>\n        #content_views.markdown_views &gt; .toc + h2,<br \/>\n        #content_views.markdown_views &gt; .toc + h3,<br \/>\n        #content_views.markdown_views &gt; .toc + h4,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h1,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h2,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h3,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h4 {<br \/>\n          margin-top: 0 !important;<br \/>\n        }<\/p>\n<h2>\u6210\u4e3a\u5168\u6808\u00b7Taro \u5c0f\u7a0b\u5e8f\u7bc7\u00b7\u5c0f\u7a0b\u5e8f Markdown \u9605\u8bfb\u5668&#xff1a;\u4ece AST \u5230\u53d7\u63a7\u539f\u751f\u7ec4\u4ef6<\/h2>\n<p>\u201c\u4ee3\u7801\u6ca1\u6709\u9ad8\u4eae&#xff0c;\u4e5f\u6ca1\u6807\u8bed\u8a00\u3002\u201dAPP \u9605\u8bfb\u5668\u4e0a\u7ebf\u540e\u6536\u5230\u7684\u8fd9\u6761\u53cd\u9988&#xff0c;\u6bd4\u4efb\u4f55\u8bbe\u8ba1\u8bc4\u5ba1\u90fd\u76f4\u63a5\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261022124054-6ada0456e9404.png\" alt=\"\u6210\u4e3a\u5168\u6808\u00b7Taro \u5c0f\u7a0b\u5e8f\u7bc7\u00b7\u5c0f\u7a0b\u5e8f Markdown \u9605\u8bfb\u5668\uff1a\u4ece AST \u5230\u53d7\u63a7\u539f\u751f\u7ec4\u4ef6\" \/><\/p>\n<h3>\u524d\u8a00&#xff1a;\u8bfb\u8005\u53cd\u9988&#034;\u4ee3\u7801\u6ca1\u6709\u9ad8\u4eae&#034;&#xff0c;\u6bd4\u8bbe\u8ba1\u8bc4\u5ba1\u66f4\u76f4\u63a5<\/h3>\n<p>APP \u9605\u8bfb\u5668\u4e0a\u7ebf\u540e\u6536\u5230\u4e00\u6761\u53cd\u9988&#xff1a;\u201c\u4ee3\u7801\u6ca1\u6709\u9ad8\u4eae&#xff0c;\u4e5f\u6ca1\u6807\u8bed\u8a00\u3002\u201d<\/p>\n<p>\u6211\u5f53\u65f6\u7684\u7b2c\u4e00\u53cd\u5e94\u662f&#034;\u8fd9\u662f\u88c5\u9970\u529f\u80fd\u5427&#034;\u3002\u4f46\u90a3\u6761\u53cd\u9988\u91cc\u771f\u6b63\u6709\u7528\u7684\u4fe1\u606f\u662f\u540e\u534a\u53e5&#xff1a;\u8bfb\u8005\u8981\u5224\u65ad\u8fd9\u6bb5\u4ee3\u7801\u5c5e\u4e8e\u54ea\u4e2a\u73af\u5883\u3002<\/p>\n<p>\u5bf9\u4e00\u4e2a\u6280\u672f\u4e13\u680f\u6765\u8bf4&#xff0c;\u4ee3\u7801\u5757\u4e0d\u662f\u63d2\u56fe \u2014\u2014 \u5b83\u662f\u5185\u5bb9\u672c\u8eab\u3002\u8bfb\u8005\u8981\u8bfb\u5b83\u3001\u5224\u65ad\u5b83\u3001\u590d\u5236\u5b83&#xff0c;\u957f\u7684\u8fd8\u8981\u6a2a\u5411\u6eda\u52a8\u3002\u800c&#034;\u7528 rich-text \u628a\u6574\u7bc7 Markdown \u8f6c\u6210 HTML \u5b57\u7b26\u4e32&#034;\u8fd9\u6761\u6700\u7701\u4e8b\u7684\u8def&#xff0c;\u6070\u597d\u628a\u8fd9\u4e9b\u80fd\u529b\u5168\u90e8\u4ea4\u51fa\u53bb\u3002<\/p>\n<p>\u6446\u5728\u9762\u524d\u7684\u4e09\u6761\u8def&#xff1a;\u8f6c HTML\u3001\u6362\u4e00\u4e2a\u80fd\u89e3\u6790\u6210\u865a\u62df DOM \u7684\u5e93\u3001\u81ea\u5df1\u89e3\u6790 token \u5efa\u8282\u70b9\u6811\u3002<\/p>\n<p>\u7b2c\u4e00\u6761\u6700\u7701\u4e8b\u4f46\u4ea4\u4e92\u5168\u4e22&#xff1b;\u7b2c\u4e8c\u6761\u5f15\u5165\u7684\u8fd0\u884c\u65f6\u4f53\u91cf\u548c\u7aef\u4e0a\u5305\u4f53\u79ef\u5929\u7136\u51b2\u7a81\u3002\u5f53\u524d\u5b9e\u73b0\u8d70\u7b2c\u4e09\u6761&#xff1a;markdown-it \u53ea\u8d1f\u8d23\u628a\u6587\u672c\u5207\u6210 token&#xff0c;\u6211\u4eec\u518d\u628a token \u7ffb\u8bd1\u6210\u53d7\u63a7\u7684\u539f\u751f\u7ec4\u4ef6\u3002<\/p>\n<p>\u8fd9\u7bc7\u7684\u91cd\u70b9&#xff0c;\u662f\u4e3a\u4ec0\u4e48\u4fdd\u7559\u7ed3\u6784\u6bd4&#034;\u4e00\u53e3\u6c14\u8f6c\u6210 HTML&#034;\u66f4\u9002\u5408\u5f53\u524d\u4ea7\u54c1&#xff0c;\u4ee5\u53ca\u5982\u4f55\u8ba9\u672a\u77e5\u5185\u5bb9\u6709\u6e05\u695a\u7684\u964d\u7ea7\u65b9\u5f0f\u3002<\/p>\n<p>\u6211\u628a\u5b83\u5f53\u6210\u4e86\u9605\u8bfb\u5668\u7684\u8bbe\u8ba1\u8d77\u70b9\u3002\u5bf9\u6280\u672f\u6559\u7a0b\u6765\u8bf4&#xff0c;\u4ee3\u7801\u4e0d\u6807\u8bed\u8a00\u4e0d\u662f\u88c5\u9970\u7f3a\u5931\u2014\u2014\u8bfb\u8005\u8981\u5224\u65ad\u8fd9\u6bb5\u4ee3\u7801\u5c5e\u4e8e\u54ea\u4e2a\u73af\u5883&#xff0c;\u8981\u590d\u5236&#xff0c;\u8fd8\u53ef\u80fd\u6a2a\u5411\u67e5\u770b\u957f\u884c\u3002<\/p>\n<p>APP \u4fa7\u53ef\u4ee5\u7528\u6210\u719f\u7684 Markdown \u6e32\u67d3\u5e93\u628a\u6574\u7bc7\u5185\u5bb9\u4ea4\u7ed9\u6e32\u67d3\u5668\u5904\u7406&#xff0c;\u5c0f\u7a0b\u5e8f\u4fa7\u6ca1\u6709\u7b49\u4ef7\u7269\u3002rich-text \u80fd\u6e32\u67d3\u4e00\u6bb5\u53d7\u9650\u7684 HTML \u5b57\u7b26\u4e32&#xff0c;\u5374\u63a5\u4e0d\u4f4f\u201c\u70b9\u51fb\u4ee3\u7801\u5757\u590d\u5236\u539f\u6587\u201d\u201c\u70b9\u51fb\u94fe\u63a5\u8d70\u539f\u751f\u8def\u7531\u201d\u201c\u8868\u683c\u6a2a\u5411\u6eda\u52a8\u201d\u8fd9\u4e9b\u4ea4\u4e92\u3002<\/p>\n<p>\u6446\u5728\u9762\u524d\u7684\u6709\u4e09\u6761\u8def&#xff1a;\u7528 rich-text \u628a Markdown \u76f4\u63a5\u8f6c\u6210 HTML \u5b57\u7b26\u4e32&#xff1b;\u6362\u4e00\u4e2a\u80fd\u89e3\u6790\u6210\u865a\u62df DOM \u7684\u5e93&#xff0c;\u518d\u628a\u8282\u70b9\u6620\u5c04\u5230 Taro \u7ec4\u4ef6&#xff1b;\u6216\u8005\u81ea\u5df1\u89e3\u6790 token \u5efa\u8282\u70b9\u6811\u3002\u7b2c\u4e00\u6761\u6700\u7701\u4e8b&#xff0c;\u4f46\u4ea4\u4e92\u5168\u90e8\u4e22\u5931&#xff1b;\u7b2c\u4e8c\u6761\u5f15\u5165\u7684\u8fd0\u884c\u65f6\u4f53\u91cf\u548c\u7aef\u4e0a\u5305\u4f53\u79ef\u5929\u7136\u51b2\u7a81\u3002\u5f53\u524d\u5b9e\u73b0\u8d70\u7b2c\u4e09\u6761\u2014\u2014markdown-it \u53ea\u8d1f\u8d23\u628a\u6587\u672c\u5207\u6210 token&#xff0c;\u6211\u4eec\u518d\u628a token \u7ffb\u8bd1\u6210\u53d7\u63a7\u7684\u539f\u751f\u7ec4\u4ef6\u3002<\/p>\n<p>\u8fd9\u7bc7\u7684\u91cd\u70b9&#xff0c;\u662f\u4e3a\u4ec0\u4e48\u4fdd\u7559\u7ed3\u6784\u6bd4\u201c\u4e00\u53e3\u6c14\u8f6c\u6210 HTML\u201d\u66f4\u9002\u5408\u5f53\u524d\u4ea7\u54c1&#xff0c;\u4ee5\u53ca\u5982\u4f55\u8ba9\u672a\u77e5\u5185\u5bb9\u6709\u6e05\u695a\u7684\u964d\u7ea7\u65b9\u5f0f\u3002<\/p>\n<h3>\u89e3\u6790\u5668\u8d1f\u8d23\u7406\u89e3&#xff0c;\u7ec4\u4ef6\u8d1f\u8d23\u4ea4\u4e92<\/h3>\n<p>\u89e3\u6790\u5668\u7684\u4e09\u4e2a\u5f00\u5173\u90fd\u5e26\u7740\u7406\u7531&#xff0c;\u4e0d\u662f\u968f\u624b\u6284\u6765\u7684\u521d\u59cb\u5316\u6a21\u677f&#xff1a;<\/p>\n<p><span class=\"token comment\">\/\/ src\/core\/markdown.ts&#xff1a;\u5173\u95ed\u539f\u59cb HTML&#xff0c;\u5f00\u542f\u94fe\u63a5\u8bc6\u522b\u548c\u8f6f\u6362\u884c\u3002<\/span><br \/>\n<span class=\"token keyword\">const<\/span> md <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">MarkdownIt<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span> html<span class=\"token operator\">:<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">,<\/span> linkify<span class=\"token operator\">:<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">,<\/span> breaks<span class=\"token operator\">:<\/span> <span class=\"token boolean\">true<\/span> <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>html: false \u662f\u5173\u952e\u7684\u4e00\u6761\u2014\u2014\u5b83\u8ba9 &lt;script&gt; \u8fd9\u7c7b\u5185\u5bb9\u7559\u5728\u6587\u672c\u5c42&#xff0c;\u4e0d\u4f1a\u88ab\u89e3\u6790\u6210\u53ef\u6267\u884c\u8282\u70b9\u3002linkify: true \u8ba9\u88f8\u5199\u7684 URL \u81ea\u52a8\u6210\u94fe\u63a5&#xff0c;\u4f5c\u8005\u4e0d\u5fc5\u624b\u52a8\u5305\u4e00\u5c42 []()\u3002breaks: true \u8ba9\u5355\u4e2a\u6362\u884c\u6309\u4f5c\u8005\u76f4\u89c9\u65ad\u884c&#xff0c;\u800c\u4e0d\u662f\u5fc5\u987b\u7a7a\u4e00\u884c\u624d\u5206\u6bb5\u3002\u8fd9\u4e09\u4e2a\u9ed8\u8ba4\u503c\u5408\u8d77\u6765&#xff0c;\u51b3\u5b9a\u4e86\u540e\u9762\u8282\u70b9\u4f1a\u51fa\u73b0\u54ea\u4e9b\u79cd\u7c7b\u3002<\/p>\n<p>\u89e3\u6790\u7ed3\u679c\u5206\u4e24\u90e8\u5206&#xff1a;\u4e00\u68f5 MdNode \u6811\u548c\u4e00\u4efd\u6807\u9898\u6e05\u5355\u3002\u8282\u70b9\u7ed3\u6784\u5f88\u8584&#xff0c;\u53ea\u4fdd\u7559\u6e32\u67d3\u771f\u6b63\u9700\u8981\u7684\u5b57\u6bb5&#xff1a;<\/p>\n<p><span class=\"token comment\">\/\/ src\/core\/markdown.ts&#xff1a;\u8282\u70b9\u53ea\u5e26\u6e32\u67d3\u6240\u9700\u7684\u5b57\u6bb5&#xff0c;text \u4e0e tag \u4f9b\u7ec4\u4ef6\u5206\u6d3e\u3002<\/span><br \/>\n<span class=\"token keyword\">export<\/span> <span class=\"token keyword\">interface<\/span> <span class=\"token class-name\">MdNode<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  type<span class=\"token operator\">:<\/span> <span class=\"token builtin\">string<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  tag<span class=\"token operator\">:<\/span> <span class=\"token builtin\">string<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  content<span class=\"token operator\">:<\/span> <span class=\"token builtin\">string<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  attrs<span class=\"token operator\">:<\/span> Record<span class=\"token operator\">&lt;<\/span><span class=\"token builtin\">string<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token builtin\">string<\/span><span class=\"token operator\">&gt;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  info<span class=\"token operator\">:<\/span> <span class=\"token builtin\">string<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  children<span class=\"token operator\">:<\/span> MdNode<span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  id<span class=\"token operator\">?<\/span><span class=\"token operator\">:<\/span> <span class=\"token builtin\">string<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u7ec4\u4ef6\u62ff\u5230 type \u5c31\u5206\u6d3e&#xff0c;\u4e0d\u9700\u8981\u5728\u9875\u9762\u91cc\u91cd\u65b0\u7528\u6b63\u5219\u731c\u6807\u9898\u6216\u94fe\u63a5\u3002tag \u4fdd\u7559\u539f\u59cb\u6807\u7b7e\u540d&#xff0c;\u8ba9\u6807\u9898\u5c42\u7ea7\u3001\u5217\u8868\u8fd9\u4e9b\u7ed3\u6784\u8fd8\u80fd\u6309 Markdown \u539f\u610f\u843d\u5230\u6837\u5f0f\u4e0a&#xff1b;id \u53ea\u5728\u6807\u9898\u8282\u70b9\u51fa\u73b0&#xff0c;\u4f9b\u76ee\u5f55\u5b9a\u4f4d\u3002<\/p>\n<table>\n<tr>Markdown \u7ed3\u6784\u5f53\u524d\u8f93\u51fa\u4ea4\u4e92\u4e0e\u8fb9\u754c<\/tr>\n<tbody>\n<tr>\n<td>\u666e\u901a\u6587\u5b57\u3001\u5f3a\u8c03\u3001\u884c\u5185\u4ee3\u7801<\/td>\n<td>Text \u4e0e\u8bed\u4e49\u6837\u5f0f<\/td>\n<td>\u6587\u5b57\u53ef\u9009\u62e9<\/td>\n<\/tr>\n<tr>\n<td>\u56f4\u680f\u4ee3\u7801<\/td>\n<td>\u8bed\u8a00\u5934\u3001\u590d\u5236\u3001\u6a2a\u5411 ScrollView<\/td>\n<td>\u672a\u8bc6\u522b\u8bed\u8a00\u8f6c\u4e49\u540e\u663e\u793a<\/td>\n<\/tr>\n<tr>\n<td>HTTP(S) \u56fe\u7247<\/td>\n<td>Image<\/td>\n<td>\u70b9\u51fb\u539f\u751f\u9884\u89c8<\/td>\n<\/tr>\n<tr>\n<td>\u94fe\u63a5<\/td>\n<td>\u660e\u786e\u7684 Button<\/td>\n<td>\u7ad9\u5185\u5bfc\u822a\u6216\u5916\u94fe\u590d\u5236<\/td>\n<\/tr>\n<tr>\n<td>\u8868\u683c<\/td>\n<td>\u6a2a\u5411 ScrollView \u4e0e\u8868\u683c\u6837\u5f0f<\/td>\n<td>\u4e0d\u538b\u7f29\u6210\u65e0\u6cd5\u8bfb\u7684\u7a84\u5217<\/td>\n<\/tr>\n<tr>\n<td>\u6807\u9898\u4e0e\u5f15\u7528<\/td>\n<td>\u5e26\u5c42\u7ea7\u7684 View<\/td>\n<td>\u6807\u9898\u53ef\u88ab\u76ee\u5f55\u5b9a\u4f4d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd9\u4e0d\u662f\u5b8c\u6574\u5b9e\u73b0\u6240\u6709 Markdown \u63d2\u4ef6\u3002\u5f53\u524d\u6ca1\u6709\u56e0\u4e3a AST \u5b58\u5728\u5c31\u81ea\u52a8\u83b7\u5f97\u6570\u5b66\u516c\u5f0f\u3001\u6d41\u7a0b\u56fe\u6216\u811a\u6ce8\u4ea4\u4e92\u3002\u65b0\u589e\u8bed\u6cd5\u5fc5\u987b\u6709\u5bf9\u5e94\u89e3\u6790\u3001\u6e32\u67d3\u4e0e\u9a8c\u8bc1&#xff0c;\u4e0d\u80fd\u53ea\u5728\u6837\u4f8b\u4e2d\u653e\u4e00\u6bb5\u5b57\u7b26\u3002<\/p>\n<h3>\u8282\u70b9\u6811\u4fdd\u7559\u4e86\u5d4c\u5957\u5173\u7cfb<\/h3>\n<p>\u89e3\u6790\u65f6\u7528\u6808\u5904\u7406\u5f00\u59cb\u548c\u7ed3\u675f token\u3002\u5f00\u59cb\u8282\u70b9\u8fdb\u5165\u6808&#xff0c;\u7ed3\u675f\u8282\u70b9\u5f39\u51fa&#xff0c;\u5b50\u8282\u70b9\u6302\u5728\u5f53\u524d\u7236\u8282\u70b9\u4e0b\u3002inline token \u518d\u9012\u5f52\u5904\u7406\u81ea\u5df1\u7684 children\u3002\u6838\u5fc3\u5faa\u73af\u4e0d\u5230\u4e8c\u5341\u884c&#xff0c;\u4f46\u5b83\u51b3\u5b9a\u4e86\u540e\u9762\u6240\u6709\u4ea4\u4e92\u80fd\u4e0d\u80fd\u6210\u7acb&#xff1a;<\/p>\n<p><span class=\"token comment\">\/\/ src\/core\/markdown.ts \u7684 tree() \u8282\u9009&#xff0c;\u5165\u6808\u4e0e\u51fa\u6808\u51b3\u5b9a\u7236\u5b50\u5173\u7cfb\u3002<\/span><br \/>\n<span class=\"token keyword\">const<\/span> root<span class=\"token operator\">:<\/span> MdNode <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">{<\/span> type<span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;root&#034;<\/span><span class=\"token punctuation\">,<\/span> tag<span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;&#034;<\/span><span class=\"token punctuation\">,<\/span> content<span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;&#034;<\/span><span class=\"token punctuation\">,<\/span> attrs<span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span> info<span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;&#034;<\/span><span class=\"token punctuation\">,<\/span> children<span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  stack <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">[<\/span>root<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">for<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">const<\/span> token <span class=\"token keyword\">of<\/span> list<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>token<span class=\"token punctuation\">.<\/span>nesting <span class=\"token operator\">&#061;&#061;&#061;<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>stack<span class=\"token punctuation\">.<\/span>length <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span> stack<span class=\"token punctuation\">.<\/span><span class=\"token function\">pop<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">continue<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n  <span class=\"token keyword\">const<\/span> n<span class=\"token operator\">:<\/span> MdNode <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    type<span class=\"token operator\">:<\/span> token<span class=\"token punctuation\">.<\/span>type<span class=\"token punctuation\">,<\/span><br \/>\n    tag<span class=\"token operator\">:<\/span> token<span class=\"token punctuation\">.<\/span>tag<span class=\"token punctuation\">,<\/span><br \/>\n    content<span class=\"token operator\">:<\/span> token<span class=\"token punctuation\">.<\/span>content<span class=\"token punctuation\">,<\/span><br \/>\n    attrs<span class=\"token operator\">:<\/span> Object<span class=\"token punctuation\">.<\/span><span class=\"token function\">fromEntries<\/span><span class=\"token punctuation\">(<\/span>token<span class=\"token punctuation\">.<\/span>attrs <span class=\"token operator\">||<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    info<span class=\"token operator\">:<\/span> token<span class=\"token punctuation\">.<\/span>info<span class=\"token punctuation\">,<\/span><br \/>\n    children<span class=\"token operator\">:<\/span> token<span class=\"token punctuation\">.<\/span>children <span class=\"token operator\">?<\/span> <span class=\"token function\">tree<\/span><span class=\"token punctuation\">(<\/span>token<span class=\"token punctuation\">.<\/span>children<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>token<span class=\"token punctuation\">.<\/span>type <span class=\"token operator\">&#061;&#061;&#061;<\/span> <span class=\"token string\">&#034;heading_open&#034;<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    n<span class=\"token punctuation\">.<\/span>id <span class=\"token operator\">&#061;<\/span> <span class=\"token template-string\"><span class=\"token template-punctuation string\">&#096;<\/span><span class=\"token string\">heading-<\/span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${<\/span>headings<span class=\"token punctuation\">.<\/span>length<span class=\"token interpolation-punctuation punctuation\">}<\/span><\/span><span class=\"token template-punctuation string\">&#096;<\/span><\/span><span class=\"token punctuation\">;<\/span><br \/>\n    headings<span class=\"token punctuation\">.<\/span><span class=\"token function\">push<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span> id<span class=\"token operator\">:<\/span> n<span class=\"token punctuation\">.<\/span>id<span class=\"token punctuation\">,<\/span> title<span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;&#034;<\/span><span class=\"token punctuation\">,<\/span> level<span class=\"token operator\">:<\/span> <span class=\"token function\">Number<\/span><span class=\"token punctuation\">(<\/span>token<span class=\"token punctuation\">.<\/span>tag<span class=\"token punctuation\">.<\/span><span class=\"token function\">slice<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n  stack<span class=\"token punctuation\">[<\/span>stack<span class=\"token punctuation\">.<\/span>length <span class=\"token operator\">&#8211;<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">.<\/span>children<span class=\"token punctuation\">.<\/span><span class=\"token function\">push<\/span><span class=\"token punctuation\">(<\/span>n<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>token<span class=\"token punctuation\">.<\/span>nesting <span class=\"token operator\">&#061;&#061;&#061;<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span> stack<span class=\"token punctuation\">.<\/span><span class=\"token function\">push<\/span><span class=\"token punctuation\">(<\/span>n<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u8fd9\u6bd4\u628a\u6240\u6709 token \u5e73\u94fa\u6210\u6587\u672c\u66f4\u91cd\u8981&#xff1a;\u52a0\u7c97\u6587\u5b57\u53ef\u4ee5\u4f4d\u4e8e\u94fe\u63a5\u4e2d&#xff0c;\u5217\u8868\u53ef\u4ee5\u5305\u542b\u6bb5\u843d&#xff0c;\u5f15\u7528\u91cc\u9762\u53ef\u4ee5\u7ee7\u7eed\u6709\u4ee3\u7801\u3002\u4e22\u6389\u5d4c\u5957\u4e4b\u540e&#xff0c;\u518d\u60f3\u6062\u590d\u4ea4\u4e92\u5c31\u8981\u91cd\u65b0\u731c\u7ed3\u6784\u3002<\/p>\n<p>\u6807\u9898\u8282\u70b9\u5206\u914d heading-0\u3001heading-1 \u8fd9\u6837\u7684\u987a\u5e8f ID&#xff08;\u4e0a\u4e00\u6bb5\u4ee3\u7801\u91cc\u80fd\u770b\u5230\u767b\u8bb0 headings \u7684\u90a3\u51e0\u884c&#xff09;&#xff0c;\u4e2d\u6587\u548c\u91cd\u590d\u6807\u9898\u4e0d\u4f1a\u56e0\u4e3a\u6587\u672c\u76f8\u540c\u649e ID\u3002\u771f\u6b63\u9700\u8981\u5355\u72ec\u5904\u7406\u7684\u662f\u6807\u9898\u7684\u6587\u672c&#xff0c;\u5b83\u5e76\u4e0d\u5728\u5f00\u6807\u7b7e\u4e0a&#xff1a;<\/p>\n<p><span class=\"token comment\">\/\/ src\/core\/markdown.ts&#xff1a;\u6807\u9898\u6587\u672c\u7531 inline \u5b50\u5185\u5bb9\u62fc\u56de&#xff0c;\u4e0d\u8bfb\u5f00\u6807\u7b7e\u7684 content\u3002<\/span><br \/>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>token<span class=\"token punctuation\">.<\/span>type <span class=\"token operator\">&#061;&#061;&#061;<\/span> <span class=\"token string\">&#034;inline&#034;<\/span> <span class=\"token operator\">&amp;&amp;<\/span> stack<span class=\"token punctuation\">[<\/span>stack<span class=\"token punctuation\">.<\/span>length <span class=\"token operator\">&#8211;<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">.<\/span>type <span class=\"token operator\">&#061;&#061;&#061;<\/span> <span class=\"token string\">&#034;heading_open&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n  headings<span class=\"token punctuation\">[<\/span>headings<span class=\"token punctuation\">.<\/span>length <span class=\"token operator\">&#8211;<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">.<\/span>title <span class=\"token operator\">&#061;<\/span><br \/>\n    token<span class=\"token punctuation\">.<\/span>children<span class=\"token operator\">?.<\/span><span class=\"token function\">map<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">(<\/span>t<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;&gt;<\/span> t<span class=\"token punctuation\">.<\/span>content<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">join<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;&#034;<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">||<\/span> token<span class=\"token punctuation\">.<\/span>content<span class=\"token punctuation\">;<\/span><\/p>\n<p>heading_open \u7684 content \u662f\u7a7a\u7684\u3002\u771f\u6b63\u7684\u6587\u5b57\u843d\u5728\u7d27\u968f\u5176\u540e\u7684 inline \u5b50\u8282\u70b9\u91cc&#xff0c;\u800c\u4e14\u53ef\u80fd\u88ab\u62c6\u6210\u201c\u6587\u5b57 &#043; \u884c\u5185\u4ee3\u7801 &#043; \u6587\u5b57\u201d\u51e0\u6bb5&#xff0c;\u6240\u4ee5\u8981 join \u62fc\u56de\u53bb\u3002\u5982\u679c\u6807\u9898\u5199\u6210 ## \u8ba4\u8bc6 &#096;useEffect&#096;&#xff0c;\u76f4\u63a5\u8bfb content \u4f1a\u5f97\u5230\u7a7a\u5b57\u7b26\u4e32&#xff0c;\u76ee\u5f55\u91cc\u90a3\u4e00\u6761\u5c31\u4f1a\u6d88\u5931\u3002\u8fd9\u7c7b\u95ee\u9898\u4e0d\u62a5\u9519&#xff0c;\u53ea\u662f\u8ba9\u76ee\u5f55\u5c11\u4e00\u884c\u2014\u2014\u6b63\u662f\u8fd9\u79cd\u9759\u9ed8&#xff0c;\u8ba9\u5b83\u503c\u5f97\u5355\u72ec\u5199\u4e00\u6bb5\u5bf9\u7167\u3002<\/p>\n<p>\u5f53\u524d\u6b63\u6587\u7ec4\u4ef6\u4e0e\u76ee\u5f55\u90fd\u8c03\u7528\u540c\u4e00\u4e2a parseMarkdown \u51fd\u6570&#xff0c;\u4f46\u5404\u81ea\u89e3\u6790\u4e00\u6b21&#xff0c;\u4e0d\u662f\u5171\u4eab\u540c\u4e00\u4e2a\u5185\u5b58\u7ed3\u679c\u5bf9\u8c61\u3002\u5171\u540c\u7b97\u6cd5\u786e\u4fdd\u5bf9\u5e94\u5173\u7cfb&#xff1b;\u5982\u679c\u957f\u6587\u6027\u80fd\u6d4b\u91cf\u663e\u793a\u91cd\u590d\u89e3\u6790\u6210\u672c\u660e\u663e&#xff0c;\u53ef\u4ee5\u63d0\u5347\u4e00\u6b21\u89e3\u6790\u7ed3\u679c\u7684\u6240\u6709\u6743\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261022124056-6ada045847c5e.png\" alt=\"\u89e3\u6790\u4e0e\u6e32\u67d3\" \/><\/p>\n<h3>\u9ad8\u4eae\u53ea\u52a0\u8f7d\u660e\u786e\u7684\u8bed\u8a00\u96c6\u5408<\/h3>\n<p>\u9879\u76ee\u53ea\u6ce8\u518c\u4e5d\u79cd\u8bed\u8a00\u5b9a\u4e49&#xff0c;\u800c\u4e0d\u662f\u6574\u5305\u5f15\u5165 highlight.js&#xff1a;<\/p>\n<p><span class=\"token comment\">\/\/ src\/core\/markdown.ts&#xff1a;\u9010\u4e2a\u6ce8\u518c&#xff0c;\u628a\u5305\u4f53\u79ef\u63a7\u5236\u5728\u53ef\u9884\u671f\u7684\u8303\u56f4\u3002<\/span><br \/>\n<span class=\"token keyword\">import<\/span> javascript <span class=\"token keyword\">from<\/span> <span class=\"token string\">&#034;highlight.js\/lib\/languages\/javascript&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token comment\">\/\/ \u2026typescript \/ json \/ css \/ xml \/ bash \/ python \/ dart \/ sql \u6309\u9700 import\u2026<\/span><br \/>\n<span class=\"token keyword\">for<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">const<\/span> <span class=\"token punctuation\">[<\/span>name<span class=\"token punctuation\">,<\/span> language<span class=\"token punctuation\">]<\/span> <span class=\"token keyword\">of<\/span> Object<span class=\"token punctuation\">.<\/span><span class=\"token function\">entries<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span><br \/>\n  javascript<span class=\"token punctuation\">,<\/span> typescript<span class=\"token punctuation\">,<\/span> json<span class=\"token punctuation\">,<\/span> css<span class=\"token punctuation\">,<\/span> xml<span class=\"token punctuation\">,<\/span> bash<span class=\"token punctuation\">,<\/span> python<span class=\"token punctuation\">,<\/span> dart<span class=\"token punctuation\">,<\/span> sql<span class=\"token punctuation\">,<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><br \/>\n  hljs<span class=\"token punctuation\">.<\/span><span class=\"token function\">registerLanguage<\/span><span class=\"token punctuation\">(<\/span>name<span class=\"token punctuation\">,<\/span> language<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>highlight.js\/lib\/core \u662f\u7cbe\u7b80\u5185\u6838&#xff0c;\u8bed\u8a00\u5fc5\u987b\u4e00\u4e2a\u4e2a registerLanguage \u624d\u751f\u6548\u3002\u8fd9\u6837\u505a\u7684\u597d\u5904\u662f\u5305\u4f53\u79ef\u53ef\u9884\u671f&#xff1b;\u4ee3\u4ef7\u662f\u6ca1\u6ce8\u518c\u7684\u8bed\u8a00\u4e00\u5f8b\u8d70\u7eaf\u6587\u672c\u5206\u652f&#xff0c;rust\u3001go \u8fd9\u7c7b\u4f1a\u539f\u6837\u663e\u793a\u3002\u5e93\u8fd8\u9644\u5e26\u4e00\u4e9b\u522b\u540d&#xff08;\u4f8b\u5982 js\u3001ts&#xff09;&#xff0c;\u522b\u540d\u80fd\u8bc6\u522b\u4e0d\u7b49\u4e8e\u4e3b\u540d\u4e4b\u5916\u7684\u90fd\u652f\u6301&#xff0c;\u4e0d\u80fd\u628a\u4efb\u610f\u8bed\u8a00\u90fd\u7b97\u8fdb\u6765\u3002<\/p>\n<p>\u56f4\u680f\u7b2c\u4e00\u6bb5\u4fe1\u606f\u4f5c\u4e3a\u8bed\u8a00\u540d&#xff0c;\u6ca1\u6709\u5c31\u663e\u793a text&#xff1a;<\/p>\n<p><span class=\"token keyword\">const<\/span> language <span class=\"token operator\">&#061;<\/span> n<span class=\"token punctuation\">.<\/span>info<span class=\"token punctuation\">.<\/span><span class=\"token function\">trim<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">split<\/span><span class=\"token punctuation\">(<\/span><span class=\"token regex\"><span class=\"token regex-delimiter\">\/<\/span><span class=\"token regex-source language-regex\">\\\\s&#043;<\/span><span class=\"token regex-delimiter\">\/<\/span><\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">||<\/span> <span class=\"token string\">&#039;text&#039;<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u4e0d\u4f7f\u7528\u81ea\u52a8\u8bed\u8a00\u731c\u6d4b&#xff0c;\u662f\u4e3a\u4e86\u51cf\u5c11\u610f\u5916\u548c\u8fd0\u884c\u6210\u672c\u3002\u6587\u7ae0\u4f5c\u8005\u6807\u6ce8 ts&#xff0c;\u8bfb\u8005\u5c31\u77e5\u9053\u5b83\u7684\u4e0a\u4e0b\u6587&#xff1b;\u672a\u77e5\u8bed\u8a00\u4fdd\u7559\u6807\u7b7e&#xff0c;\u540c\u65f6\u4ee5\u5b89\u5168\u7684\u666e\u901a\u4ee3\u7801\u663e\u793a\u3002<\/p>\n<p>\u590d\u5236\u6309\u94ae\u4f7f\u7528\u539f\u59cb n.content&#xff0c;\u800c\u4e0d\u662f\u9ad8\u4eae\u540e\u7684 HTML\u3002\u5426\u5219&#xff0c;\u8bfb\u8005\u4f1a\u590d\u5236\u5230 span \u6807\u7b7e\u6216\u5b9e\u4f53\u7f16\u7801\u3002\u4ee3\u7801\u7684\u5c55\u793a\u8868\u793a\u548c\u539f\u59cb\u5185\u5bb9\u5fc5\u987b\u5206\u5f00\u3002<\/p>\n<h4>\u8bed\u8a00\u6807\u7b7e\u4ee3\u8868\u4e0a\u4e0b\u6587&#xff0c;\u4e0d\u4ee3\u8868\u6267\u884c\u80fd\u529b<\/h4>\n<p>\u5de5\u5177\u6761\u9ed8\u8ba4\u63d2\u5165 TypeScript \u56f4\u680f&#xff0c;\u9605\u8bfb\u5668\u663e\u793a\u4f5c\u8005\u586b\u5199\u7684\u8bed\u8a00\u6807\u7b7e\u3002\u5b83\u4e0d\u4f1a\u6267\u884c\u4ee3\u7801&#xff0c;\u4e5f\u4e0d\u63d0\u4f9b\u5728\u7ebf\u6c99\u7bb1\u3002\u7528\u6237\u770b\u5230 python&#xff0c;\u53ea\u8bf4\u660e\u5185\u5bb9\u4e0a\u4e0b\u6587&#xff0c;\u4e0d\u8868\u793a\u5f53\u524d\u5c0f\u7a0b\u5e8f\u5b89\u88c5\u4e86 Python\u3002<\/p>\n<p>\u5df2\u8bc6\u522b\u8bed\u8a00\u9ad8\u4eae\u3001\u672a\u77e5\u8bed\u8a00\u7eaf\u6587\u672c&#xff0c;\u662f\u4e00\u4e2a\u6e10\u8fdb\u964d\u7ea7\u9009\u62e9\u3002\u81ea\u52a8\u731c\u8bed\u8a00\u6709\u65f6\u80fd\u7ed9\u672a\u6807\u6ce8\u4ee3\u7801\u52a0\u989c\u8272&#xff0c;\u4f46\u4e5f\u4f1a\u731c\u9519\u3002\u6559\u5b66\u6587\u7ae0\u66f4\u9700\u8981\u4f5c\u8005\u660e\u786e\u4e0a\u4e0b\u6587&#xff0c;\u56e0\u6b64\u5f53\u524d\u65b9\u6848\u628a\u6807\u6ce8\u8d23\u4efb\u7559\u7ed9\u5185\u5bb9\u3002<\/p>\n<p>\u9ad8\u4eae\u8f93\u51fa\u7684\u989c\u8272\u76ee\u524d\u662f\u5b9a\u4e49\u597d\u7684 token \u6620\u5c04\u3002\u5b83\u4e0e\u4e3b\u9898\u53d8\u91cf\u4e0d\u5b8c\u5168\u540c\u4e00\u5957\u7cfb\u7edf&#xff0c;\u6df1\u8272\u53ef\u8bfb\u6027\u8981\u5728\u5177\u4f53\u6837\u672c\u4e0a\u89c2\u5bdf\u3002\u4ee5\u540e\u82e5\u6269\u5c55\u8bed\u8a00&#xff0c;\u5e94\u4e00\u8d77\u8bc4\u4f30\u5305\u4f53\u4e0e\u957f\u4ee3\u7801\u89e3\u6790\u6210\u672c&#xff0c;\u4e0d\u80fd\u65e0\u9650\u6ce8\u518c\u6574\u5e93\u7136\u540e\u7528\u4e00\u6b21\u6784\u5efa\u6210\u529f\u66ff\u4ee3\u6027\u80fd\u68c0\u67e5\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261022124057-6ada0459602c5.png\" alt=\"\u8bed\u8a00\u96c6\u5408\" \/><\/p>\n<h3>\u53d7\u63a7 RichText&#xff0c;\u4ecd\u7136\u8981\u8f6c\u4e49<\/h3>\n<p>\u672a\u77e5\u8bed\u8a00\u5148\u8f6c\u4e49 &amp;\u3001&lt;\u3001&gt;&#xff1b;\u5df2\u77e5\u8bed\u8a00\u901a\u8fc7 highlight.js \u751f\u6210\u6807\u8bb0&#xff0c;\u518d\u628a\u9ad8\u4eae class \u8f6c\u6210\u53d7\u63a7\u989c\u8272\u6837\u5f0f\u3002\u8f93\u51fa\u53ea\u7528\u4e8e\u4ee3\u7801\u533a\u57df\u7684 RichText\u3002<\/p>\n<p><span class=\"token comment\">\/\/ src\/core\/markdown.ts&#xff1a;\u672a\u77e5\u8bed\u8a00\u8f6c\u4e49\u540e\u539f\u6837\u8fd4\u56de\u3002<\/span><br \/>\n<span class=\"token keyword\">const<\/span> escaped <span class=\"token operator\">&#061;<\/span> code<span class=\"token punctuation\">.<\/span><span class=\"token function\">replace<\/span><span class=\"token punctuation\">(<\/span><span class=\"token regex\"><span class=\"token regex-delimiter\">\/<\/span><span class=\"token regex-source language-regex\">&amp;<\/span><span class=\"token regex-delimiter\">\/<\/span><span class=\"token regex-flags\">g<\/span><\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;&amp;amp;&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">replace<\/span><span class=\"token punctuation\">(<\/span><span class=\"token regex\"><span class=\"token regex-delimiter\">\/<\/span><span class=\"token regex-source language-regex\">&lt;<\/span><span class=\"token regex-delimiter\">\/<\/span><span class=\"token regex-flags\">g<\/span><\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;&amp;lt;&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">replace<\/span><span class=\"token punctuation\">(<\/span><span class=\"token regex\"><span class=\"token regex-delimiter\">\/<\/span><span class=\"token regex-source language-regex\">&gt;<\/span><span class=\"token regex-delimiter\">\/<\/span><span class=\"token regex-flags\">g<\/span><\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;&amp;gt;&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span>language <span class=\"token operator\">||<\/span> <span class=\"token operator\">!<\/span>hljs<span class=\"token punctuation\">.<\/span><span class=\"token function\">getLanguage<\/span><span class=\"token punctuation\">(<\/span>language<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">return<\/span> escaped<span class=\"token punctuation\">;<\/span><\/p>\n<p>\u9ad8\u4eae\u7ed3\u679c\u5e26\u7684\u662f hljs-keyword \u8fd9\u7c7b class&#xff0c;\u800c\u5c0f\u7a0b\u5e8f rich-text \u63a5\u4e0d\u4f4f\u5916\u90e8\u6837\u5f0f\u8868&#xff0c;\u6240\u4ee5\u8981\u628a class \u6362\u6210\u5185\u8054 style&#xff1a;<\/p>\n<p><span class=\"token comment\">\/\/ src\/core\/markdown.ts&#xff1a;\u628a\u9ad8\u4eae class \u5f52\u5230\u4e94\u4e2a\u8bed\u4e49\u8272&#xff0c;\u907f\u514d\u5f15\u5165\u5b8c\u6574\u4e3b\u9898 CSS\u3002<\/span><br \/>\n<span class=\"token keyword\">return<\/span> hljs<span class=\"token punctuation\">.<\/span><span class=\"token function\">highlight<\/span><span class=\"token punctuation\">(<\/span>code<span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">{<\/span> language<span class=\"token punctuation\">,<\/span> ignoreIllegals<span class=\"token operator\">:<\/span> <span class=\"token boolean\">true<\/span> <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span>value<br \/>\n  <span class=\"token punctuation\">.<\/span><span class=\"token function\">replace<\/span><span class=\"token punctuation\">(<\/span><span class=\"token regex\"><span class=\"token regex-delimiter\">\/<\/span><span class=\"token regex-source language-regex\">class&#061;&#034;([^&#034;]&#043;)&#034;<\/span><span class=\"token regex-delimiter\">\/<\/span><span class=\"token regex-flags\">g<\/span><\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">(<\/span>_<span class=\"token punctuation\">,<\/span> classes<span class=\"token operator\">:<\/span> <span class=\"token builtin\">string<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;&gt;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> color <span class=\"token operator\">&#061;<\/span> <span class=\"token regex\"><span class=\"token regex-delimiter\">\/<\/span><span class=\"token regex-source language-regex\">keyword|literal|built_in<\/span><span class=\"token regex-delimiter\">\/<\/span><\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">test<\/span><span class=\"token punctuation\">(<\/span>classes<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">?<\/span> <span class=\"token string\">&#034;#b078c4&#034;<\/span><br \/>\n      <span class=\"token operator\">:<\/span> <span class=\"token regex\"><span class=\"token regex-delimiter\">\/<\/span><span class=\"token regex-source language-regex\">string|attr<\/span><span class=\"token regex-delimiter\">\/<\/span><\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">test<\/span><span class=\"token punctuation\">(<\/span>classes<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">?<\/span> <span class=\"token string\">&#034;#58a281&#034;<\/span><br \/>\n        <span class=\"token operator\">:<\/span> <span class=\"token regex\"><span class=\"token regex-delimiter\">\/<\/span><span class=\"token regex-source language-regex\">number|symbol<\/span><span class=\"token regex-delimiter\">\/<\/span><\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">test<\/span><span class=\"token punctuation\">(<\/span>classes<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">?<\/span> <span class=\"token string\">&#034;#cc8c55&#034;<\/span><br \/>\n          <span class=\"token operator\">:<\/span> <span class=\"token regex\"><span class=\"token regex-delimiter\">\/<\/span><span class=\"token regex-source language-regex\">comment<\/span><span class=\"token regex-delimiter\">\/<\/span><\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">test<\/span><span class=\"token punctuation\">(<\/span>classes<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">?<\/span> <span class=\"token string\">&#034;#8192a4&#034;<\/span> <span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;#6095ca&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token template-string\"><span class=\"token template-punctuation string\">&#096;<\/span><span class=\"token string\">style&#061;&#034;color:<\/span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${<\/span>color<span class=\"token interpolation-punctuation punctuation\">}<\/span><\/span><span class=\"token string\">&#034;<\/span><span class=\"token template-punctuation string\">&#096;<\/span><\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<table>\n<tr>\u5339\u914d\u5230\u7684 class\u8bed\u4e49\u989c\u8272<\/tr>\n<tbody>\n<tr>\n<td>keyword \/ literal \/ built_in<\/td>\n<td>\u5173\u952e\u5b57\u4e0e\u5185\u7f6e\u540d<\/td>\n<td>#b078c4<\/td>\n<\/tr>\n<tr>\n<td>string \/ attr<\/td>\n<td>\u5b57\u7b26\u4e32\u4e0e\u5c5e\u6027<\/td>\n<td>#58a281<\/td>\n<\/tr>\n<tr>\n<td>number \/ symbol<\/td>\n<td>\u6570\u5b57\u4e0e\u7b26\u53f7<\/td>\n<td>#cc8c55<\/td>\n<\/tr>\n<tr>\n<td>comment<\/td>\n<td>\u6ce8\u91ca<\/td>\n<td>#8192a4<\/td>\n<\/tr>\n<tr>\n<td>\u5176\u4f59<\/td>\n<td>\u9ed8\u8ba4\u6587\u5b57<\/td>\n<td>#6095ca<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd9\u5957\u8272\u503c\u5199\u6b7b\u5728\u4ee3\u7801\u91cc&#xff0c;\u548c\u4e3b\u9898\u53d8\u91cf\u4e0d\u662f\u540c\u4e00\u5957\u7cfb\u7edf\u3002\u597d\u5904\u662f\u6df1\u6d45\u8272\u884c\u4e3a\u4e00\u81f4\u3001\u65e0\u9700\u989d\u5916\u6837\u5f0f\u8868&#xff1b;\u4ee3\u4ef7\u662f\u5b83\u4e0d\u968f\u4e3b\u9898\u8d70&#xff0c;\u4e3b\u9898\u5927\u6539\u65f6\u8981\u56de\u6765\u4e00\u8d77\u770b\u3002ignoreIllegals \u8ba9\u4e0d\u5b8c\u6574\u6216\u5199\u9519\u7684\u4ee3\u7801\u4e5f\u80fd\u9ad8\u4eae\u800c\u4e0d\u629b\u9519\u2014\u2014\u9605\u8bfb\u5668\u5c55\u793a\u7684\u662f\u5feb\u7167&#xff0c;\u4e0d\u8be5\u56e0\u4e3a\u4f5c\u8005\u5c11\u6253\u4e00\u4e2a\u62ec\u53f7\u5c31\u6574\u5757\u53d8\u7ea2\u3002<\/p>\n<p>\u8fd9\u80fd\u8ba9 &lt;script&gt; \u4f5c\u4e3a\u4ee3\u7801\u6587\u672c\u51fa\u73b0&#xff0c;\u800c\u4e0d\u662f\u88ab\u5f53\u6210\u9875\u9762\u7ed3\u6784\u3002\u5173\u95ed\u539f\u59cb HTML \u548c\u4ee3\u7801\u8f6c\u4e49\u89e3\u51b3\u4e0d\u540c\u5165\u53e3&#xff0c;\u4e0d\u80fd\u7701\u7565\u4efb\u4f55\u4e00\u4e2a\u3002<\/p>\n<p>\u800c\u590d\u5236\u5165\u53e3\u5199\u56de\u7684\u662f\u539f\u59cb\u5185\u5bb9&#xff0c;\u4e0d\u662f\u5e26 span \u7684\u6807\u8bb0\u3002\u4e24\u5904\u4e00\u65e6\u6df7\u7528&#xff0c;\u8bfb\u8005\u62ff\u5230\u7684\u5c31\u4e0d\u662f\u4ee3\u7801&#xff1a;<\/p>\n<p>\/\/ src\/features\/markdown.tsx&#xff1a;\u590d\u5236\u6309\u94ae\u53d6 n.content&#xff0c;\u800c\u975e\u9ad8\u4eae\u540e\u7684 HTML\u3002<br \/>\n&lt;Button className&#061;&#034;link&#034; onClick&#061;{() &#061;&gt; Taro.setClipboardData({ data: n.content })}&gt;<br \/>\n  \u590d\u5236<br \/>\n&lt;\/Button&gt;<\/p>\n<p>\u4f46\u5b83\u4e5f\u4e0d\u662f\u9488\u5bf9\u6240\u6709\u7f51\u7edc\u8d44\u6e90\u7684\u5b89\u5168\u8ba4\u8bc1\u3002\u56fe\u7247\u4ecd\u53ef\u80fd\u6765\u81ea\u5916\u90e8 HTTP(S) \u5730\u5740&#xff0c;\u662f\u5426\u52a0\u8f7d\u53d7\u7f51\u7edc\u548c\u5e73\u53f0\u6761\u4ef6\u5f71\u54cd&#xff1b;\u94fe\u63a5\u9700\u8981\u7edf\u4e00\u8def\u7531\u89c4\u5219\u3002\u9605\u8bfb\u5668\u63a7\u5236\u7684\u662f\u5982\u4f55\u6e32\u67d3\u548c\u89e6\u53d1\u52a8\u4f5c&#xff0c;\u4e0d\u662f\u8bc1\u660e\u6240\u6709\u6765\u6e90\u90fd\u53ef\u4fe1\u3002<\/p>\n<h3>\u6a2a\u5411\u6eda\u52a8\u662f\u4e00\u79cd\u5185\u5bb9\u4fdd\u62a4<\/h3>\n<p>\u957f\u4ee3\u7801\u5f3a\u884c\u6362\u884c\u4f1a\u6539\u53d8\u5bf9\u9f50&#xff0c;\u8868\u683c\u6324\u8fdb\u624b\u673a\u5bbd\u5ea6\u4f1a\u8ba9\u5217\u5931\u53bb\u610f\u4e49\u3002\u56e0\u6b64&#xff0c;\u4ee3\u7801\u5757\u548c\u8868\u683c\u90fd\u5957\u4e00\u5c42\u6a2a\u5411\u6eda\u52a8\u5bb9\u5668&#xff0c;\u8ba9\u6b63\u6587\u4fdd\u6301\u7eb5\u5411\u9605\u8bfb&#xff1a;<\/p>\n<p>\/\/ src\/features\/markdown.tsx&#xff1a;\u4ee3\u7801\u5757\u5c40\u90e8\u6a2a\u5411\u6eda\u52a8&#xff0c;\u590d\u5236\u6309\u94ae\u56fa\u5b9a\u5728\u6807\u9898\u680f\u3002<br \/>\n&lt;View className&#061;&#034;code-block&#034;&gt;<br \/>\n  &lt;View className&#061;&#034;row between code-head&#034;&gt;<br \/>\n    &lt;Text&gt;{language}&lt;\/Text&gt;<br \/>\n    &lt;Button className&#061;&#034;link&#034; onClick&#061;{() &#061;&gt; Taro.setClipboardData({ data: n.content })}&gt;\u590d\u5236&lt;\/Button&gt;<br \/>\n  &lt;\/View&gt;<br \/>\n  &lt;ScrollView scrollX&gt;<br \/>\n    &lt;RichText<br \/>\n      nodes&#061;{&#096;&lt;pre style&#061;&#034;margin:0;white-space:pre;font-family:monospace&#034;&gt;${highlight(n.content, language)}&lt;\/pre&gt;&#096;}<br \/>\n    \/&gt;<br \/>\n  &lt;\/ScrollView&gt;<br \/>\n&lt;\/View&gt;<\/p>\n<p>scrollX \u53ea\u52a0\u5728\u4ee3\u7801\u5757\u8fd9\u4e00\u5c42&#xff0c;\u5916\u5c42\u7684 .markdown \u7528 overflow-wrap:anywhere \u515c\u5e95&#xff0c;\u4fdd\u8bc1\u6574\u4e2a\u9875\u9762\u4e0d\u4f1a\u6a2a\u5411\u6ea2\u51fa\u2014\u2014\u5426\u5219\u76ee\u5f55\u6d6e\u52a8\u6309\u94ae\u3001\u8bc4\u8bba\u548c\u5e95\u90e8\u64cd\u4f5c\u90fd\u4f1a\u8ddf\u7740\u8dd1\u504f\u3002\u4ee3\u7801\u5185\u5bb9\u7528\u5185\u8054 white-space:pre \u4fdd\u7559\u7f29\u8fdb&#xff0c;.code-body \u7684 min-width:100% \u8ba9\u77ed\u4ee3\u7801\u6491\u6ee1\u5bbd\u5ea6\u3001\u957f\u4ee3\u7801\u6a2a\u5411\u6eda\u52a8\u800c\u975e\u6362\u884c\u3002\u8868\u683c\u540c\u7406&#xff1a;.md-table \u7528 display:table \u52a0 min-width:100%&#xff0c;\u6bcf\u4e00\u5217 min-width:150px&#xff0c;\u5b81\u53ef\u8ba9\u8bfb\u8005\u6a2a\u5411\u6ed1&#xff0c;\u4e5f\u4e0d\u628a\u5217\u538b\u5230\u4e0d\u53ef\u8bfb\u3002<\/p>\n<p>\u8fd9\u79cd\u65b9\u6848\u4e5f\u6709\u4ee3\u4ef7&#xff1a;\u8bfb\u8005\u9700\u8981\u53d1\u73b0\u6a2a\u5411\u533a\u57df&#xff0c;\u4ee3\u7801\u590d\u5236\u5165\u53e3\u8981\u7a33\u5b9a\u53ef\u89c1\u3002\u6240\u4ee5\u6211\u4eec\u628a\u590d\u5236\u6309\u94ae\u56fa\u5b9a\u5728\u6807\u9898\u680f\u53f3\u4fa7&#xff0c;\u8ba9\u5b83\u4e0d\u8ddf\u7740\u4ee3\u7801\u4e00\u8d77\u6a2a\u5411\u6eda\u52a8\u3002<\/p>\n<p>\u56fe\u7247\u4f7f\u7528 widthFix \u4fdd\u6301\u6bd4\u4f8b&#xff0c;\u5e76\u9650\u5236\u975e HTTP(S) \u6765\u6e90\u7684\u5f53\u524d\u5c55\u793a\u65b9\u5f0f\u3002\u94fe\u63a5\u901a\u8fc7\u7edf\u4e00 openLink&#xff0c;\u8ba9\u4e00\u7bc7\u6587\u7ae0\u4e2d\u7684\u4e0d\u540c\u94fe\u63a5\u9075\u5faa\u76f8\u540c\u5e73\u53f0\u8fb9\u754c&#xff0c;\u4e0d\u7531\u6bcf\u4e2a\u8282\u70b9\u968f\u610f\u6253\u5f00\u3002<\/p>\n<h3>\u4e09\u5c42\u6240\u6709\u6743&#xff0c;\u548c\u5b83\u4eec\u5404\u81ea\u7684\u8d44\u6e90\u8fb9\u754c<\/h3>\n<h4>\u539f\u6587\u3001\u89e3\u6790\u7ed3\u679c\u548c\u663e\u793a\u8282\u70b9\u5404\u6709\u6240\u6709\u6743<\/h4>\n<p>Markdown \u539f\u6587\u7531\u540e\u7aef\u5185\u5bb9\u5b57\u6bb5\u63d0\u4f9b&#xff0c;\u89e3\u6790\u7ed3\u679c\u7531\u9605\u8bfb\u5668\u751f\u6210&#xff0c;\u7ec4\u4ef6\u72b6\u6001\u53ea\u5904\u7406\u5f53\u524d\u4ea4\u4e92\u3002\u590d\u5236\u64cd\u4f5c\u56de\u5230\u539f\u6587&#xff0c;\u76ee\u5f55\u4f9d\u8d56\u89e3\u6790 ID&#xff0c;\u56fe\u7247\u9884\u89c8\u4f9d\u8d56\u53d7\u63a7 URL\u3002\u628a\u4e09\u5c42\u6df7\u5408&#xff0c;\u540e\u7eed\u7f16\u8f91\u9884\u89c8\u5c31\u5bb9\u6613\u51fa\u73b0\u4e24\u79cd\u5185\u5bb9\u5b9a\u4e49\u3002<\/p>\n<p>\u5f53\u524d\u9884\u89c8\u590d\u7528 Markdown \u7ec4\u4ef6&#xff0c;\u6240\u4ee5\u76f8\u540c\u8bed\u6cd5\u6cbf\u7528\u540c\u4e00\u89e3\u6790\u884c\u4e3a\u3002\u4f46\u7f16\u8f91\u5668\u53ea\u9884\u89c8\u6807\u9898\u548c\u6b63\u6587&#xff0c;\u5e76\u975e\u5b8c\u6574\u6a21\u62df\u516c\u5f00\u6587\u7ae0\u9875\u3002\u5c01\u9762\u3001\u6458\u8981\u3001\u4e92\u52a8\u548c\u63a8\u8350\u6ca1\u6709\u56e0\u4e3a\u7ec4\u4ef6\u5171\u4eab\u5c31\u5168\u90e8\u8fdb\u5165\u9884\u89c8\u3002<\/p>\n<h4>\u53d7\u63a7\u6e32\u67d3\u8fd8\u6709\u8d44\u6e90\u8fb9\u754c<\/h4>\n<p>\u4e00\u7bc7\u5de8\u5927\u6587\u7ae0\u4ecd\u53ef\u80fd\u6d88\u8017\u89e3\u6790\u4e0e\u8282\u70b9\u6e32\u67d3\u65f6\u95f4&#xff0c;\u5927\u56fe\u7247\u4ecd\u53ef\u80fd\u5f71\u54cd\u5e03\u5c40\u4e0e\u7f51\u7edc\u3002\u5173\u95ed HTML \u4e0d\u4f1a\u81ea\u52a8\u89e3\u51b3\u8d44\u6e90\u6d88\u8017\u3002\u82e5\u672a\u6765\u5b9e\u9645\u6570\u636e\u53d8\u957f&#xff0c;\u5e94\u5148\u6d4b\u89e3\u6790\u3001\u8282\u70b9\u6570\u91cf\u548c\u56fe\u7247\u52a0\u8f7d&#xff0c;\u518d\u8003\u8651\u7f13\u5b58\u89e3\u6790\u7ed3\u679c\u6216\u9650\u5236\u5355\u6b21\u5c55\u793a\u8303\u56f4\u3002<\/p>\n<p>\u672c\u6b21\u6ca1\u6709\u516c\u5e03\u9605\u8bfb\u5668\u6027\u80fd\u57fa\u51c6&#xff0c;\u56e0\u6b64\u6587\u7ae0\u4e0d\u5199\u201c\u957f\u6587\u6beb\u65e0\u538b\u529b\u201d\u3002\u6211\u4eec\u5df2\u7ecf\u6709\u660e\u786e\u7ed3\u6784\u4e0e\u9a8c\u8bc1\u5165\u53e3&#xff0c;\u63a5\u4e0b\u6765\u53ef\u4ee5\u4f9d\u636e\u771f\u5b9e\u6d4b\u91cf\u4f18\u5316&#xff0c;\u800c\u4e0d\u662f\u9760\u5e93\u540d\u8bc1\u660e\u8868\u73b0\u3002<\/p>\n<h4>\u56fe\u7247\u4e0e\u4ee3\u7801\u7684\u5931\u8d25\u4e0d\u8981\u963b\u65ad\u6574\u7bc7\u6587\u5b57<\/h4>\n<p>\u5185\u5bb9\u8282\u70b9\u6709\u81ea\u5df1\u7684\u964d\u7ea7\u65b9\u5f0f&#xff0c;\u672a\u77e5\u8bed\u8a00\u4ecd\u80fd\u8bfb&#xff0c;\u975e\u652f\u6301\u56fe\u7247\u6765\u6e90\u4fdd\u7559\u6587\u5b57\u3002\u540e\u7eed\u82e5\u589e\u52a0\u56fe\u7247\u5931\u8d25\u5360\u4f4d&#xff0c;\u5e94\u9488\u5bf9\u5177\u4f53\u8282\u70b9\u5904\u7406&#xff0c;\u800c\u4e0d\u662f\u8ba9\u4e00\u5f20\u52a0\u8f7d\u5931\u8d25\u7684\u56fe\u628a\u5168\u6587\u66ff\u6362\u6210\u9519\u8bef\u9875\u3002\u6587\u7ae0\u6b63\u6587\u7684\u8fde\u7eed\u6027&#xff0c;\u6bd4\u5916\u56f4\u8d44\u6e90\u5168\u90e8\u6210\u529f\u66f4\u91cd\u8981\u3002<\/p>\n<h3>\u56de\u5f52\u6837\u672c\u68c0\u9a8c\u5d4c\u5957&#xff0c;\u800c\u4e0d\u662f\u6bcf\u79cd\u8bed\u6cd5\u5404\u5199\u4e00\u884c<\/h3>\n<p>\u5355\u72ec\u6d4b\u8bd5\u6807\u9898\u3001\u94fe\u63a5\u4e0e\u52a0\u7c97\u90fd\u901a\u8fc7&#xff0c;\u4ecd\u53ef\u80fd\u5728\u201c\u6807\u9898\u91cc\u542b\u884c\u5185\u4ee3\u7801\u201d\u201c\u94fe\u63a5\u91cc\u542b\u5f3a\u8c03\u201d\u65f6\u51fa\u9519\u3002\u89e3\u6790\u5668\u7684\u4ef7\u503c\u5728\u4e8e\u4fdd\u7559\u5d4c\u5957&#xff0c;\u56de\u5f52\u6837\u672c\u4e5f\u5e94\u8be5\u68c0\u9a8c\u5d4c\u5957\u3002<\/p>\n<p>\u73b0\u6709\u5355\u5143\u6d4b\u8bd5\u5c31\u538b\u5728\u8fd9\u51e0\u4e2a\u6700\u5bb9\u6613\u51fa\u9519\u7684\u5730\u65b9\u2014\u2014\u540c\u4e00\u4efd\u8f93\u5165\u91cc\u540c\u65f6\u653e\u4e24\u4e2a\u540c\u540d\u6807\u9898\u3001\u4e00\u6bb5 &lt;script&gt; \u548c\u4e00\u4e2a\u672a\u77e5\u8bed\u8a00\u4ee3\u7801\u5757&#xff1a;<\/p>\n<p><span class=\"token comment\">\/\/ test\/core.test.ts&#xff1a;\u76ee\u5f55\u552f\u4e00\u3001HTML \u4e0d\u6267\u884c\u3001\u672a\u77e5\u8bed\u8a00\u8f6c\u4e49\u3002<\/span><br \/>\n<span class=\"token keyword\">const<\/span> parsed <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">parseMarkdown<\/span><span class=\"token punctuation\">(<\/span><br \/>\n  <span class=\"token string\">&#034;# \u6807\u9898\\\\n## \u6807\u9898\\\\n&lt;script&gt;alert(1)&lt;\/script&gt;\\\\n&#096;&#096;&#096;typescript\\\\nconst a &#061; 1\\\\n&#096;&#096;&#096;&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\nassert<span class=\"token punctuation\">.<\/span><span class=\"token function\">deepEqual<\/span><span class=\"token punctuation\">(<\/span>parsed<span class=\"token punctuation\">.<\/span>headings<span class=\"token punctuation\">.<\/span><span class=\"token function\">map<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">(<\/span>h<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;&gt;<\/span> h<span class=\"token punctuation\">.<\/span>id<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;heading-0&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;heading-1&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\nassert<span class=\"token punctuation\">.<\/span><span class=\"token function\">equal<\/span><span class=\"token punctuation\">(<\/span>parsed<span class=\"token punctuation\">.<\/span>nodes<span class=\"token punctuation\">.<\/span><span class=\"token function\">some<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">(<\/span>n<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;&gt;<\/span> n<span class=\"token punctuation\">.<\/span>type <span class=\"token operator\">&#061;&#061;&#061;<\/span> <span class=\"token string\">&#034;html_block&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\nassert<span class=\"token punctuation\">.<\/span><span class=\"token function\">ok<\/span><span class=\"token punctuation\">(<\/span><span class=\"token function\">highlight<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;const a &#061; 1&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;typescript&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">includes<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;style&#061;&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\nassert<span class=\"token punctuation\">.<\/span><span class=\"token function\">equal<\/span><span class=\"token punctuation\">(<\/span><span class=\"token function\">highlight<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;&lt;script&gt;&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;unknown&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;&amp;lt;script&amp;gt;&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u56db\u6761\u65ad\u8a00\u6070\u597d\u8986\u76d6\u56db\u4e2a\u4e89\u8bae\u70b9&#xff1a;\u4e24\u4e2a\u540c\u540d\u6807\u9898\u62ff\u5230\u4e0d\u540c ID&#xff1b;\u5173\u95ed HTML \u540e html_block \u8282\u70b9\u6839\u672c\u4e0d\u5b58\u5728&#xff1b;\u5df2\u77e5\u8bed\u8a00\u4ea7\u51fa\u5e26 style \u7684\u9ad8\u4eae&#xff1b;\u672a\u77e5\u8bed\u8a00\u628a\u5c16\u62ec\u53f7\u8f6c\u4e49\u6210\u5b9e\u4f53\u3002\u8fd9\u6bd4\u6bcf\u79cd\u8bed\u6cd5\u5199\u4e00\u884c\u66f4\u63a5\u8fd1\u771f\u5b9e\u6587\u7ae0\u2014\u2014\u540c\u4e00\u6bb5\u5185\u5bb9\u91cc&#xff0c;\u51e0\u79cd\u7ed3\u6784\u672c\u6765\u5c31\u662f\u540c\u65f6\u51fa\u73b0\u7684\u3002<\/p>\n<p>\u66f4\u5b8c\u6574\u7684\u6837\u672c&#xff08;\u5f15\u7528\u4e2d\u7684\u5217\u8868\u3001\u5217\u8868\u91cc\u7684\u94fe\u63a5\u3001\u591a\u5217\u8868\u683c&#xff09;\u4ecd\u5728\u4eba\u5de5\u56de\u5f52\u6e05\u5355\u4e0a&#xff0c;\u5c5e\u4e8e\u5efa\u8bae\u77e9\u9635&#xff0c;\u5c1a\u672a\u505a\u6210\u81ea\u52a8\u5316\u7528\u4f8b\u3002<\/p>\n<h3>\u9a8c\u8bc1\u62ff\u771f\u5b9e\u6587\u7ae0\u8bf4\u8bdd<\/h3>\n<p>\u5f00\u53d1\u5de5\u5177\u91cc\u5b9e\u9645\u9605\u8bfb\u8fc7 M3-24&#xff0c;\u89c2\u5bdf\u4e86\u8868\u683c\u3001TypeScript&#xff0f;TSX \u4ee3\u7801\u4e0e\u76ee\u5f55\u8df3\u8f6c&#xff1b;\u903b\u8f91\u6d4b\u8bd5\u9a8c\u8bc1\u89e3\u6790\u548c\u9ad8\u4eae\u76f8\u5173\u884c\u4e3a\u3002\u5b83\u4eec\u80fd\u8bc1\u660e\u5f53\u524d\u6837\u672c&#xff0c;\u4e0d\u80fd\u8986\u76d6\u6240\u6709\u8bed\u6cd5\u7ec4\u5408\u548c\u6240\u6709\u8bbe\u5907\u5e03\u5c40\u3002<\/p>\n<p>\u540e\u7eed\u56de\u5f52\u5e94\u56fa\u5b9a\u4e00\u4efd\u7efc\u5408\u6837\u672c&#xff1a;\u4e2d\u6587\u91cd\u590d\u6807\u9898\u3001\u5d4c\u5957\u5217\u8868\u3001\u672a\u77e5\u8bed\u8a00\u3001\u5305\u542b\u5c16\u62ec\u53f7\u7684\u4ee3\u7801\u3001\u957f\u8868\u683c\u548c\u574f\u94fe\u63a5\u3002\u5c24\u5176\u8981\u786e\u8ba4\u590d\u5236\u5f97\u5230\u539f\u6587&#xff0c;\u800c\u975e\u6e32\u67d3\u6807\u8bb0\u3002\u8fd9\u662f\u4e00\u4efd\u5efa\u8bae\u77e9\u9635&#xff0c;\u4e0d\u662f\u8865\u5199\u51fa\u6765\u7684\u65e2\u6709\u9a8c\u6536\u7ed3\u679c\u3002<\/p>\n<p>\u66f4\u591a\u9605\u8bfb\u884c\u4e3a\u89c1\u76ee\u5f55\u3001\u4e0a\u4e0b\u7bc7\u4e0e\u5916\u94fe\u8def\u7531&#xff0c;\u7f16\u8f91\u9884\u89c8\u89c1 Markdown \u6295\u7a3f\u7f16\u8f91\u5668\u3002\u89e3\u6790\u4e0e\u6e32\u67d3\u8fb9\u754c\u6e05\u695a\u540e&#xff0c;\u540c\u4e00\u4efd\u5185\u5bb9\u624d\u80fd\u5728\u9605\u8bfb\u548c\u521b\u4f5c\u4e4b\u95f4\u4fdd\u6301\u4e00\u81f4\u3002<\/p>\n<h3>\u5ef6\u4f38\u9605\u8bfb<\/h3>\n<ul>\n<li>\u9996\u9875\u3001\u5206\u7c7b\u4e0e\u641c\u7d22&#xff1a;\u628a\u5185\u5bb9\u53d1\u73b0\u505a\u6210\u53ef\u6062\u590d\u7684\u6570\u636e\u6d41<\/li>\n<li>\u6587\u7ae0\u8be6\u60c5&#xff1a;Markdown\u3001\u4ee3\u7801\u9ad8\u4eae\u4e0e\u76ee\u5f55\u5fc5\u987b\u5171\u4eab\u89e3\u6790\u7ed3\u679c<\/li>\n<li>Markdown \u7f16\u8f91\u5668&#xff1a;\u9884\u89c8\u3001\u6697\u8272\u4e3b\u9898\u4e0e\u8fde\u7eed\u56fe\u7247\u7c98\u8d34<\/li>\n<\/ul>\n<hr \/>\n<p>\u5982\u679c\u8fd9\u7bc7\u6587\u7ae0\u5bf9\u4f60\u6709\u5e2e\u52a9&#xff0c;\u6b22\u8fce\u8ba2\u9605\u6211\u7684 CSDN \u4e13\u680f \u300c\u6210\u4e3a\u5168\u6808\u300d&#xff1a;<\/p>\n<p>&#x1f517; \u4e13\u680f\u5730\u5740&#xff1a;https:\/\/blog.csdn.net\/fungleo\/category_13204651.html<\/p>\n<p>&#x1f4e6; \u672c\u7cfb\u5217\u914d\u5957\u4ee3\u7801\u4ed3\u5e93&#xff1a;https:\/\/github.com\/fengcms\/become-a-full-stack-developer<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261022124058-6ada045a43ce0.png\" alt=\"\u6210\u4e3a\u5168\u6808\u4e13\u680f\u8ba2\u9605\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/#content_views .toc,\/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/#content_views.markdown_views &gt; p:empty:has(+ .toc),#content_views.markdown_views &gt; .toc + p:empty,\/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/#content<\/p>\n","protected":false},"author":2,"featured_media":117178,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[13178,13293,11686,3867,3834,555],"topic":[],"class_list":["post-117182","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-1024---","tag-highlight-js","tag-11686","tag-markdown","tag-taro","tag-555"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u6210\u4e3a\u5168\u6808\u00b7Taro \u5c0f\u7a0b\u5e8f\u7bc7\u00b7\u5c0f\u7a0b\u5e8f Markdown \u9605\u8bfb\u5668\uff1a\u4ece AST \u5230\u53d7\u63a7\u539f\u751f\u7ec4\u4ef6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/117182.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u6210\u4e3a\u5168\u6808\u00b7Taro \u5c0f\u7a0b\u5e8f\u7bc7\u00b7\u5c0f\u7a0b\u5e8f Markdown \u9605\u8bfb\u5668\uff1a\u4ece AST \u5230\u53d7\u63a7\u539f\u751f\u7ec4\u4ef6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/#content_views .toc,\/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/#content_views.markdown_views &gt; p:empty:has(+ .toc),#content_views.markdown_views &gt; .toc + p:empty,\/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/#content\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/117182.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-22T12:41:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261022124054-6ada0456e9404.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/117182.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/117182.html\",\"name\":\"\u6210\u4e3a\u5168\u6808\u00b7Taro \u5c0f\u7a0b\u5e8f\u7bc7\u00b7\u5c0f\u7a0b\u5e8f Markdown \u9605\u8bfb\u5668\uff1a\u4ece AST \u5230\u53d7\u63a7\u539f\u751f\u7ec4\u4ef6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-22T12:41:00+00:00\",\"dateModified\":\"2026-10-22T12:41:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/117182.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/117182.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/117182.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u6210\u4e3a\u5168\u6808\u00b7Taro \u5c0f\u7a0b\u5e8f\u7bc7\u00b7\u5c0f\u7a0b\u5e8f Markdown \u9605\u8bfb\u5668\uff1a\u4ece AST \u5230\u53d7\u63a7\u539f\u751f\u7ec4\u4ef6\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u6210\u4e3a\u5168\u6808\u00b7Taro \u5c0f\u7a0b\u5e8f\u7bc7\u00b7\u5c0f\u7a0b\u5e8f Markdown \u9605\u8bfb\u5668\uff1a\u4ece AST \u5230\u53d7\u63a7\u539f\u751f\u7ec4\u4ef6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/117182.html","og_locale":"zh_CN","og_type":"article","og_title":"\u6210\u4e3a\u5168\u6808\u00b7Taro \u5c0f\u7a0b\u5e8f\u7bc7\u00b7\u5c0f\u7a0b\u5e8f Markdown \u9605\u8bfb\u5668\uff1a\u4ece AST \u5230\u53d7\u63a7\u539f\u751f\u7ec4\u4ef6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/#content_views .toc,\/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/#content_views.markdown_views &gt; p:empty:has(+ .toc),#content_views.markdown_views &gt; .toc + p:empty,\/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/#content","og_url":"https:\/\/www.wsisp.com\/helps\/117182.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-22T12:41:00+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261022124054-6ada0456e9404.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/117182.html","url":"https:\/\/www.wsisp.com\/helps\/117182.html","name":"\u6210\u4e3a\u5168\u6808\u00b7Taro \u5c0f\u7a0b\u5e8f\u7bc7\u00b7\u5c0f\u7a0b\u5e8f Markdown \u9605\u8bfb\u5668\uff1a\u4ece AST \u5230\u53d7\u63a7\u539f\u751f\u7ec4\u4ef6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-22T12:41:00+00:00","dateModified":"2026-10-22T12:41:00+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/117182.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/117182.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/117182.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u6210\u4e3a\u5168\u6808\u00b7Taro \u5c0f\u7a0b\u5e8f\u7bc7\u00b7\u5c0f\u7a0b\u5e8f Markdown \u9605\u8bfb\u5668\uff1a\u4ece AST \u5230\u53d7\u63a7\u539f\u751f\u7ec4\u4ef6"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/117182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=117182"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/117182\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/117178"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=117182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=117182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=117182"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=117182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}