{"id":6723,"date":"2024-07-30T12:01:04","date_gmt":"2024-07-30T04:01:04","guid":{"rendered":""},"modified":"2024-07-30T12:01:04","modified_gmt":"2024-07-30T04:01:04","slug":"tidy\u4f7f\u7528\u7b80\u4ecb_Tile\u8f6f\u4ef6\u662f\u5e72\u561b\u7684","status":"publish","type":"post","link":"https:\/\/mushiming.com\/6723.html","title":{"rendered":"tidy\u4f7f\u7528\u7b80\u4ecb_Tile\u8f6f\u4ef6\u662f\u5e72\u561b\u7684"},"content":{"rendered":"<div class=\"text\" style=\"margin-top:0px; margin-right:auto; margin-bottom:0px; margin-left:auto; padding-top:17px; padding-right:0px; padding-bottom:0px; padding-left:0px; width:672px; overflow-x:hidden; overflow-y:hidden; line-height:1.3em; font-family:\u5b8b\u4f53,Arial\">\n<div class=\"tit6\" style=\"margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; color:rgb(114,114,114)\">\n tidy\u4f7f\u7528\u7b80\u4ecb (2006-06-09 11:40)\n <\/div>\n<div class=\"tit7\" style=\"margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; color:rgb(114,114,114); line-height:2\">\n \u5206\u7c7b\uff1a \u6280\u672f\u6587\u6863\n <\/div>\n<div id=\"detail\" class=\"detail\" style=\"margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; line-height:1.3\">\n<p style=\"margin-top:0px; margin-bottom:0px; padding-top:5px; padding-bottom:0px; line-height:1.5; font-size:14px\">\n<p style=\"margin-top:0px; margin-bottom:0px; padding-top:5px; padding-bottom:0px; line-height:1.5; font-size:14px\"> Tidy is a binding for the Tidy HTML clean and repair utility<br \/> Tidy\u662f\u4e00\u79cd\u6574\u7406\u548c\u4fee\u590d\u4f60\u7684HTML\u7684\u5de5\u5177,\u652f\u6301\u9762\u5411\u5bf9\u8c61\u6216\u9762\u5411\u8fc7\u7a0b\u65b9\u5f0f\u8c03\u7528,\u4e0b\u9762\u7b80\u5355\u8bf4\u8bf4\u5b83\u7684\u7528\u6cd5:<br \/> 1)\u5bf9\u8c61\u65b9\u5f0f<\/p>\n<p style=\"margin-top:0px; margin-bottom:0px; padding-top:5px; padding-bottom:0px; line-height:1.5; font-size:14px\"> <strong><span style=\"color:#0000ff; line-height:1.5\"><?php<br \/> $html = '<p>test<\/I>'; \/\/\u8981\u5904\u7406\u7684\u5b57\u4e32<br \/> $tidy = new tidy;<br \/> $tidy->parseString($html);<br \/> $tidy->CleanRepair();<br \/> echo tidy_get_output($tidy); \/\/\u8f93\u51fa\u5904\u7406\u540e\u7684\u7ed3\u679c<br \/> ?><\/span><\/strong><\/p>\n<p style=\"margin-top:0px; margin-bottom:0px; padding-top:5px; padding-bottom:0px; line-height:1.5; font-size:14px\"> 2)\u8fc7\u7a0b\u65b9\u5f0f<\/p>\n<p style=\"margin-top:0px; margin-bottom:0px; padding-top:5px; padding-bottom:0px; line-height:1.5; font-size:14px\"> <strong><span style=\"color:#0000ff; line-height:1.5\"><?php<br \/> $html =\" <p>error<br>another line<\/i>\";<br \/> $config = array('indent' => TRUE,<br \/> 'output-xhtml' => TRUE,<br \/> 'wrap' => 200);<br \/> $tidy = tidy_parse_string($buffer, $config, 'UTF8'); \/\/\u8fd4\u56de\u7684\u662ftidy\u5bf9\u8c61<br \/> $tidy->CleanRepair($tidy);<br \/> echo tidy_get_output($tidy); \/\/\u8f93\u51fa\u5904\u7406\u540e\u7684\u7ed3\u679c<br \/> ?><\/span><\/strong><\/p>\n<p style=\"margin-top:0px; margin-bottom:0px; padding-top:5px; padding-bottom:0px; line-height:1.5; font-size:14px\"> <strong><span style=\"color:#0000ff; line-height:1.5\"><?php<br \/> $html =\" <p>error<br>another line<\/i>\";<br \/> $config = array('indent' => TRUE,<br \/> 'output-xhtml' => TRUE,<br \/> 'wrap' => 200);<br \/> $tidy = tidy_repair_string($html, $config, 'UTF8'); \/\/\u8fd4\u56de\u7684\u662ftidy\u5bf9\u8c61<br \/> echo $tidy;<br \/> ?><\/span><\/strong><\/p>\n<p style=\"margin-top:0px; margin-bottom:0px; padding-top:5px; padding-bottom:0px; line-height:1.5; font-size:14px\"> \u5176\u5b83\u51fd\u6570:<br \/> tidy tidy_parse_file \/\/\u9700\u8981\u7528tidy_get_X\u7cfb\u5217\u5904\u7406\u8fd4\u56de<br \/> String tidy_repair_file \/\/\u53ef\u4ee5\u76f4\u63a5echo<br \/> tidy tidy_parse_string<br \/> String tidy_repair_string<br \/> \u5982\u679c\u4f60\u9700\u8981\u5355\u72ec\u5904\u7406HTML\u5185\u5bb9\u7684\u67d0\u4e9b\u6307\u5b9a\u6807\u8bb0,\u9700\u8981\u7528tidy_parse_*\u914d\u5408tidy_clean_repair\u4f7f\u7528,\u5e76\u4f7f\u7528tidy_get_*\u7cfb\u5217\u8f93\u51fa\u7ed3\u679c(tidy_get_*\u63a5\u53d7\u7684\u53c2\u6570\u4e3atidy\u5bf9\u8c61)<br \/> \u5982\u679c\u53ea\u662f\u5bf9\u6574\u4e2a\u5185\u5bb9\u7b80\u5355\u5904\u7406\u5e76\u8f93\u51fa,\u76f4\u63a5\u7528tidy_repair_*\u5904\u7406\u5e76\u8fd4\u56de\u7ed3\u679c\u5b57\u4e32,\u518decho\u5c31\u53ef\u4ee5\u4e86<\/p>\n<p style=\"margin-top:0px; margin-bottom:0px; padding-top:5px; padding-bottom:0px; line-height:1.5; font-size:14px\"> tidy_get_body \/\/\u8fd4\u56debody\u6807\u8bb0\u90e8\u5206<br \/> tidy_get_config \/\/\u8fd4\u56de\u53c2\u6570\u914d\u7f6e ,\u5177\u4f53\u914d\u7f6e\u8bf7\u53c2\u9605http:\/\/tidy.sourceforge.net\/docs\/quickref.html<br \/> tidy_get_head \/\/head\u6807\u8bb0\u90e8\u5206<br \/> tidy_get_html \/\/html\u90e8\u5206(\u5168\u6587?)<\/p>\n<div style=\"margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; line-height:1.5\">\n <\/div>\n<p style=\"margin-top:0px; margin-bottom:0px; padding-top:5px; padding-bottom:0px; line-height:1.5; font-size:14px\">\n<\/p><\/div>\n<\/div>\n<div class=\"cont5\" style=\"margin-top:30px; margin-right:auto; margin-bottom:0px; margin-left:auto; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; width:615px; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-left-width:1px; border-top-color:rgb(214,214,214); border-right-color:rgb(214,214,214); border-bottom-color:rgb(214,214,214); border-left-color:rgb(214,214,214); border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-left-style:solid; font-family:\u5b8b\u4f53,Arial\">\n<div class=\"t\" style=\"margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:14px; padding-right:0px; padding-bottom:0px; padding-left:23px; font-size:14px\">\n \u535a\u5ba2\u63a8\u8350\u6587\u7ae0\n <\/div>\n<ul style=\"margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:15px; padding-right:0px; padding-bottom:12px; padding-left:23px; list-style-type:none; list-style-position:initial\">\n<li style=\"margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; list-style-type:none; list-style-position:initial; height:24px; color:rgb(114,114,114)\"> \u6df1\u5c42\u6b21\u63a2\u8ba8mutex\u4e0esemaphore\u4e4b\u95f4\u7684\u533a\u522b(\u4e0b) (10\u5206\u949f\u524d)<\/li>\n<li style=\"margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; list-style-type:none; list-style-position:initial; height:24px; color:rgb(114,114,114)\"> \u6df1\u5c42\u6b21\u63a2\u8ba8mutex\u4e0esemaphore\u4e4b\u95f4\u7684\u533a\u522b(\u4e2d) (11\u5206\u949f\u524d)<\/li>\n<li style=\"margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; list-style-type:none; list-style-position:initial; height:24px; color:rgb(114,114,114)\"> \u6df1\u5c42\u6b21\u63a2\u8ba8mutex\u4e0esemaphore\u4e4b\u95f4\u7684\u533a\u522b(\u4e0a) (11\u5206\u949f\u524d)<\/li>\n<li style=\"margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; list-style-type:none; list-style-position:initial; height:24px; color:rgb(114,114,114)\"> \u5173\u4e8ecopy_from_user\u51fd\u6570 (12\u5206\u949f\u524d)<\/li>\n<li style=\"margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; list-style-type:none; list-style-position:initial; height:24px; color:rgb(114,114,114)\"> \u5173\u4e8etasklet\u7684\u4e00\u70b9\u5c0f\u5c0f\u7684\u89e3\u91ca (12\u5206\u949f\u524d)<\/li>\n<\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"tidy\u4f7f\u7528\u7b80\u4ecb_Tile\u8f6f\u4ef6\u662f\u5e72\u561b\u7684tidy\u4f7f\u7528\u7b80\u4ecb(2006-06-0911:40)\u5206\u7c7b\uff1a\u6280\u672f\u6587\u6863TidyisabindingfortheTidyHTMLcleanandrepairuti...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/6723"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=6723"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/6723\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=6723"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=6723"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=6723"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}