diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index ddd82b32..01cca47b 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -190,10 +190,10 @@ EOL if [:markdownMML, :markdownPNG, :markdown].include?(@web.markup) @tex_content = '' # Ruby 1.9.x has ordered hashes; 1.8.x doesn't. So let's just parse the query ourselves. - ordered_params = ActiveSupport::OrderedHash[*request.raw_post.split('&').collect {|k_v| k_v.split('=').each {|x| CGI::unescape(x)}}.flatten] + ordered_params = ActiveSupport::OrderedHash[*request.raw_post.split('&').collect {|k_v| k_v.split('=').collect {|x| CGI::unescape(x)}}.flatten] ordered_params.each do |name, p| if p == 'tex' && @web.has_page?(name) - @tex_content << "\\section*\{#{name}\}\n\n".as_utf8 + @tex_content << "\\section*\{#{Maruku.new(name).to_latex.strip}\}\n\n" @tex_content << Maruku.new(@web.page(name).content).to_latex end end diff --git a/app/views/wiki/list.rhtml b/app/views/wiki/list.rhtml index 9abb16de..ff386788 100644 --- a/app/views/wiki/list.rhtml +++ b/app/views/wiki/list.rhtml @@ -28,7 +28,7 @@ <% end %> -<%= sortable_element('sortable_pages') %> +<%= sortable_element('sortable_pages', {:onUpdate => 'function(){}'}) %> <%= submit_tag("Export") %> diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb index d43b4bcb..087c3cef 100644 --- a/test/functional/wiki_controller_test.rb +++ b/test/functional/wiki_controller_test.rb @@ -1346,13 +1346,13 @@ Page2 contents $\mathbb{01234}$. end def test_tex_list - @wiki.write_page('wiki1', 'Page2', + @wiki.write_page('wiki1', "Ch\303\242timent & Page", "Page2 contents $\\mathbb{01234}$.\n", Time.now, Author.new('AnotherAuthor', '127.0.0.2'), x_test_renderer) - @request.env['RAW_POST_DATA'] = "_form_key=353106ff8c8466727ee5338baaa0640c87c9b0d6&Page2=tex&BogusPage=tex&HomePage=tex&commit=Export" + @request.env['RAW_POST_DATA'] = "_form_key=353106ff8c8466727ee5338baaa0640c87c9b0d6&Ch%C3%A2timent+%26+Page=tex&BogusPage=tex&HomePage=tex&commit=Export" r = process('tex_list', 'web' => 'wiki1', 'Page2' => 'tex', 'BogusPage'=> 'tex', 'HomePage' => 'tex') assert_response(:success) - assert_equal @tex_header1 + "\\usepackage{mathbbol}\n" + @tex_header2 + %q!\section*{Page2} + assert_equal @tex_header1 + "\\usepackage{mathbbol}\n" + @tex_header2 + %q!\section*{Châtiment \\& Page} Page2 contents $\mathbb{01234}$.