Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复在文章中插入php代码块,但是代码块中$符号在web端不显示的问题 #555

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/App/KaTeX.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ public function katex_markup_single($content) {
$isInCodeBlock = false;

foreach ($textarr as &$element) {
// 默认进行LaTeX解析,如果满足下面的判断条件,则跳过
$pass = false;


// 判断已经跳过的行数
if ($count > 0) {
++ $count;
Expand Down Expand Up @@ -99,9 +97,9 @@ public function katex_markup_single($content) {
/**
* 3. 对于其他空行或可能为HTML单行标签的行,直接跳过
*/
if ($element == "" || $element[0] == "<" || stripos($element, "$") === false) {
/*if ($element == "" || $element[0] == "<" || stripos($element, "$") === false) {
$pass = true;
}
}*/

/**
* 4. 如果当前还在代码块内,继续跳过
Expand Down Expand Up @@ -166,9 +164,7 @@ public function katex_markup_double($content) {
$isInCodeBlock = false;

foreach ($textarr as &$element) {
// 默认进行LaTeX解析,如果满足下面的判断条件,则跳过
$pass = false;


// 判断已经跳过的行数
if ($count > 0) {
++ $count;
Expand Down