/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: convert_html.php,v 1.50 2003/07/27 13:40:41 arino Exp $
+// $Id: convert_html.php,v 1.51 2003/07/29 09:57:13 arino Exp $
//
function convert_html($lines)
{
$this->contents_last =& $this->contents_last->add(new Contents_UList($text,$level,$id));
return array($text.$anchor,$this->count > 1 ? $top : '',$id);
}
- function getContents()
- {
- $contents = "<a id=\"contents_{$this->id}\"></a>";
- $contents .= $this->contents->toString();
- return "<div class=\"contents\">\n$contents</div>\n";
- }
function &insert(&$obj)
{
if (is_a($obj,'Inline')) {
$text = parent::toString();
// #contents
- $text = preg_replace('/<p[^>]*>#contents<\/p>/',$this->getContents(),$text);
+ $text = preg_replace_callback('/(<p[^>]*>)<del>#contents<\/del>(.*)(<\/p>)/',
+ array(&$this,'replace_contents'),$text);
// ´ØÏ¢¤¹¤ë¥Ú¡¼¥¸
// <p>¤Î¤È¤¤Ï¹ÔƬ¤«¤é¡¢<del>¤Î¤È¤¤Ï¾¤ÎÍ×ÁǤλÒÍ×ÁǤȤ·¤Æ¸ºß
- $text = preg_replace('/<p><del>#related<\/del><\/p>/',make_related($vars['page'],'p'),$text);
+ $text = preg_replace_callback('/(<p[^>]*>)<del>#related<\/del>(.*)(<\/p>)/',
+ array(&$this,'replace_related'),$text);
$text = preg_replace('/<del>#related<\/del>/',make_related($vars['page'],'del'),$text);
return $text;
}
+ function replace_contents($arr)
+ {
+ static $contents = NULL;
+
+ if (is_null($contents))
+ {
+ $contents = "<div class=\"contents\">\n";
+ $contents .= "<a id=\"contents_{$this->id}\"></a>";
+ $contents .= $this->contents->toString();
+ $contents .= "</div>\n";
+ }
+ array_shift($arr);
+ return ($arr[1] != '') ? $contents.join('',$arr) : $contents;
+ }
+ function replace_related($arr)
+ {
+ static $related = NULL;
+
+ if (is_null($related))
+ {
+ $related = make_related($vars['page'],'p');
+ }
+ array_shift($arr);
+ return ($arr[1] != '') ? $related.join('',$arr) : $related;
+ }
function block(&$lines,$start,$end,$class)
{
if (rtrim($lines[0]) != $start)
/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: html.php,v 1.90 2003/07/14 04:27:07 arino Exp $
+// $Id: html.php,v 1.91 2003/07/29 09:57:14 arino Exp $
//
// ËÜʸ¤ò½ÐÎÏ
"<a href=\"$script?$r_page\">$s_page</a>$passage";
}
+ if (count($_links) == 0)
+ {
+ return '';
+ }
+
if ($tag == 'p') // ¹ÔƬ¤«¤é
{
$margin = $_ul_left_margin + $_ul_margin;
/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: init.php,v 1.58 2003/07/06 15:10:27 arino Exp $
+// $Id: init.php,v 1.59 2003/07/29 09:57:14 arino Exp $
//
/////////////////////////////////////////////////
$line_rules = array_merge(array(
'&(#[0-9]+|#x[0-9a-f]+|'.$entity_pattern.');'=>'&$1;',
"\r"=>"<br />\n", /* ¹ÔËö¤Ë¥Á¥ë¥À¤Ï²þ¹Ô */
- '#related'=>'<del>#related</del>'
+ '#related$'=>'<del>#related</del>',
+ '^#contents$'=>'<del>#contents</del>'
),$line_rules);
?>