Index: app/helpers/application_helper.rb
===================================================================
--- app/helpers/application_helper.rb	(revisão 1930)
+++ app/helpers/application_helper.rb	(cópia de trabalho)
@@ -260,7 +260,6 @@
     text = (Setting.text_formatting == 'textile') ?
       Redmine::WikiFormatting.to_html(text) { |macro, args| exec_macro(macro, obj, args) } :
       simple_format(auto_link(h(text)))
-
     # different methods for formatting wiki links
     case options[:wiki_links]
     when :local
@@ -270,7 +269,7 @@
       # used for single-file wiki export
       format_wiki_link = Proc.new {|project, title, anchor| "##{title}" }
     else
-      format_wiki_link = Proc.new {|project, title, anchor| url_for(:only_path => only_path, :controller => 'wiki', :action => 'index', :id => project, :page => title, :anchor => anchor) }
+      format_wiki_link = Proc.new {|project, title, anchor, parent| url_for(:only_path => only_path, :controller => 'wiki', :action => 'index', :id => project, :page => title, :anchor => anchor, :parent => parent.title) }
     end
     
     project = options[:project] || @project || (obj && obj.respond_to?(:project) ? obj.project : nil)
@@ -303,7 +302,7 @@
           end
           # check if page exists
           wiki_page = link_project.wiki.find_page(page)
-          link_to((title || page), format_wiki_link.call(link_project, Wiki.titleize(page), anchor),
+          link_to((title || page), format_wiki_link.call(link_project, Wiki.titleize(page), anchor, obj.page),
                                    :class => ('wiki-page' + (wiki_page ? '' : ' new')))
         else
           # project or wiki doesn't exist
Index: app/controllers/wiki_controller.rb
===================================================================
--- app/controllers/wiki_controller.rb	(revisão 1930)
+++ app/controllers/wiki_controller.rb	(cópia de trabalho)
@@ -52,7 +52,7 @@
       send_data(@content.text, :type => 'text/plain', :filename => "#{@page.title}.txt")
       return
     end
-	@editable = editable?
+    @editable = editable?
     render :action => 'show'
   end
   
@@ -60,7 +60,11 @@
   def edit
     @page = @wiki.find_or_new_page(params[:page])    
     return render_403 unless editable?
-    @page.content = WikiContent.new(:page => @page) if @page.new_record?
+
+    if @page.new_record?
+      @page.content = WikiContent.new(:page => @page) 
+      @page.parent_title = params[:parent]
+    end
     
     @content = @page.content_for_version(params[:version])
     @content.text = "h1. #{@page.pretty_title}" if @content.text.blank?
Index: app/views/wiki/edit.rhtml
===================================================================
--- app/views/wiki/edit.rhtml	(revisão 1930)
+++ app/views/wiki/edit.rhtml	(cópia de trabalho)
@@ -2,6 +2,7 @@
 
 <% form_for :content, @content, :url => {:action => 'edit', :page => @page.title}, :html => {:id => 'wiki_form'} do |f| %>
 <%= f.hidden_field :version %>
+<%= hidden_field_tag 'parent', @page.parent_title %>
 <%= error_messages_for 'content' %>
 
 <p><%= f.text_area :text, :cols => 100, :rows => 25, :class => 'wiki-edit', :accesskey => accesskey(:edit) %></p>
