小bug修复
This commit is contained in:
@@ -47,6 +47,33 @@ class Preaccept extends Base
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
|
||||
public function spiltContent(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"content"=>"require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$text = $data['content'];
|
||||
|
||||
$text = preg_replace('/(\d+)([a-zA-Z%℃°]+)/', '$1 $2', $text);
|
||||
|
||||
$text = preg_replace('/\s*%\s*/', '%', $text);
|
||||
|
||||
|
||||
$pattern_en_dash = '/(\d+)–(\d+)/';
|
||||
$text = preg_replace($pattern_en_dash, '$1-$2', $text);
|
||||
|
||||
|
||||
$pattern_em_dash = '/(\d+)—(\d+)/';
|
||||
$text = preg_replace($pattern_em_dash, '$1-$2', $text);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**清空引用文献
|
||||
* @return \think\response\Json
|
||||
* @throws \think\Exception
|
||||
|
||||
Reference in New Issue
Block a user