正在显示
1 个修改的文件
包含
2 行增加
和
3 行删除
| @@ -29,9 +29,7 @@ class ProofreadingController extends BaseController | @@ -29,9 +29,7 @@ class ProofreadingController extends BaseController | ||
| 29 | if(empty($list)){ | 29 | if(empty($list)){ |
| 30 | //获取当前URl的所有文本内容 | 30 | //获取当前URl的所有文本内容 |
| 31 | $new_list = $this->getUrlRead($this->param['url']); | 31 | $new_list = $this->getUrlRead($this->param['url']); |
| 32 | - $str = implode('__',$new_list); | ||
| 33 | - var_dump($str); | ||
| 34 | - die(); | 32 | + $str = implode('|',$new_list); |
| 35 | //翻译 | 33 | //翻译 |
| 36 | $translate_str = Translate::tran($str, $countryInfo['alias']); | 34 | $translate_str = Translate::tran($str, $countryInfo['alias']); |
| 37 | $arr = explode('__',$translate_str); | 35 | $arr = explode('__',$translate_str); |
| @@ -125,6 +123,7 @@ class ProofreadingController extends BaseController | @@ -125,6 +123,7 @@ class ProofreadingController extends BaseController | ||
| 125 | $matches = array(); | 123 | $matches = array(); |
| 126 | preg_match_all($pattern, $strippedContent, $matches); | 124 | preg_match_all($pattern, $strippedContent, $matches); |
| 127 | $textContentArray = array_filter($matches[1], function($item) { | 125 | $textContentArray = array_filter($matches[1], function($item) { |
| 126 | + $item = str_replace("\n", "", $item); | ||
| 128 | return !empty(trim($item)); | 127 | return !empty(trim($item)); |
| 129 | }); | 128 | }); |
| 130 | $textContentArray = array_values($textContentArray); | 129 | $textContentArray = array_values($textContentArray); |
-
请 注册 或 登录 后发表评论