add a loop to the scramble driver because it can fail to scramble occasionally
[catagits/catbook-code.git] / lib / LolCatalyst / Lite / Translator / Driver / Scramble.pm
index c6e0b6e..722c20b 100644 (file)
@@ -40,8 +40,11 @@ with 'LolCatalyst::Lite::Interface::TranslationDriver';
 
 sub translate {
   my ($self, $text) = @_;
-  _scramble_block(\$text);
-  return $text;
+  my $copy = $text;
+  do {
+    _scramble_block(\$copy);
+  } until ($copy ne $text);
+  return $copy;
 }
 
 1;