From 4d91449dd94f4476faed70b68219c97d55cfd759 Mon Sep 17 00:00:00 2001 From: Steven Wittens Date: Thu, 10 Jun 2004 14:40:55 +0000 Subject: Quick improvement to autoteaser generation: added double-width dot and comma, and right-to-left question mark as sentence boundaries. --- modules/node/node.module | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'modules/node/node.module') diff --git a/modules/node/node.module b/modules/node/node.module index 117e2e8a8..3d3f6bf8a 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -209,6 +209,18 @@ function node_teaser($body) { return substr($body, 0, $length + 1); } + if ($length = strpos($body, '。', $size)) { + return substr($body, 0, $length + 1); + } + + if ($length = strpos($body, '、', $size)) { + return substr($body, 0, $length + 1); + } + + if ($length = strpos($body, '؟ ', $size)) { + return substr($body, 0, $length + 1); + } + /* ** Nevermind, we split it the hard way ... */ -- cgit v1.2.3