mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-22 05:15:29 +09:00
Merge pull request #796 from mAKEkr/develop
getSummary 메소드에서 HTML 주석문 닫힘태그 삭제하도록 개선
This commit is contained in:
commit
022c32ee72
2 changed files with 6 additions and 6 deletions
|
|
@ -357,7 +357,7 @@ class commentItem extends Object
|
||||||
$content = preg_replace('!(<br[\s]*/{0,1}>[\s]*)+!is', ' ', $content);
|
$content = preg_replace('!(<br[\s]*/{0,1}>[\s]*)+!is', ' ', $content);
|
||||||
|
|
||||||
// replace tags such as </p> , </div> , </li> by blanks.
|
// replace tags such as </p> , </div> , </li> by blanks.
|
||||||
$content = str_replace(array('</p>', '</div>', '</li>'), ' ', $content);
|
$content = str_replace(array('</p>', '</div>', '</li>', '-->'), ' ', $content);
|
||||||
|
|
||||||
// Remove tags
|
// Remove tags
|
||||||
$content = preg_replace('!<([^>]*?)>!is', '', $content);
|
$content = preg_replace('!<([^>]*?)>!is', '', $content);
|
||||||
|
|
|
||||||
|
|
@ -523,19 +523,19 @@ class documentItem extends Object
|
||||||
|
|
||||||
function getSummary($str_size = 50, $tail = '...')
|
function getSummary($str_size = 50, $tail = '...')
|
||||||
{
|
{
|
||||||
$content = $this->getContent(false,false);
|
$content = $this->getContent(FALSE, FALSE);
|
||||||
|
|
||||||
// For a newlink, inert a whitespace
|
// For a newlink, inert a whitespace
|
||||||
$content = preg_replace('!(<br[\s]*/{0,1}>[\s]*)+!is', ' ', $content);
|
$content = preg_replace('!(<br[\s]*/{0,1}>[\s]*)+!is', ' ', $content);
|
||||||
|
|
||||||
// Replace tags such as </p> , </div> , </li> and others to a whitespace
|
// Replace tags such as </p> , </div> , </li> and others to a whitespace
|
||||||
$content = str_replace(array('</p>', '</div>', '</li>'), ' ', $content);
|
$content = str_replace(array('</p>', '</div>', '</li>', '-->'), ' ', $content);
|
||||||
|
|
||||||
// Remove Tags
|
// Remove Tags
|
||||||
$content = preg_replace('!<([^>]*?)>!is','', $content);
|
$content = preg_replace('!<([^>]*?)>!is', '', $content);
|
||||||
|
|
||||||
// Replace < , >, "
|
// Replace < , >, "
|
||||||
$content = str_replace(array('<','>','"',' '), array('<','>','"',' '), $content);
|
$content = str_replace(array('<', '>', '"', ' '), array('<', '>', '"', ' '), $content);
|
||||||
|
|
||||||
// Delete a series of whitespaces
|
// Delete a series of whitespaces
|
||||||
$content = preg_replace('/ ( +)/is', ' ', $content);
|
$content = preg_replace('/ ( +)/is', ' ', $content);
|
||||||
|
|
@ -544,7 +544,7 @@ class documentItem extends Object
|
||||||
$content = trim(cut_str($content, $str_size, $tail));
|
$content = trim(cut_str($content, $str_size, $tail));
|
||||||
|
|
||||||
// Replace back < , <, "
|
// Replace back < , <, "
|
||||||
$content = str_replace(array('<','>','"'),array('<','>','"'), $content);
|
$content = str_replace(array('<', '>', '"'),array('<', '>', '"'), $content);
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue