作者 lyh

gx

@@ -163,10 +163,11 @@ class ProofreadingController extends BaseController @@ -163,10 +163,11 @@ class ProofreadingController extends BaseController
163 $matches = array(); 163 $matches = array();
164 preg_match_all($pattern, $strippedContent, $matches); 164 preg_match_all($pattern, $strippedContent, $matches);
165 $textContentArray = array_filter($matches[1], function($item) { 165 $textContentArray = array_filter($matches[1], function($item) {
166 - $content = trim($item);  
167 - $trimmedString = preg_replace('/\s+/', ' ', $content);  
168 - var_dump($trimmedString);  
169 - return !empty(trim($item)); 166 + if(!empty($item)){
  167 + $content = trim($item);
  168 + $trimmedString = preg_replace('/\s+/', ' ', $content);
  169 + return $trimmedString;
  170 + }
170 }); 171 });
171 $textContentArray = array_values($textContentArray); 172 $textContentArray = array_values($textContentArray);
172 $uniqueArray = array_unique($textContentArray); 173 $uniqueArray = array_unique($textContentArray);