|
|
@@ -204,7 +204,8 @@ class KatexRenderer
|
|
|
$decoded = html_entity_decode($tex, ENT_QUOTES, 'UTF-8');
|
|
|
}
|
|
|
|
|
|
- // 清理公式内部的换行与 <br>,避免 \frac{M}\n{N} 破坏解析
|
|
|
+ // 清理公式内部的软换行标签,避免断行优化污染 LaTeX 内容
|
|
|
+ $tex = preg_replace('/<wbr\\s*\\/?>/i', '', $tex);
|
|
|
$tex = preg_replace('/<br\\s*\\/?>/i', '', $tex);
|
|
|
$tex = preg_replace('/\\r\\n|\\r|\\n/', '', $tex);
|
|
|
|