From 41da8b9565cf89234e61a1f97e49e352aa4b2171 Mon Sep 17 00:00:00 2001 From: henoheno Date: Tue, 23 Nov 2004 20:33:25 +0900 Subject: [PATCH] Cleanup. Make fixed-anchor removal more strictly --- lib/html.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/html.php b/lib/html.php index 57af7fe..7cd9a96 100644 --- a/lib/html.php +++ b/lib/html.php @@ -2,7 +2,7 @@ ///////////////////////////////////////////////// // PukiWiki - Yet another WikiWikiWeb clone. // -// $Id: html.php,v 1.14 2004/11/20 04:32:49 henoheno Exp $ +// $Id: html.php,v 1.15 2004/11/23 11:33:25 henoheno Exp $ // // ËÜʸ¤ò½ÐÎÏ @@ -332,20 +332,22 @@ function make_search($page) return "$s_page "; } -// ¸«½Ð¤·¤òÀ¸À® (Ãí¼á¤äHTML¥¿¥°¤ò½üµî) +// ¸«½Ð¤·¤òÀ¸À® (µÓÃí¤äHTML¥¿¥°¤ò½üµî) function make_heading(& $str, $strip = TRUE) { global $NotePattern; - // ¸«½Ð¤·¤Î¸ÇÍ­IDÉô¤òºï½ü + // Cut fixed-anchors $id = ''; - if (preg_match('/^(\*{0,3})(.*?)\[#([A-Za-z][\w-]+)\](.*?)$/m', $str, $matches)) { + $matches = array(); + if (preg_match('/^(\*{0,3})(.*?)\[#([a-z][a-f0-9]{7})\](.*?)$/m', $str, $matches)) { $str = $matches[2] . $matches[4]; $id = $matches[3]; } else { $str = preg_replace('/^\*{0,3}/', '', $str); } + // Cut footnotes and tags if ($strip === TRUE) $str = strip_htmltag(make_link(preg_replace($NotePattern, '', $str))); -- 2.11.0