From 3c650f2cf6ef955ed3de02f0acc0ff9f9948fd97 Mon Sep 17 00:00:00 2001
From: Jacques Distler
Date: Mon, 15 Aug 2011 10:18:18 -0500
Subject: [PATCH] StringScanner is not multibyte-safe. Avoid like the plague.
---
test/unit/page_renderer_test.rb | 8 +++++++-
vendor/plugins/maruku/lib/maruku/input/charsource.rb | 5 +++--
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/test/unit/page_renderer_test.rb b/test/unit/page_renderer_test.rb
index 831612a2..9e633d96 100644
--- a/test/unit/page_renderer_test.rb
+++ b/test/unit/page_renderer_test.rb
@@ -466,7 +466,13 @@ END_THM
'
',
'_should we go ThatWay or ThisWay _')
end
-
+
+ def test_content_with_utf8_in_strong
+ assert_markup_parsed_as(
+ "Can we handle \u221E-gerbe
",
+ "Can we handle **\u221E-gerbe**")
+ end
+
def test_content_with_redirected_link
assert_markup_parsed_as(
"This is a redirected link: " +
diff --git a/vendor/plugins/maruku/lib/maruku/input/charsource.rb b/vendor/plugins/maruku/lib/maruku/input/charsource.rb
index 8157e875..d272b178 100644
--- a/vendor/plugins/maruku/lib/maruku/input/charsource.rb
+++ b/vendor/plugins/maruku/lib/maruku/input/charsource.rb
@@ -33,8 +33,9 @@ class CharSourceDebug; end
# Choose!
-#CharSource = CharSourceManual # faster! 58ms vs. 65ms
-CharSource = CharSourceStrscan # Seems faster on LONG documents (where we care)
+CharSource = CharSourceManual # faster! 58ms vs. 65ms
+#CharSource = CharSourceStrscan # Faster on LONG documents. But it's not multi-byte aware
+ # (at least in Ruby 1.9.2 and earlier), Hence unusable in Ruby 1.9.
#CharSource = CharSourceDebug