|
@@ -185,6 +185,10 @@ class KatexRenderer
|
|
|
$decoded = html_entity_decode($tex, ENT_QUOTES, 'UTF-8');
|
|
$decoded = html_entity_decode($tex, ENT_QUOTES, 'UTF-8');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 清理公式内部的换行与 <br>,避免 \frac{M}\n{N} 破坏解析
|
|
|
|
|
+ $tex = preg_replace('/<br\\s*\\/?>/i', '', $tex);
|
|
|
|
|
+ $tex = preg_replace('/\\r\\n|\\r|\\n/', '', $tex);
|
|
|
|
|
+
|
|
|
return $this->fixCasesLineBreaks($tex);
|
|
return $this->fixCasesLineBreaks($tex);
|
|
|
};
|
|
};
|
|
|
|
|
|