@@ -159,7 +159,9 @@ sub do_cmd_dfn{
159159sub do_cmd_emph{
160160 return use_italics(@_ ); }
161161sub do_cmd_file{
162- return use_wrappers(@_ [0], ' "<tt class=file>' , ' </tt>"' ); }
162+ return use_wrappers(@_ [0], ' <tt class=file>' , ' </tt>' ); }
163+ sub do_cmd_filenq{
164+ return use_wrappers(@_ [0], ' <tt class=file>' , ' </tt>' ); }
163165sub do_cmd_samp{
164166 return use_wrappers(@_ [0], ' "<tt class=samp>' , ' </tt>"' ); }
165167sub do_cmd_kbd{
@@ -789,6 +791,19 @@ sub get_th{
789791 return $r ;
790792}
791793
794+ sub fix_font{
795+ # do a little magic on a font name to get the right behavior in the first
796+ # column of the output table
797+ my $font = @_ [0];
798+ if ($font eq ' textrm' ) {
799+ $font = ' ' ;
800+ }
801+ elsif ($font eq ' file' || $font eq ' filenq' ) {
802+ $font = ' tt class=file' ;
803+ }
804+ return $font ;
805+ }
806+
792807sub setup_column_alignments{
793808 local ($_ ) = @_ ;
794809 my ($a1 ,$a2 ,$a3 ,$a4 ) = split (/ [|]/ ,$_ );
@@ -804,96 +819,103 @@ sub setup_column_alignments{
804819sub do_env_tableii{
805820 local ($_ ) = @_ ;
806821 my ($th1 ,$th2 ,$th3 ,$th4 ) = setup_column_alignments(next_argument());
807- my $font = next_argument();
822+ my $font = fix_font( next_argument() );
808823 my $h1 = next_argument();
809824 my $h2 = next_argument();
810- $font = ' '
811- if ($font eq ' textrm' );
825+ s / [\s\n ]+// ;
812826 $globals {' lineifont' } = $font ;
813- return ' <table border align=center><thead>'
814- . " \n <tr$TABLE_HEADER_BGCOLOR >"
815- . " \n $th1 <b>$h1 </b></th>"
816- . " \n $th2 <b>$h2 </b></th>"
817- . " \n </thead>"
818- . " \n <tbody valign=baseline>"
827+ return ' <table border align=center>'
828+ . " \n <thead>"
829+ . " \n <tr$TABLE_HEADER_BGCOLOR >"
830+ . " \n $th1 <b>$h1 </b></th>"
831+ . " \n $th2 <b>$h2 </b></th>"
832+ . " \n </thead>"
833+ . " \n <tbody valign=baseline>"
819834 . $_
820- . " \n </tbody></table>" ;
835+ . " \n </tbody>"
836+ . " \n </table>" ;
821837}
822838
823839sub do_cmd_lineii{
824840 local ($_ ) = @_ ;
825841 my $c1 = next_argument();
826842 my $c2 = next_argument();
843+ s / [\s\n ]+// ;
827844 my ($font ,$sfont ,$efont ) = ($globals {' lineifont' }, ' ' , ' ' );
828845 if ($font ) {
829846 $sfont = " <$font >" ;
830847 $efont = " </$font >" ;
848+ $efont =~ s / .*>/ >/ ;
831849 }
832850 my ($c1align ,$c2align ) = @col_aligns [0,1];
833- return " <tr>$c1align$sfont$c1$efont </td>\n "
834- . " $c2align$c2 \& nbsp;</td>"
851+ return " \n <tr>$c1align$sfont$c1$efont </td>\n "
852+ . " $c2align$c2 \& nbsp;</td>"
835853 . $_ ;
836854}
837855
838856sub do_env_tableiii{
839857 local ($_ ) = @_ ;
840858 my ($th1 ,$th2 ,$th3 ,$th4 ) = setup_column_alignments(next_argument());
841- my $font = next_argument();
859+ my $font = fix_font( next_argument() );
842860 my $h1 = next_argument();
843861 my $h2 = next_argument();
844862 my $h3 = next_argument();
845- $font = ' '
846- if ($font eq ' textrm' );
863+ s / [\s\n ]+// ;
847864 $globals {' lineifont' } = $font ;
848- return ' <table border align=center><thead>'
849- . " \n <tr$TABLE_HEADER_BGCOLOR >"
850- . " \n $th1 <b>$h1 </b></th>"
851- . " \n $th2 <b>$h2 </b></th>"
852- . " \n $th3 <b>$h3 </b></th>"
853- . " \n </thead>"
854- . " \n <tbody valign=baseline>"
865+ return ' <table border align=center>'
866+ . " \n <thead>"
867+ . " \n <tr$TABLE_HEADER_BGCOLOR >"
868+ . " \n $th1 <b>$h1 </b></th>"
869+ . " \n $th2 <b>$h2 </b></th>"
870+ . " \n $th3 <b>$h3 </b></th>"
871+ . " \n </thead>"
872+ . " \n <tbody valign=baseline>"
855873 . $_
856- . " \n </tbody></table>" ;
874+ . " \n </tbody>"
875+ . " \n </table>" ;
857876}
858877
859878sub do_cmd_lineiii{
860879 local ($_ ) = @_ ;
861880 my $c1 = next_argument();
862881 my $c2 = next_argument();
863882 my $c3 = next_argument();
883+ s / [\s\n ]+// ;
864884 my ($font ,$sfont ,$efont ) = ($globals {' lineifont' }, ' ' , ' ' );
865885 if ($font ) {
866886 $sfont = " <$font >" ;
867887 $efont = " </$font >" ;
888+ $efont =~ s / .*>/ >/ ;
868889 }
869890 my ($c1align ,$c2align ,$c3align ) = @col_aligns [0,1,2];
870- return " <tr>$c1align$sfont$c1$efont </td>\n "
871- . " $c2align$c2 </td>\n "
872- . " $c3align$c3 \& nbsp;</td>"
891+ return " \n <tr>$c1align$sfont$c1$efont </td>\n "
892+ . " $c2align$c2 </td>\n "
893+ . " $c3align$c3 \& nbsp;</td>"
873894 . $_ ;
874895}
875896
876897sub do_env_tableiv{
877898 local ($_ ) = @_ ;
878899 my ($th1 ,$th2 ,$th3 ,$th4 ) = setup_column_alignments(next_argument());
879- my $font = next_argument();
900+ my $font = fix_font( next_argument() );
880901 my $h1 = next_argument();
881902 my $h2 = next_argument();
882903 my $h3 = next_argument();
883904 my $h4 = next_argument();
884- $font = ' '
885- if ($font eq ' textrm' );
905+ s / [\s\n ]+// ;
886906 $globals {' lineifont' } = $font ;
887- return ' <table border align=center><thead>'
888- . " \n <tr$TABLE_HEADER_BGCOLOR >"
889- . " \n $th1 <b>$h1 </b></th>"
890- . " \n $th2 <b>$h2 </b></th>"
891- . " \n $th3 <b>$h3 </b></th>"
892- . " \n $th4 <b>$h4 </b></th>"
893- . " \n </thead>"
894- . " \n <tbody valign=baseline>"
907+ return ' <table border align=center>'
908+ . " \n <thead>"
909+ . " \n <tr$TABLE_HEADER_BGCOLOR >"
910+ . " \n $th1 <b>$h1 </b></th>"
911+ . " \n $th2 <b>$h2 </b></th>"
912+ . " \n $th3 <b>$h3 </b></th>"
913+ . " \n $th4 <b>$h4 </b></th>"
914+ . " \n </thead>"
915+ . " \n <tbody valign=baseline>"
895916 . $_
896- . " \n </tbody></table>" ;
917+ . " \n </tbody>"
918+ . " \n </table>" ;
897919}
898920
899921sub do_cmd_lineiv{
@@ -902,16 +924,18 @@ sub do_cmd_lineiv{
902924 my $c2 = next_argument();
903925 my $c3 = next_argument();
904926 my $c4 = next_argument();
927+ s / [\s\n ]+// ;
905928 my ($font ,$sfont ,$efont ) = ($globals {' lineifont' }, ' ' , ' ' );
906929 if ($font ) {
907930 $sfont = " <$font >" ;
908931 $efont = " </$font >" ;
932+ $efont =~ s / .*>/ >/ ;
909933 }
910934 my ($c1align ,$c2align ,$c3align ,$c4align ) = @col_aligns ;
911- return " <tr>$c1align$sfont$c1$efont </td>\n "
912- . " $c2align$c2 </td>\n "
913- . " $c3align$c3 </td>\n "
914- . " $c4align$c4 \& nbsp;</td>"
935+ return " \n <tr>$c1align$sfont$c1$efont </td>\n "
936+ . " $c2align$c2 </td>\n "
937+ . " $c3align$c3 </td>\n "
938+ . " $c4align$c4 \& nbsp;</td>"
915939 . $_ ;
916940}
917941
0 commit comments