diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2004-06-10 14:40:55 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2004-06-10 14:40:55 +0000 |
commit | 4d91449dd94f4476faed70b68219c97d55cfd759 (patch) | |
tree | d31515edc04ed6e8cc2e99442778ebcb98ab8a72 /modules | |
parent | 9541a3a2653b02ec020afb97bf96f0d83bd07f9c (diff) | |
download | brdo-4d91449dd94f4476faed70b68219c97d55cfd759.tar.gz brdo-4d91449dd94f4476faed70b68219c97d55cfd759.tar.bz2 |
Quick improvement to autoteaser generation:
added double-width dot and comma, and right-to-left question mark as sentence boundaries.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/node.module | 12 | ||||
-rw-r--r-- | modules/node/node.module | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/modules/node.module b/modules/node.module index 117e2e8a8..3d3f6bf8a 100644 --- a/modules/node.module +++ b/modules/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 ... */ 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 ... */ |