Changeset 10496
- Timestamp:
- 2005-08-11T17:27:49+12:00 (19 years ago)
- Location:
- trunk/gsdl/perllib/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/StructuredHTMLPlug.pm
r10443 r10496 96 96 my $body_text = join("<body", @head_and_body); 97 97 98 if (defined $self->{'extracted_word_metadata_fields'} ) {98 if (defined $self->{'extracted_word_metadata_fields'} && $self->{'extracted_word_metadata_fields'}=~ /\S/) { 99 99 my @doc_properties = split(/<xml>/i,$head); 100 100 my $doc_heading = shift(@doc_properties); … … 105 105 } 106 106 107 # If checkout_toc is enables, it means to get rid of toc and tof contents.107 # If delete_toc is enables, it means to get rid of toc and tof contents. 108 108 # get rid of TOC and TOF sections and their title 109 if ( defined $self->{'checkout_toc'}){109 if ($self->{'delete_toc'} == 1){ 110 110 #line-height:150%;mso-ansi-language:FR'>Contents<o:p></o:p></span></b></p> 111 111 # get rid of Table of Contents title and Table of Figures 112 # these two lines don't work - how can we do this properlly?? 112 113 #$body_text =~ s/<p[^>]*><b><span[^>]*>(Table of Content.|Content.)<o:p><\/o:p><\/span><\/b><\/p>//isg; 113 114 #$body_text =~ s/<p[^>]*><b><span[^>]*>(Table of Figure.|Figure.)<o:p><\/o:p><\/span><\/b><\/p>//isg; 114 $body_text =~ s/<p class=(($self->{'toc_header'})[^>]*)>(.+?)<\/p>//isg; 115 $body_text =~ s/<p class=(($self->{'tof_header'})[^>]*)>(.+?)<\/p>//isg; 116 } 117 118 if (defined $self->{'title_header'}){ 115 if (defined $self->{'toc_header'}&& $self->{'toc_header'} =~ /\S/){ 116 $body_text =~ s/<p class=(($self->{'toc_header'})[^>]*)>(.+?)<\/p>//isg; 117 } 118 if (defined $self->{'tof_header'}&& $self->{'tof_header'}=~ /\S/) { 119 $body_text =~ s/<p class=(($self->{'tof_header'})[^>]*)>(.+?)<\/p>//isg; 120 } 121 } 122 123 if (defined $self->{'title_header'} && $self->{'title_header'}=~ /\S/){ 119 124 $self->{'title_header'} =~ s/^(\()(.*)(\))/$2/is; 120 125 $body_text =~ s/<p class=(($self->{'title_header'})[^>]*)>(.+?)<\/p>/<p class=$1><title>$3<\/title><\/p>/isg; … … 126 131 } 127 132 128 if (defined $self->{'level2_header'} ){133 if (defined $self->{'level2_header'} && $self->{'level2_header'}=~ /\S/){ 129 134 $self->{'level2_header'} =~ s/^\((.*)\)/$1/i; 130 135 $body_text =~ s/<p class=(($self->{'level2_header'})[^>]*)>(.+?)<\/p>/<p class=$1><h2>$3<\/h2><\/p>/ig; 131 136 } 132 137 133 if (defined $self->{'level3_header'} && $self->{'level3_header'}=~ /\S/ ){138 if (defined $self->{'level3_header'} && $self->{'level3_header'}=~ /\S/ ){ 134 139 $self->{'level3_header'} =~ s/^\((.*)\)/$1/is; 135 140 $body_text =~ s/<p class=(($self->{'level3_header'})[^>]*)>(.+?)<\/p>/<p class=$1><h3>$3<\/h3><\/p>/isg; -
trunk/gsdl/perllib/plugins/WordPlug.pm
r10441 r10496 28 28 29 29 use ConvertToPlug; 30 require StructuredHTMLPlug;31 30 use strict; 32 31 no strict 'refs'; # allow filehandles to be variables and viceversa 33 32 34 33 sub BEGIN { 35 #@WordPlug::ISA = ('ConvertToPlug','StructuredHTMLPlug');36 34 @WordPlug::ISA = ('ConvertToPlug'); 37 35 } … … 61 59 'type' => "flag", 62 60 'reqd' => "no" }, 63 { 'name' => " checkout_toc",64 'desc' => "{WordPlug. checkout_toc}",61 { 'name' => "delete_toc", 62 'desc' => "{WordPlug.delete_toc}", 65 63 'type' => "flag", 66 64 'reqd' => "no"}, … … 127 125 push (@$structhtml_options , "-title_sub", '^(Page\s+\d+)?(\s*1\s+)?'); 128 126 push (@$structhtml_options, "-description_tags") if $self->{'windows_scripting'}; 129 push (@$structhtml_options, "- checkout_toc") if $self->{'checkout_toc'};127 push (@$structhtml_options, "-delete_toc") if $self->{'delete_toc'}; 130 128 push (@$structhtml_options, "-toc_header", $self->{'toc_header'}) if $self->{'toc_header'}; 131 129 push (@$structhtml_options, "-tof_header", $self->{'tof_header'}) if $self->{'tof_header'};
Note:
See TracChangeset
for help on using the changeset viewer.