*includeしたページの<h1~h3>横の↑リンクの飛び先が存在しない -ページ: BugTrack -投稿者: [[reimy]] -優先順位: 重要 -状態: 提案 -カテゴリー: 本体バグ -投稿日: 2003-02-28 (金) 00:52:46 -バージョン: 1.3.x及び1.4pre5 **メッセージ includeしたページ内にある<h*>の横の↑の飛び先がcontents_数字になっているため、飛び先が存在しないことになる。 対策としては、↑の飛び先をページ上部のメニューにすればよい。 上部のメニュー部分は<div id="navigator">になっているので、↑の飛び先を<a href="#navigator">にしておけば、includeされたページ記事からでも問題なくページ先頭に飛ぶことができる。 ↑(&uarr;)ですが、現在はdefault.ini.phpの$topで設定しているが、全角の↑や▲も使えるようにja.lng、en.lngで設定するほうがいい。 リンクの位置が<h*>の横にあるが、<h*>の直前行に、<span>ではなく<div class="jumpmenu">で囲んで出力したほうがわかりやすい。このとき、先頭の<h*>の直前にだけは出力しないほうが美しい。 $top = '<div class="jumpmenu">▲</div>' CSSファイルのほうで .jumpmenu{ font-size:60%; text-align:right; } 1.3ではhtml.phpのheadingの部分を次のような感じに書き換えればいい。 } else if ($line_head == '*') { // Heading if (preg_match("/^(\*{1,3})\s*(.*)/",$line,$out)) { end_block($result,$saved,$flag); //見出しはいかなるブロック要素にも食われない $str = inline($out[2]); $level = strlen($out[1]); $h = $level + 1; if($content_count == 0 && $content_id == 1){ //先頭の<h*>の場合 array_push($result, "<h$h><a id=\"content_{$content_id_local}_$content_count\"></a>$str</h$h>"); } else { //先頭以外の<h*> array_push($result, $top."\n<h$h><a id=\"content_{$content_id_local}_$content_count\"></a>$str</h$h>"); } if($content_count == 0) $tmp_lvl = $level; $arycontents[] = str_repeat("-",$level-$tmp_lvl+1)."<a href=\"#content_{$content_id_local}_$content_count\">".strip_htmltag(make_user_rules(inline($out[2],TRUE)))."</a>\n"; $content_count++; continue; } 上記では、<h1>がなく<h2>や<h3>だけ存在するページのcontentsの出力の字下げが深くなりすぎる対策もしてあります。 1.4ではconvert_html.phpのclass headingを変更すればいいんだろうけど、よくわからなかった(^^;; ---- #comment