#59428: Correct teaser for japanese period character
parent
86f2764a7b
commit
d469df81c7
|
@ -184,7 +184,7 @@ function node_teaser($body, $format = NULL) {
|
|||
// the Blogger API). In this case, we try to split at paragraph boundaries.
|
||||
// When even the first paragraph is too long, we try to split at the end of
|
||||
// the next sentence.
|
||||
$breakpoints = array('</p>' => 4, '<br />' => 0, '<br>' => 0, "\n" => 0, '. ' => 1, '! ' => 1, '? ' => 1, '。' => 1, '؟ ' => 1);
|
||||
$breakpoints = array('</p>' => 4, '<br />' => 0, '<br>' => 0, "\n" => 0, '. ' => 1, '! ' => 1, '? ' => 1, '。' => 3, '؟ ' => 1);
|
||||
foreach ($breakpoints as $point => $charnum) {
|
||||
if ($length = strpos($body, $point, $size)) {
|
||||
return substr($body, 0, $length + $charnum);
|
||||
|
|
|
@ -184,7 +184,7 @@ function node_teaser($body, $format = NULL) {
|
|||
// the Blogger API). In this case, we try to split at paragraph boundaries.
|
||||
// When even the first paragraph is too long, we try to split at the end of
|
||||
// the next sentence.
|
||||
$breakpoints = array('</p>' => 4, '<br />' => 0, '<br>' => 0, "\n" => 0, '. ' => 1, '! ' => 1, '? ' => 1, '。' => 1, '؟ ' => 1);
|
||||
$breakpoints = array('</p>' => 4, '<br />' => 0, '<br>' => 0, "\n" => 0, '. ' => 1, '! ' => 1, '? ' => 1, '。' => 3, '؟ ' => 1);
|
||||
foreach ($breakpoints as $point => $charnum) {
|
||||
if ($length = strpos($body, $point, $size)) {
|
||||
return substr($body, 0, $length + $charnum);
|
||||
|
|
Loading…
Reference in New Issue