latex update

This commit is contained in:
wangjinlei
2026-02-03 13:59:57 +08:00
parent f9e29ad876
commit 31da31b252
2 changed files with 20 additions and 3 deletions

View File

@@ -632,6 +632,11 @@ class Production extends Base
} else {
$list[$k]['is_repeat'] = 0;
}
if(strpos($v['refer_content'],'retraction')!==false||strpos($v['refer_content'],'retracted')!==false){
$list[$k]['retract'] = 1;
}else{
$list[$k]['retract'] = 0;
}
}
$re['refers'] = $list;
$re['repeat'] = empty($aRepeat) ? [] : $aRepeat;
@@ -2243,9 +2248,15 @@ class Production extends Base
return jsonError($rule->getError());
}
$info = $this->article_main_obj->where("am_id",$data['id'])->find();
if(isset($data["code"])){
$content = $data['code'];
}else{
$content = $info['content'];
}
$production_info = $this->production_article_obj->where("article_id",$info['article_id'])->find();
$refers = $this->production_article_refer_obj->where("p_article_id",$production_info['p_article_id'])->where('state',0)->order("index")->select();
$res = $this->convertToLatex($info['content'],$refers);
$res = $this->convertToLatex($content,$refers);
echo $res;
// return jsonSuccess([$res]);
}
@@ -2259,9 +2270,9 @@ class Production extends Base
return '';
}
//单行处理公式内容
$pattern = '/^<wmath\s+data-latex="([^"]*)">.*<\/wmath>$/';
$pattern = '/^<wmath[^>]*?\s+data-latex="([^"]*)"[^>]*?>.*?<\/wmath>$/';
if(preg_match($pattern, $content) === 1){
$pattern1 = '/<wmath\s+data-latex="([^"]*)">/';
$pattern1 = '/<wmath[^>]*?\s+data-latex="([^"]*)">/';
if (preg_match($pattern1, $content, $matches)) {
$latexContent = $matches[1];
// 将 $$ 转换为 $因为equation环境不需要$$