diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb index 087c3cef..e1c5a050 100644 --- a/test/functional/wiki_controller_test.rb +++ b/test/functional/wiki_controller_test.rb @@ -690,7 +690,7 @@ class WikiControllerTest < ActionController::TestCase a = ''.respond_to?(:force_encoding) ? "\u{1D538}\u00FCthorOfNewPage" : "\360\235\224\270\303\274thorOfNewPage" assert_equal a, new_page.author - assert_equal "\xF0\x9D\x94\xB8\xC3\xBCthorOfNewPage".as_bytes, r.cookies['author'] + assert_equal a, r.cookies['author'] end def test_save_not_utf8 diff --git a/test/unit/page_renderer_test.rb b/test/unit/page_renderer_test.rb index 506273ff..c0f94774 100644 --- a/test/unit/page_renderer_test.rb +++ b/test/unit/page_renderer_test.rb @@ -230,6 +230,20 @@ END_THM end + def test_utf8_in_lists + + assert_markup_parsed_as( + "", + "* \u041E\u0434\u0438\u043D\n* \u0414\u0432\u0430\n* \u0422\u0440\u0438\n") + + assert_markup_parsed_as( + "
    \n
  1. \u041E\u0434\u0438\u043D
  2. \n\n
  3. \u0414"+ + "\u0432\u0430
  4. \n\n
  5. \u0422\u0440\u0438
  6. \n
", + "1. \u041E\u0434\u0438\u043D\n2. \u0414\u0432\u0430\n3. \u0422\u0440\u0438\n") + + end + def test_have_latest_itex2mml assert_markup_parsed_as( diff --git a/vendor/plugins/maruku/lib/maruku/input/parse_doc.rb b/vendor/plugins/maruku/lib/maruku/input/parse_doc.rb index 7808ed22..5f362233 100644 --- a/vendor/plugins/maruku/lib/maruku/input/parse_doc.rb +++ b/vendor/plugins/maruku/lib/maruku/input/parse_doc.rb @@ -204,8 +204,8 @@ Disabled by default because of security concerns. # Select all text elements of e XPath.match(e, "//text()" ).each { |original_text| - s = original_text.value.strip - if s.size > 0 + s = original_text.value + if s.strip.size > 0 # puts "Parsing #{s.inspect} as blocks: #{parse_blocks} (#{e.name}, #{e.attributes['markdown']}) " diff --git a/vendor/plugins/maruku/lib/maruku/input/type_detection.rb b/vendor/plugins/maruku/lib/maruku/input/type_detection.rb index 716fde70..ba086f2f 100644 --- a/vendor/plugins/maruku/lib/maruku/input/type_detection.rb +++ b/vendor/plugins/maruku/lib/maruku/input/type_detection.rb @@ -53,8 +53,8 @@ module MaRuKu; module Strings # Something is wrong with how we parse lists! :-( #return :ulist if l =~ /^[ ]{0,3}([\*\-\+])\s+.*\w+/ #return :olist if l =~ /^[ ]{0,3}\d+\..*\w+/ - return :ulist if l =~ /^[ ]{0,1}([\*\-\+])\s+.*\w+/ - return :olist if l =~ /^[ ]{0,1}\d+\..*\w+/ + return :ulist if l =~ /^[ ]{0,1}([\*\-\+])\s+.*/ + return :olist if l =~ /^[ ]{0,1}\d+\..*/ return :header1 if l =~ /^(=)+/ return :header2 if l =~ /^([-\s])+$/ return :header3 if l =~ /^(#)+\s*\S+/