{"id":27162,"date":"2024-11-24T12:18:41","date_gmt":"2024-11-24T04:18:41","guid":{"rendered":"https:\/\/fwq.ai\/blog\/27162\/"},"modified":"2024-11-24T12:18:41","modified_gmt":"2024-11-24T04:18:41","slug":"%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%e6%a0%87%e7%ad%be%e5%8c%85%e8%a3%b9%e4%bb%a3%e7%a0%81%e6%97%b6%ef%bc%8c%e6%8d%a2%e8%a1%8c%e8%a7%a3%e6%9e%90%e5%88%b0%e6%a0%87%e7%ad%be%e5%a4%96%e9%83%a8%e7%9a%84-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/27162\/","title":{"rendered":"\u5982\u4f55\u89e3\u51b3\u6807\u7b7e\u5305\u88f9\u4ee3\u7801\u65f6\uff0c\u6362\u884c\u89e3\u6790\u5230\u6807\u7b7e\u5916\u90e8\u7684\u95ee\u9898\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173120184468152.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u89e3\u51b3\u6807\u7b7e\u5305\u88f9\u4ee3\u7801\u65f6\uff0c\u6362\u884c\u89e3\u6790\u5230\u6807\u7b7e\u5916\u90e8\u7684\u95ee\u9898\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u89e3\u51b3\u6807\u7b7e\u5305\u88f9\u4ee3\u7801\u65f6\uff0c\u6362\u884c\u89e3\u6790\u5230\u6807\u7b7e\u5916\u90e8\u7684\u95ee\u9898\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u6807\u7b7e\u5982\u4f55\u89e3\u51b3\u4ee3\u7801\u89e3\u6790\u81f3\u5916\u8fb9\u7684text\u8282\u70b9\u95ee\u9898\uff1f<\/strong><\/p>\n<p>\u5728\u4f7f\u7528\u6807\u7b7e\u5305\u88f9\u4ee3\u7801\u65f6\uff0c\u6d4f\u89c8\u5668\u6709\u65f6\u4f1a\u5c06\u6362\u884c\u4ee3\u7801\u89e3\u6790\u5230\u6807\u7b7e\u5916\uff0c\u5f62\u6210text\u8282\u70b9\u3002\u5bfc\u81f4\u4ee3\u7801\u65e0\u6cd5\u6b63\u5e38\u9ad8\u4eae\u6216\u5448\u73b0\u3002<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848<\/strong><\/p>\n<p>\u95ee\u9898\u4ea7\u751f\u4e8e\u540e\u7aef\u8fd4\u56de\u7684\u6570\u636e\u662f\u4e00\u4e2a\u5305\u542b\u5404\u884c\u4ee3\u7801\u7684\u6570\u7ec4\u3002\u5c06\u6570\u7ec4\u62fc\u63a5\u6210\u4e00\u4e2a\u5b8c\u6574\u7684\u5b57\u7b26\u4e32\u5373\u53ef\u89e3\u51b3\u95ee\u9898\u3002\u53ef\u5728\u524d\u7aef\u6216\u540e\u7aef\u8fdb\u884c\u62fc\u63a5\u3002<\/p>\n<p>\u4f8b\u5982\uff0c\u5728JavaScript\u4e2d\u4f7f\u7528join\u65b9\u6cd5\uff1a<\/p>\n<pre>let article_content = article_content_array.join('\n');<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5728Python\u4e2d\uff0c\u53ef\u4f7f\u7528&#8221;\\n&#8221;.join(article_content_array)\u3002<\/p>\n<p><strong>\u6ce8\u610f\u4e8b\u9879<\/strong><\/p>\n<ul>\n<li>\u786e\u4fdd\u62fc\u63a5\u7684\u5b57\u7b26\u4e32\u4e2d\u4e0d\u5305\u542b\u4efb\u4f55HTML\u6807\u8bb0\uff0c\u5426\u5219\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6d4f\u89c8\u5668\u4e0d\u89e3\u6790\u3002<\/li>\n<li>jq\u7684html()\u65b9\u6cd5\u53ef\u76f4\u63a5\u63a5\u6536\u4e00\u4e2a\u6570\u7ec4\u4f5c\u4e3a\u53c2\u6570\uff0c\u7701\u53bb\u4e86\u62fc\u63a5\u5b57\u7b26\u4e32\u7684\u6b65\u9aa4\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u89e3\u51b3\u6807\u7b7e\u5305\u88f9\u4ee3\u7801\u65f6\uff0c\u6362\u884c\u89e3\u6790\u5230\u6807\u7b7e\u5916\u90e8\u7684\u95ee\u9898\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6807\u7b7e\u5982\u4f55\u89e3\u51b3\u4ee3\u7801\u89e3\u6790\u81f3\u5916\u8fb9\u7684text\u8282\u70b9\u95ee\u9898\uff1f \u5728\u4f7f\u7528\u6807\u7b7e\u5305\u88f9\u4ee3\u7801\u65f6\uff0c\u6d4f\u89c8\u5668\u6709\u65f6\u4f1a\u5c06\u6362\u884c\u4ee3\u7801\u89e3\u6790\u5230\u6807\u7b7e\u5916\uff0c\u5f62\u6210text\u8282\u70b9\u3002\u5bfc\u81f4\u4ee3\u7801\u65e0\u6cd5\u6b63\u5e38\u9ad8\u4eae\u6216\u5448\u73b0\u3002 \u89e3\u51b3\u65b9\u6848 \u95ee\u9898\u4ea7\u751f\u4e8e\u540e\u7aef\u8fd4\u56de\u7684\u6570\u636e\u662f\u4e00\u4e2a\u5305\u542b\u5404\u884c\u4ee3\u7801\u7684\u6570\u7ec4\u3002\u5c06\u6570\u7ec4\u62fc\u63a5\u6210\u4e00\u4e2a\u5b8c\u6574\u7684\u5b57\u7b26\u4e32\u5373\u53ef\u89e3\u51b3\u95ee\u9898\u3002\u53ef\u5728\u524d\u7aef\u6216\u540e\u7aef\u8fdb\u884c\u62fc\u63a5\u3002 \u4f8b\u5982\uff0c\u5728JavaScript\u4e2d\u4f7f\u7528join\u65b9\u6cd5\uff1a let article_content = article_content_array.join(&#8216; &#8216;); \u767b\u5f55\u540e\u590d\u5236 \u5728Python\u4e2d\uff0c\u53ef\u4f7f\u7528&#8221;\\n&#8221;.join(article_content_array)\u3002 \u6ce8\u610f\u4e8b\u9879 \u786e\u4fdd\u62fc\u63a5\u7684\u5b57\u7b26\u4e32\u4e2d\u4e0d\u5305\u542b\u4efb\u4f55HTML\u6807\u8bb0\uff0c\u5426\u5219\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6d4f\u89c8\u5668\u4e0d\u89e3\u6790\u3002 jq\u7684html()\u65b9\u6cd5\u53ef\u76f4\u63a5\u63a5\u6536\u4e00\u4e2a\u6570\u7ec4\u4f5c\u4e3a\u53c2\u6570\uff0c\u7701\u53bb\u4e86\u62fc\u63a5\u5b57\u7b26\u4e32\u7684\u6b65\u9aa4\u3002 \u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u89e3\u51b3\u6807\u7b7e\u5305\u88f9\u4ee3\u7801\u65f6\uff0c\u6362\u884c\u89e3\u6790\u5230\u6807\u7b7e\u5916\u90e8\u7684\u95ee\u9898\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-27162","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27162","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=27162"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27162\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=27162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=27162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=27162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}