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"><a href="#navigator">▲</a></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を変更すればいいんだろうけど、よくわからなかった(^^;;
<div id="navigator">ナビ</div> ... (本文) <div id="jumpmenu"><a href="#navigator">▲</a></div> <h2 id="contents_0_1">見出し</h2> ... (include) <div id="jumpmenu"><a href="#navigator">▲</a></div> <h2 id="contents_1_1">インクルードされた見出し</h2>それなら、$topは*.lng内で
$top = <div id="jumpmenu"><a href="#navigator">▲</a></div>あるいは
$top = <div id="jumpmenu"><a href="#navigator">↑</a></div>としてしまってもいいかも。