Index: en.lng
===================================================================
RCS file: /cvsroot/pukiwiki/pukiwiki/en.lng,v
retrieving revision 1.26
diff -u -r1.26 en.lng
--- en.lng	3 Apr 2004 15:27:07 -0000	1.26
+++ en.lng	1 Sep 2004 10:29:38 -0000
@@ -49,6 +49,7 @@
 // symbols
 $_symbol_anchor = '&dagger;';
 $_symbol_noexists = '?';
+$_symbol_paraedit ='<img src="./image/edit.png" width="16" height="16" alt="Edit" title="Edit" />';
 
 ///////////////////////////////////////
 // form buttons
Index: ja.lng
===================================================================
RCS file: /cvsroot/pukiwiki/pukiwiki/ja.lng,v
retrieving revision 1.25
diff -u -r1.25 ja.lng
--- ja.lng	3 Apr 2004 15:27:07 -0000	1.25
+++ ja.lng	1 Sep 2004 10:29:38 -0000
@@ -50,6 +50,7 @@
 // symbols
 $_symbol_anchor = '&dagger;';
 $_symbol_noexists = '?';
+$_symbol_paraedit ='<img src="./image/edit.png" width="16" height="16" alt="Edit" title="Edit" />';
 
 ///////////////////////////////////////
 // form buttons
Index: lib/convert_html.php
===================================================================
RCS file: /cvsroot/pukiwiki/pukiwiki/lib/convert_html.php,v
retrieving revision 1.1
diff -u -r1.1 convert_html.php
--- lib/convert_html.php	1 Aug 2004 01:54:35 -0000	1.1
+++ lib/convert_html.php	1 Sep 2004 10:29:39 -0000
@@ -923,7 +923,7 @@
 		global $top,$_symbol_anchor;
 
 		$anchor = (($id = make_heading($text,FALSE)) == '') ?
-			'' : " &aname($id,super,full)\{$_symbol_anchor};";
+			'' : " &aname($id,super,full)\{$_symbol_anchor}; &edit(,$id);";
 		$text = ' '.$text;
 		$id = "content_{$this->id}_{$this->count}";
 		$this->count++;
Index: lib/html.php
===================================================================
RCS file: /cvsroot/pukiwiki/pukiwiki/lib/html.php,v
retrieving revision 1.2
diff -u -r1.2 html.php
--- lib/html.php	6 Aug 2004 15:41:41 -0000	1.2
+++ lib/html.php	1 Sep 2004 10:29:39 -0000
@@ -175,6 +175,7 @@
 	$s_digest = htmlspecialchars($digest);
 	$s_postdata = htmlspecialchars($refer.$postdata);
 	$s_original = array_key_exists('original',$vars) ? htmlspecialchars($vars['original']) : $s_postdata;
+	$s_id = array_key_exists('id',$vars) ? htmlspecialchars($vars['id']) : '';
 	$b_preview = array_key_exists('preview',$vars); // ¥×¥ì¥Ó¥å¡¼ÃæTRUE
 	$btn_preview = $b_preview ? $_btn_repreview : $_btn_preview;
 
@@ -186,6 +187,7 @@
   <input type="hidden" name="cmd" value="edit" />
   <input type="hidden" name="page" value="$s_page" />
   <input type="hidden" name="digest" value="$s_digest" />
+  <input type="hidden" name="id" value="$s_id" />
   <textarea name="msg" rows="$rows" cols="$cols">$s_postdata</textarea>
   <br />
   <input type="submit" name="preview" value="$btn_preview" accesskey="p" />
Index: plugin/edit.inc.php
===================================================================
RCS file: /cvsroot/pukiwiki/pukiwiki/plugin/edit.inc.php,v
retrieving revision 1.15
diff -u -r1.15 edit.inc.php
--- plugin/edit.inc.php	31 Jul 2004 03:09:20 -0000	1.15
+++ plugin/edit.inc.php	1 Sep 2004 10:29:41 -0000
@@ -21,7 +21,17 @@
 		return plugin_edit_write();
 	}
 
-	$postdata = @join('', get_source($page));
+	$source = get_source($vars['page']);
+	$postdata = $vars['original'] = join('',$source);
+	if (!empty($vars['id']))
+	{
+		$postdata = plugin_edit_parts($vars['id'],$source);
+		if ($postdata === FALSE)
+		{
+			unset($vars['id']); // ¤Ê¤«¤Ã¤¿¤³¤È¤Ë :)
+			$postdata = $vars['original'];
+		}
+	}
 	if ($postdata == '') {
 		$postdata = auto_template($page);
 	}
@@ -72,6 +82,31 @@
 
 	return array('msg'=>$_title_preview, 'body'=>$body);
 }
+function plugin_edit_inline()
+{
+	global $script,$vars;
+	global $_symbol_paraedit;
+	
+	$args = func_get_args();
+	
+	$s_label = array_pop($args);
+	if ($s_label == '')
+	{
+		$s_label = $_symbol_paraedit;
+	}
+	
+	list($page,$id) = array_pad($args,2,'');
+	if (!is_page($page))
+	{
+		$page = $vars['page'];
+	}
+	if ($id != '')
+	{
+		$id = '&amp;id='.rawurlencode($id);
+	}
+	$r_page = rawurlencode($page);
+	return "<a class=\"anchor_super\" href=\"$script?cmd=edit&amp;page=$r_page$id\" title=\"Edit\">$s_label</a>";
+}
 
 // ½ñ¤­¹þ¤ß¤â¤·¤¯¤ÏÄÉ²Ã¤â¤·¤¯¤Ï¥³¥á¥ó¥È¤ÎÁÞÆþ
 function plugin_edit_write()
@@ -92,6 +127,16 @@
 		} else {
 			$postdata  = @join('', get_source($page)) . "\n\n" . $postdata;
 		}
+	} else {
+		if (isset($vars['id']) && $vars['id']) {
+			$source = preg_split('/([^\n]*\n)/',$vars['original'],-1,PREG_SPLIT_NO_EMPTY|PREG_SPLIT_DELIM_CAPTURE);
+			if (plugin_edit_parts($vars['id'],$source,$vars['msg']) !== FALSE) {
+				$postdata = $postdata_input = join('',$source);
+			} else {
+				// $vars['msg']¤À¤±¤¬¥Ú¡¼¥¸¤Ë½ñ¤­¹þ¤Þ¤ì¤Æ¤·¤Þ¤¦¤Î¤òËÉ¤°¡£
+				$postdata = $postdata_input = rtrim($vars['original'])."\n\n".$vars['msg'];
+			}
+		}
 	}
 
 	$oldpagesrc = join('', get_source($page));
@@ -110,6 +155,7 @@
 			$retvars['body'] .= $do_update_diff_table;
 		}
 
+		unset($vars['id']);// ¹¹¿·¤¬¾×ÆÍ¤·¤¿¤éÁ´Ê¸ÊÔ½¸¤ËÀÚ¤êÂØ¤¨
 		$retvars['body'] .= edit_form($page, $postdata_input, $oldpagemd5, FALSE);
 	}
 	else {
@@ -128,5 +174,21 @@
 
 	return $retvars;
 }
+// ¥½¡¼¥¹¤Î°ìÉô¤òÃê½Ð/ÃÖ´¹¤¹¤ë
+function plugin_edit_parts($id,&$source,$postdata='')
+{
+	$postdata = rtrim($postdata)."\n";
+	$heads = preg_grep('/^\*{1,3}.+$/',$source);
+	$heads[count($source)] = ''; // sentinel
+	while (list($start,$line) = each($heads))
+	{
+		if (preg_match("/\[#$id\]/",$line))
+		{
+			list($end,$line) = each($heads);
+			return join('',array_splice($source,$start,$end - $start,$postdata));
+		}
+	}
+	return FALSE;
+}
 
 ?>
Index: plugin/menu.inc.php
===================================================================
RCS file: /cvsroot/pukiwiki/pukiwiki/plugin/menu.inc.php,v
retrieving revision 1.6
diff -u -r1.6 menu.inc.php
--- plugin/menu.inc.php	4 Sep 2004 05:42:37 -0000	1.6
+++ plugin/menu.inc.php	9 Sep 2004 03:59:11 -0000
@@ -42,7 +42,8 @@
 		return '<!-- #menu(): You already view ' .
 			htmlspecialchars($page) . ' -->';
 	} else {
-		return preg_replace('/<ul[^>]*>/', '<ul>', convert_html(get_source($page)));
+		$menutext = preg_replace('/^(\*{1,3}.*)\[#[A-Za-z][\w-]+\](.*)$/m','$1$2',get_source($page));  // ¸«¤À¤·ÊÔ½¸¥¢¥ó¥«¡¼¤Ï¥«¥Ã¥È¤¹¤ë
+		return preg_replace('/<ul[^>]*>/','<ul>',convert_html($menutext));  
 	}
 }
 ?>
