texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp/Texinfo/Convert HTML.pm


From: Patrice Dumas
Subject: texinfo/tp/Texinfo/Convert HTML.pm
Date: Sat, 04 Aug 2012 20:59:57 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        12/08/04 20:59:57

Modified files:
        tp/Texinfo/Convert: HTML.pm 

Log message:
        Handle monospace fonts using a stack.  This will allow to switch back 
and
        forth to normal and monospace.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/HTML.pm?cvsroot=texinfo&r1=1.243&r2=1.244

Patches:
Index: HTML.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/HTML.pm,v
retrieving revision 1.243
retrieving revision 1.244
diff -u -b -r1.243 -r1.244
--- HTML.pm     3 Aug 2012 23:34:35 -0000       1.243
+++ HTML.pm     4 Aug 2012 20:59:56 -0000       1.244
@@ -137,7 +137,7 @@
 sub in_code($)
 {
   my $self = shift;
-  return $self->{'document_context'}->[-1]->{'code'};
+  return $self->{'document_context'}->[-1]->{'monospace'}->[-1];
 }
 
 sub in_string($)
@@ -4447,6 +4447,7 @@
            'formatting_context' => [{'cmdname' => $cmdname}],
            'composition_context' => ['raggedright'],
            'formats' => [],
+           'monospace' => [0],
           };
 }
 
@@ -7291,7 +7292,7 @@
       } 
       if ($code_style_commands{$command_name} or 
           $preformatted_code_commands{$command_name}) {
-        $self->{'document_context'}->[-1]->{'code'}++;
+        push @{$self->{'document_context'}->[-1]->{'monospace'}}, 1;
       } elsif ($upper_case_commands{$command_name}) {
         
$self->{'document_context'}->[-1]->{'formatting_context'}->[-1]->{'upper_case'}++;
       } elsif ($command_name eq 'math') {
@@ -7328,9 +7329,11 @@
               if ($arg_type eq 'normal') {
                 $arg_formatted->{'normal'} = $self->_convert($arg, 
$explanation);
               } elsif ($arg_type eq 'monospace') {
-                $self->{'document_context'}->[-1]->{'code'}++;
+                push @{$self->{'document_context'}->[-1]->{'monospace'}}, 1;
+                #$self->{'document_context'}->[-1]->{'code'}++;
                 $arg_formatted->{$arg_type} = $self->_convert($arg, 
$explanation);
-                $self->{'document_context'}->[-1]->{'code'}--;
+                #$self->{'document_context'}->[-1]->{'code'}--;
+                pop @{$self->{'document_context'}->[-1]->{'monospace'}};
               } elsif ($arg_type eq 'string') {
                 $self->_new_document_context($command_type);
                 $self->{'document_context'}->[-1]->{'string'}++;
@@ -7338,7 +7341,7 @@
                 pop @{$self->{'document_context'}};
               } elsif ($arg_type eq 'monospacestring') {
                 $self->_new_document_context($command_type);
-                $self->{'document_context'}->[-1]->{'code'}++;
+                $self->{'document_context'}->[-1]->{'monospace'}->[-1] = 1;
                 $self->{'document_context'}->[-1]->{'string'}++;
                 $arg_formatted->{$arg_type} = $self->_convert($arg, 
$explanation);
                 pop @{$self->{'document_context'}};
@@ -7366,7 +7369,8 @@
       }
       if ($code_style_commands{$command_name} or 
           $preformatted_code_commands{$command_name}) {
-        $self->{'document_context'}->[-1]->{'code'}--;
+        #$self->{'document_context'}->[-1]->{'code'}--;
+        pop @{$self->{'document_context'}->[-1]->{'monospace'}};
       } elsif ($upper_case_commands{$command_name}) {
         
$self->{'document_context'}->[-1]->{'formatting_context'}->[-1]->{'upper_case'}--;
       } elsif ($command_name eq 'math') {
@@ -7432,7 +7436,8 @@
         $root->{'type'};
     }
     if ($self->{'code_types'}->{$root->{'type'}}) {
-      $self->{'document_context'}->[-1]->{'code'}++;
+      #$self->{'document_context'}->[-1]->{'code'}++;
+      push @{$self->{'document_context'}->[-1]->{'monospace'}}, 1;
     }
     if ($root->{'type'} eq '_string') {
       $self->{'document_context'}->[-1]->{'string'}++;
@@ -7456,7 +7461,8 @@
       $result = $content_formatted;
     }
     if ($self->{'code_types'}->{$root->{'type'}}) {
-      $self->{'document_context'}->[-1]->{'code'}--;
+      #$self->{'document_context'}->[-1]->{'code'}--;
+      pop @{$self->{'document_context'}->[-1]->{'monospace'}};
     } 
     if ($root->{'type'} eq '_string') {
       $self->{'document_context'}->[-1]->{'string'}--;



reply via email to

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