• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision3809644b6a3b69bd98de8ff214e3376e8c5a8d95 (tree)
Time2007-11-11 20:02:40
Authorhenoheno <henoheno>
Commiterhenoheno

Log Message

* BugTrack2/285: & => &amp;
* BugTrack/779: Not using list() and array_pad()
* BugTrack/779: trim()
* BugTrack/779: Simplify
* Simplify: strip_htmltag() for AutoLink => strip_autolink()
* Simplify: ruby tags

Change Summary

Incremental Difference

--- a/plugin/ruby.inc.php
+++ b/plugin/ruby.inc.php
@@ -1,29 +1,32 @@
11 <?php
22 // PukiWiki - Yet another WikiWikiWeb clone.
3-// $Id: ruby.inc.php,v 1.6 2005/05/07 07:41:31 henoheno Exp $
3+// $Id: ruby.inc.php,v 1.7 2007/11/11 11:02:40 henoheno Exp $
44 //
5-// Ruby annotation plugin: Add a pronounciation into kanji-word or acronym(s)
5+// Ruby annotation plugin: Attach a pronounciation into kanji-word(s) or acronym(s)
66 // See also about ruby: http://www.w3.org/TR/ruby/
77 //
88 // NOTE:
99 // Ruby tag works with MSIE only now,
1010 // but readable for other browsers like: 'words(pronunciation)'
1111
12-define('PLUGIN_RUBY_USAGE', '&ruby(pronunciation){words};');
12+define('PLUGIN_RUBY_USAGE', '&amp;ruby(pronunciation){words};');
1313
1414 function plugin_ruby_inline()
1515 {
1616 if (func_num_args() != 2) return PLUGIN_RUBY_USAGE;
1717
18- list($ruby, $body) = func_get_args();
19-
20- // strip_htmltag() is just for avoiding AutoLink insertion
21- $body = strip_htmltag($body);
18+ $args = func_get_args();
19+ $body = trim(strip_autolink(array_pop($args))); // htmlspecialchars() already
20+ $ruby = isset($args[0]) ? trim($args[0]) : '';
2221
2322 if ($ruby == '' || $body == '') return PLUGIN_RUBY_USAGE;
2423
25- return '<ruby><rb>' . $body . '</rb>' . '<rp>(</rp>' .
26- '<rt>' . htmlspecialchars($ruby) . '</rt>' . '<rp>)</rp>' .
24+ return
25+ '<ruby>' .
26+ '<rb>' . $body . '</rb>' .
27+ '<rp>(</rp>' .
28+ '<rt>' . htmlspecialchars($ruby) . '</rt>' .
29+ '<rp>)</rp>' .
2730 '</ruby>';
2831 }
2932 ?>