/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: html.php,v 1.75 2003/05/16 05:46:46 arino Exp $
+// $Id: html.php,v 1.76 2003/05/17 11:14:46 arino Exp $
//
// ËÜʸ¤ò½ÐÎÏ
}
// ¸«½Ð¤·¤òÀ¸À® (Ãí¼á¤äHTML¥¿¥°¤ò½üµî)
-function make_heading($str)
+function make_heading(&$str,$strip=TRUE)
{
global $NotePattern;
// ¸«½Ð¤·¤Î¸ÇÍIDÉô¤òºï½ü
- $str = preg_replace('/^\*{0,3}(.*?)\[#[A-Za-z][\w-]+\](.*?)$/m','$1$2',$str);
+ $id = '';
+ if (preg_match('/^(\*{0,3})(.*?)\[#([A-Za-z][\w-]+)\](.*?)$/m',$str,$matches))
+ {
+ $str = ($strip ? '' : $matches[1]).$matches[2].$matches[4];
+ $id = $matches[3];
+ }
+ else
+ {
+ $str = ltrim($str,'*');
+ }
+ if ($strip)
+ {
+ $str = strip_htmltag(make_link(preg_replace($NotePattern,'',$str)));
+ }
- return strip_htmltag(make_link(preg_replace($NotePattern,'',$str)));
+ return $id;
}
?>
* Êѹ¹ÍúÎò:
* 2002.06.17: ºî¤ê»Ï¤á
*
- * $Id: bugtrack.inc.php,v 1.13 2003/05/14 10:13:31 arino Exp $
+ * $Id: bugtrack.inc.php,v 1.14 2003/05/17 11:18:22 arino Exp $
*/
function plugin_bugtrack_init()
}
if (preg_match("/\*([^\n]+)/",$body,$matches)) {
- $summary = make_heading($matches[1]);
+ $summary = $matches[1];
+ make_heading($summary);
}
return array($page, $no, $summary, $name, $priority, $state, $category);
/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: ls2.inc.php,v 1.13 2003/05/16 05:54:35 arino Exp $
+// $Id: ls2.inc.php,v 1.14 2003/05/17 11:18:22 arino Exp $
//
/*
{
if ($params['title'] and preg_match('/^(\*{1,3})/',$line,$matches))
{
+ $id = make_heading($line);
$level = strlen($matches[1]);
$id = LS2_CONTENT_HEAD.$anchor++;
ls2_list_push($params,$level + strlen($level));
- array_push($params['result'], '<li>'.make_heading($line).
+ array_push($params['result'], '<li>'.$line.
'<a href="'.$href.$id.'">'.$_ls2_messages['msg_go'].'</a>'
);
}