diff --git a/application/api/controller/Production.php b/application/api/controller/Production.php index f6b6a3e..d7703c4 100644 --- a/application/api/controller/Production.php +++ b/application/api/controller/Production.php @@ -2226,7 +2226,18 @@ class Production extends Base return ''; } //单行处理公式内容 + $pattern = '/^.*<\/wmath>$/'; + if(preg_match($pattern, $content) === 1){ + $pattern1 = '//'; + if (preg_match($pattern1, $content, $matches)) { + $latexContent = $matches[1]; + // 将 $$ 转换为 $,因为equation环境不需要$$ + $latexContent = str_replace('$$', '', $latexContent); + return "\\begin{equation}\n\t{$latexContent}\n\\end{equation}"; + } + return $content; + }