texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[7598] commit Plaintext.pm


From: gavinsmith0123
Subject: [7598] commit Plaintext.pm
Date: Sun, 1 Jan 2017 12:33:25 +0000 (UTC)

Revision: 7598
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7598
Author:   gavin
Date:     2017-01-01 12:33:24 +0000 (Sun, 01 Jan 2017)
Log Message:
-----------
commit Plaintext.pm

Modified Paths:
--------------
    trunk/tp/Texinfo/Convert/Plaintext.pm

Modified: trunk/tp/Texinfo/Convert/Plaintext.pm
===================================================================
--- trunk/tp/Texinfo/Convert/Plaintext.pm       2017-01-01 12:26:02 UTC (rev 
7597)
+++ trunk/tp/Texinfo/Convert/Plaintext.pm       2017-01-01 12:33:24 UTC (rev 
7598)
@@ -588,6 +588,25 @@
   return $text;
 }
 
+UNITCHECK {
+  Texinfo::XSLoader::override(
+    "Texinfo::Convert::Plaintext::_process_text_internal",
+    "Texinfo::MiscXS::process_text");
+}
+
+sub _process_text_internal {
+  my ($text) = @_;
+
+  $text =~ s/---/\x{1F}/g;
+  $text =~ s/--/-/g;
+  $text =~ s/\x{1F}/--/g;
+  $text =~ s/``/"/g;
+  $text =~ s/\'\'/"/g;
+  $text =~ s/`/'/g;
+
+  return $text;
+}
+
 # Convert ``, '', `, ', ---, -- in $COMMAND->{'text'} to their output,
 # possibly coverting to upper case as well.
 sub _process_text($$$)
@@ -614,12 +633,7 @@
     return Texinfo::Convert::Unicode::unicode_text($text, 
             $context->{'font_type_stack'}->[-1]->{'monospace'});
   } elsif (!$context->{'font_type_stack'}->[-1]->{'monospace'}) {
-    $text =~ s/---/\x{1F}/g;
-    $text =~ s/--/-/g;
-    $text =~ s/\x{1F}/--/g;
-    $text =~ s/``/"/g;
-    $text =~ s/\'\'/"/g;
-    $text =~ s/`/'/g;
+    return _process_text_internal($text);
   }
   return $text;
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]