注釈の生成時期の変更(提案)

メッセージ

convert_html関数を使っているプラグインを本文に書くと、その行以前にかかれた本文の注釈の本体が消えてしまいます。

SandBoxに現象のサンプルを書いています。これは結構いや~んな状況なので、以下の提案をさせてください。

convert_html関数から、

  1. 注釈の配列、およびカウンタの初期化をinit.phpへ移動
  2. 注釈の文字列化を、catbody関数へ移動

こんな感じになります。

html.php/convert_html

-	$note_id = 1;
-	$foot_explain = array();
-	if($foot_explain)
-	{
-		$str .= "\n";
-		$str .= "$note_hr\n";
-		$str .= join("\n",inline2($foot_explain));
-	}

html.php/catbody

+	global $foot_explain, $note_hr;
+	if ($foot_explain)
+		$body .= "\n$note_hr\n".join("\n",inline2($foot_explain));
 	require(SKIN_FILE);

init.php

 //** 初期処理 **
 $update_exec = "";
 $content_id = 0;
 $user_rules = array_merge($str_rules,$line_rules);
 
+$note_id = 1;
+$foot_explain = array();

なお、上記修正を施したときに判明している問題は以下のとおりです。

ご検討ください。



トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2002-11-05 (火) 17:38:07
Site admin: PukiWiki Development Team

PukiWiki 1.5.4+ © 2001-2022 PukiWiki Development Team. Powered by PHP 8.2.12. HTML convert time: 0.198 sec.

SourceForge