mirror of
https://github.com/typecho/typecho.git
synced 2025-03-19 17:39:42 +01:00
fix autop
This commit is contained in:
parent
4fc76a4dc3
commit
9c5c404c71
@ -49,6 +49,7 @@ class AutoP
|
||||
private function cutByBlock($text)
|
||||
{
|
||||
$space = "( | )";
|
||||
$text = str_replace("\r\n", "\n", trim($text));
|
||||
$text = preg_replace("/{$space}*\n{$space}*/is", "\n", $text);
|
||||
$text = preg_replace("/\s*<p:([0-9]{4})\/>\s*/is", "</p><p:\\1/><p>", $text);
|
||||
$text = preg_replace("/\n{2,}/", "</p><p>", $text);
|
||||
@ -95,7 +96,7 @@ class AutoP
|
||||
|
||||
switch (true) {
|
||||
/** 用br处理换行 */
|
||||
case false !== strpos('|li|dd|dt|td|p|a|span|code|cite|strong|sup|sub|small|del|u|i|b|ins|h1|h2|h3|h4|h5|h6|', $tagMatch):
|
||||
case false !== strpos('|li|dd|dt|td|p|a|span|cite|strong|sup|sub|small|del|u|i|b|ins|h1|h2|h3|h4|h5|h6|', $tagMatch):
|
||||
$text = nl2br(trim($text));
|
||||
break;
|
||||
/** 用段落处理换行 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user