Changeset 626442
- Timestamp:
- 11/17/2012 02:34:00 PM (13 years ago)
- Location:
- cn-excerpt/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
wp-cn-excerpt.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cn-excerpt/trunk/readme.txt
r624004 r626442 5 5 Requires at least: 3.2 6 6 Tested up to: 3.4.2 7 Stable tag: 4.2. 17 Stable tag: 4.2.2 8 8 9 9 -
cn-excerpt/trunk/wp-cn-excerpt.php
r624004 r626442 4 4 Plugin URI: http://www.joychao.cc/692.html 5 5 Description: WordPress高级摘要插件。支持在后台设置摘要长度,摘要最后的显示字符,以及允许哪些html标记在摘要中显示 6 Version: 4.2. 16 Version: 4.2.2 7 7 Author: Joychao 8 8 Author URI: http://www.joychao.cc … … 132 132 // (<[^>]+>|[^<>\s]+\s*) 133 133 preg_match_all('/(<[^>]+>|[^<>\s]+)\s*/u', $text, $tokens); 134 foreach ($tokens[0] as $t) 134 var_dump($tokens); 135 foreach ($tokens[1] as $t) 135 136 { // Parse each token 136 137 if ($t[0] != '<') 137 138 { // Token is not a tag 138 if (preg_match('/[\?\.\!!。"“’\']\s*$/uS', $t) == 1)//以句子结束139 { // Limit reached, continue until ? . or ! occur at the end139 if (preg_match('/[\?\.\!!。"“’\']\s*$/uS', $t))//以句子结束 140 { 140 141 $out .= trim($t); 141 142 break;
Note: See TracChangeset
for help on using the changeset viewer.