ruby 2.7 fix
authorRalph Amissah <ralph.amissah@gmail.com>
Tue, 14 Apr 2020 15:10:59 +0000 (11:10 -0400)
committerRalph Amissah <ralph.amissah@gmail.com>
Sun, 10 May 2020 00:40:02 +0000 (20:40 -0400)
15 files changed:
.gitignore
lib/sisu/ao_doc_str.rb
lib/sisu/ao_numbering.rb
lib/sisu/db_columns.rb
lib/sisu/db_load_tuple.rb
lib/sisu/db_sqltxt.rb
lib/sisu/dp.rb
lib/sisu/html.rb
lib/sisu/html_minitoc.rb
lib/sisu/html_scroll.rb
lib/sisu/shared_metadata.rb
lib/sisu/texpdf.rb
lib/sisu/xhtml_epub2.rb
lib/sisu/xml_odf_odt.rb
lib/sisu/xml_shared.rb

index 327d5c62aec7a16f5b1af2bd2a1aef2422f6cd96..7ec72f9abf7ae930388d9179c98ea2627987a220 100644 (file)
@@ -5,8 +5,10 @@
 *.\#*
 *.tmp
 *_tmp
+.*
 *.gem
 *.gemspec
+!.gitignore
 *_.rb
 *.rb_
 .pc
index 40f5a0456d8f95a27c564ff9a4edd8812190bb70..31fd62eca1ebe5a514b2528ac374045982c5f351 100644 (file)
@@ -296,15 +296,17 @@ module SiSU_AO_DocumentStructureExtract
           else nil
           end
         end
-        if t_o !~/^(?:code(?:\.[a-z][0-9a-z_]+)?(?:\(.+?\))?|box(?:\.[a-z_]+)?|poem|alt|group|block)\{|^\}(?:code|poem|alt|group|block)|^(?:table\(.+?\)\{|\{table\()|^(?:table\{|\{table)[ ~]/ \
-        and t_o !~/^```[ ]+(?:code(?:\.[a-z][0-9a-z_]+)?(?:\(.+?\))?|box(?:\.[a-z_]+)?|poem|alt|group|block|table)|^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$|^`:quote_(?:open|close)`/ \
-        and @per.code==:off \
-        and @per.poem==:off \
-        and @per.group==:off \
-        and @per.block==:off \
-        and @per.alt==:off \
-        and @per.box==:off \
-        and @per.table==:off
+        if (t_o.is_a?(String) \
+          && t_o !~/^(?:code(?:\.[a-z][0-9a-z_]+)?(?:\(.+?\))?|box(?:\.[a-z_]+)?|poem|alt|group|block)\{|^\}(?:code|poem|alt|group|block)|^(?:table\(.+?\)\{|\{table\()|^(?:table\{|\{table)[ ~]/ \
+           && t_o !~/^```[ ]+(?:code(?:\.[a-z][0-9a-z_]+)?(?:\(.+?\))?|box(?:\.[a-z_]+)?|poem|alt|group|block|table)|^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$|^`:quote_(?:open|close)`/ \
+          and @per.code==:off \
+          and @per.poem==:off \
+          and @per.group==:off \
+          and @per.block==:off \
+          and @per.alt==:off \
+          and @per.box==:off \
+          and @per.table==:off
+        )
           t_o=case t_o
           when /^#{Mx[:meta_o]}\S+?#{Mx[:meta_c]}/                                 #metadata, header
             if t_o=~/^#{Mx[:meta_o]}(\S+?)#{Mx[:meta_c]}\s*(.+)/m
@@ -962,9 +964,9 @@ module SiSU_AO_DocumentStructureExtract
         end
         if @per.table==:curls or @per.table==:tics
           if (@per.table==:curls \
-          and t_o =~/^\}table/) \
+          and (t_o.is_a?(String) and t_o =~/^\}table/)) \
           or (@per.table==:tics \
-          and t_o =~/^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/)
+          and (t_o.is_a?(String) and t_o =~/^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/))
             @per.table=:off
             headings,columns,widths,idx=@h[:head_],@h[:cols],@h[:widths],@h[:idx]
             @h={
@@ -998,9 +1000,10 @@ module SiSU_AO_DocumentStructureExtract
         if @per.code==:curls \
         or @per.code==:tics
           if (@per.code==:curls \
-          && t_o =~/^\}code/) \
+          && (t_o.is_a?(String) && t_o =~/^\}code/)) \
           or (@per.code==:tics \
-          && t_o =~/^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/m)
+          && (t_o.is_a?(String) && t_o =~/^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/m) \
+          )
             @per.code=:off
             if @tuned_code[-1]
               @tuned_code[-1].
@@ -1049,11 +1052,11 @@ module SiSU_AO_DocumentStructureExtract
         or (@per.alt==:curls \
         || @per.alt==:tics) \
         or (@per.quote==:open \
-        && t_o =~/`:quote_close`/m) #not
+        && (t_o.is_a?(String) && t_o =~/`:quote_close`/m))
           if (@per.poem==:curls \
-          && t_o =~/^\}poem$/m) \
+          && (t_o.is_a?(String) && t_o.to_s =~/^\}poem$/m)) \
           or (@per.poem==:tics \
-          && t_o =~/^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/)
+          && (t_o.is_a?(String) && t_o =~/^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/))
             @per.poem=:off
             h={
               is_for: :poem,
@@ -1064,9 +1067,9 @@ module SiSU_AO_DocumentStructureExtract
             }
             t_o=SiSU_AO_DocumentStructure::ObjectLayout.new.open_close(h)
           elsif (@per.box==:curls \
-          && t_o =~/^\}box/) \
+          && (t_o.is_a?(String) && t_o =~/^\}box/)) \
           or (@per.box==:tics \
-          && t_o =~/^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/)
+          && (t_o.is_a?(String) && t_o.to_s =~/^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/))
             @per.box=:off
             obj,tags=extract_tags(@tuned_block.join("\n"))
             h={
@@ -1087,9 +1090,9 @@ module SiSU_AO_DocumentStructureExtract
             }
             t_o=SiSU_AO_DocumentStructure::ObjectLayout.new.open_close(h)
           elsif (@per.group==:curls \
-          && t_o =~/^\}group/) \
+          && ( t_o.is_a?(String) && t_o.to_s =~/^\}group/)) \
           or (@per.group==:tics \
-          && t_o =~/^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/)
+          && (t_o.is_a?(String) && t_o.to_s =~/^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/))
             @per.group=:off
             obj,tags=extract_tags(@tuned_block.join("\n"))
             h={
@@ -1109,9 +1112,11 @@ module SiSU_AO_DocumentStructureExtract
             }
             t_o=SiSU_AO_DocumentStructure::ObjectLayout.new.open_close(h)
           elsif (@per.block==:curls \
-          && t_o =~/^\}block/) \
+          && t_o.to_s =~/^\}block/) \
           or (@per.block==:tics \
-          && t_o =~/^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/)
+          && (t_o.is_a?(String) \
+            && t_o =~/^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/) \
+          )
             @per.block=:off
             obj,tags=extract_tags(@tuned_block.join("\n"))
             h={
@@ -1131,9 +1136,11 @@ module SiSU_AO_DocumentStructureExtract
             }
             t_o=SiSU_AO_DocumentStructure::ObjectLayout.new.open_close(h)
           elsif (@per.alt==:curls \
-          && t_o =~/^\}alt/) \
+          && (t_o.is_a?(String) && t_o =~/^\}alt/)) \
           or (@per.alt==:tics \
-          && t_o =~/^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/)
+          && t_o.is_a?(String) \
+            && (t_o =~/^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/)
+          )
             @per.alt=:off
             obj,tags=extract_tags(@tuned_block.join("\n"))
             h={
@@ -1153,7 +1160,7 @@ module SiSU_AO_DocumentStructureExtract
             }
             t_o=SiSU_AO_DocumentStructure::ObjectLayout.new.open_close(h)
           elsif @per.quote==:open \
-          and t_o =~/`:quote_close`/m
+          and (t_o.is_a?(String) &&  t_o =~/`:quote_close`/m)
             @per.quote=:off
             h={
               is_for: :quote,
@@ -1184,10 +1191,12 @@ module SiSU_AO_DocumentStructureExtract
           || @per.block==:tics) \
           or (@per.alt==:curls \
           || @per.alt==:tics) \
-          and t_o =~/\S/ \
-          and t_o !~/^(?:\}(?:verse|code|box|alt|group|block)|(?:verse|code(?:\.[a-z][0-9a-z_]+)?|box(?:\.[a-z_]+)?|alt|group|block)\{)/ \
-          and t_o !~/^```[ ]+(?:code(?:\.[a-z][0-9a-z_]+)?|box(?:\.[a-z_]+)?|poem|alt|group|block)|^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/ # fix logic
-            sub_array=t_o.dup
+          and (t_o.is_a?(String) \
+            and t_o.to_s =~/\S/ \
+            and t_o.to_s !~/^(?:\}(?:verse|code|box|alt|group|block)|(?:verse|code(?:\.[a-z][0-9a-z_]+)?|box(?:\.[a-z_]+)?|alt|group|block)\{)/ \
+            and t_o.to_s !~/^```[ ]+(?:code(?:\.[a-z][0-9a-z_]+)?|box(?:\.[a-z_]+)?|poem|alt|group|block)|^```(?:\s+[~-][#]|\s+\~\{.+?\}\~)?\s*$/
+          )
+            sub_array=t_o.to_s.dup
             @line_mode=sub_array.scan(/.+/)
             type=if @per.poem==:curls or @per.poem==:tics
               t_o=SiSU_AO_DocumentStructureExtract::Build.new(@md,@line_mode).build_lines(type).join
@@ -1230,7 +1239,7 @@ module SiSU_AO_DocumentStructureExtract
                 gsub(/[ ][ ]/m,"#{Mx[:nbsp]*2}").
                 gsub(/#{Mx[:nbsp]}\s/,"#{Mx[:nbsp]*2}")
             end
-            @tuned_block << t_o if t_o =~/\S+/
+            @tuned_block << t_o if t_o.to_s =~/\S+/
           else tuned_file << t_o
           end
         else tuned_file << t_o
@@ -1700,7 +1709,7 @@ SKIPPED processing file:
                 ocnh+=1
               end
               if ln==0 \
-              or ln=~@md.lv0
+              or ln.to_s =~@md.lv0
                 @lev_occurences[:a] += 1
                 if not dob.obj =~/~#|-#/
                   ocn_flag=true
@@ -1716,7 +1725,7 @@ SKIPPED processing file:
                 collapsed_level=@collapsed_lv0
                 node,ocn_sp,parent=node0,"h#{ocnh}",'ROOT'
               elsif ln==1 \
-              or ln=~@md.lv1
+              or ln.to_s =~@md.lv1
                 @lev_occurences[:b] += 1
                 if not dob.obj =~/~#|-#/
                   ocn_flag=true
@@ -1739,7 +1748,7 @@ SKIPPED processing file:
                 collapsed_level=@collapsed_lv1
                 node,ocn_sp,parent=node1,"h#{ocnh}",node0 #FIX
               elsif ln==2 \
-              or ln=~@md.lv2
+              or ln.to_s =~@md.lv2
                 @lev_occurences[:c] += 1
                 if not dob.obj =~/~#|-#/
                   ocn_flag=true
@@ -1762,7 +1771,7 @@ SKIPPED processing file:
                 collapsed_level=@collapsed_lv2
                 node,ocn_sp=node2,"h#{ocnh}"
               elsif ln==3 \
-              or ln=~@md.lv3
+              or ln.to_s =~@md.lv3
                 @lev_occurences[:d] += 1
                 if not dob.obj =~/~#|-#/
                   ocn_flag=true
@@ -1793,7 +1802,7 @@ or this level should be level :B~ rather than #{dob.lv}}
                 collapsed_level=@collapsed_lv3
                 node,ocn_sp=node3,"h#{ocnh}"
               elsif ln==4 \
-              or ln=~@md.lv4
+              or ln.to_s =~@md.lv4
                 @lev_occurences[:l1] += 1
                 if not dob.obj =~/~#|-#/
                   ocn_flag=true
@@ -1827,7 +1836,7 @@ or this level should be level :B~ rather than #{dob.lv}}
                 collapsed_level=@collapsed_lv4
                 node,ocn_sp=node4,"h#{ocnh}"
               elsif ln==5 \
-              or ln=~@md.lv5
+              or ln.to_s =~@md.lv5
                 @lev_occurences[:l2] += 1
                 if not dob.obj =~/~#|-#/
                   ocn_flag=true
@@ -1864,7 +1873,7 @@ or this level should be level :B~ rather than #{dob.lv}}
                 collapsed_level=@collapsed_lv5
                 node,ocn_sp=node5,"h#{ocnh}"
               elsif ln==6 \
-              or ln=~@md.lv6
+              or ln.to_s =~@md.lv6
                 @lev_occurences[:l3] += 1
                 if not dob.obj =~/~#|-#/
                   ocn_flag=true
@@ -1909,7 +1918,7 @@ or this level should be #5 (2~) rather ##{dob.ln} (#{dob.lv}~)"
                 collapsed_level=@collapsed_lv6
                 node,ocn_sp=node6,"h#{ocnh}"
               elsif ln==7 \
-              or ln=~@md.lv7
+              or ln.to_s =~@md.lv7
                 @lev_occurences[:l4] += 1
                 if not dob.obj =~/~#|-#/
                   ocn_flag=true
index c8bafc23a56005e85539ff31a204f3bae7046b66..777c5a44db78bf16cf2fb5f8c9c2c59586c8ebd5 100644 (file)
@@ -590,7 +590,7 @@ module SiSU_AO_Numbering
           : @segname
           tags["#{dob.ocn}"]={ segname: @segname }
           ocn_html_seg[dob.ocn]=if (dob.is==:heading || dob.is==:heading_insert)
-            if dob.ln =~/[0-3]/
+            if dob.ln.to_s =~/[0-3]/
               {
                 seg: nil,
                 level: dob.ln,
index 5ed6e68017113d0cf22a2ac4c1c839d0e8690e1f..608b59a74e6e3c57dd4e4912006ed9ed82f6f284 100644 (file)
@@ -1886,7 +1886,7 @@ module SiSU_DbColumns
         end
         def tuple
           if defined? @md.wc_words \
-          and @md.wc_words=~/\S+/
+          and @md.wc_words.to_s=~/\S+/
             txt=@md.wc_words
             txt=special_character_escape(txt)
             ["#{name}, ","'#{txt}', "]
@@ -1957,15 +1957,16 @@ module SiSU_DbColumns
           %{COMMENT ON COLUMN metadata_and_text.#{name}
            IS 'metadata document links';}
         end
-        def tuple
-          if defined? @md.links \
-          and @md.links=~/\S+/
-            txt=@md.links
-            txt=special_character_escape(txt)
-            ["#{name}, ","'#{txt}', "]
-          else ['','']
-          end
-        end
+        #def tuple
+        #  #BUG HERE - links is an array of paired values :say :url
+        #  if defined? @md.links \
+        #  and @md.links=~/\S+/
+        #    txt=@md.links
+        #    txt=special_character_escape(txt)
+        #    ["#{name}, ","'#{txt}', "]
+        #  else ['','']
+        #  end
+        #end
         self
       end
       self
index 23496388dec153eb7a94c13cee96518a55c3d714..d7b8e8571db8c7d0199a3d76b1aa5075cfce1b42 100644 (file)
@@ -75,17 +75,12 @@ module SiSU_DbTuple
         "INSERT INTO doc_objects (lid, metadata_tid, lev, lev_an, clean, body, book_idx, ocn, ocnd, ocns, seg, lev0, lev1, lev2, lev3, lev4, lev5, lev6, lev7, t_of, t_is, node, parent, digest_clean, digest_all) " +
         "VALUES (#{@col[:lid]}, #{@col[:tid]}, #{@col[:lev]}, '#{@col[:lev_an]}', '#{@col[:plaintext]}', '#{@col[:body]}', '#{@col[:book_idx]}', '#{@col[:ocn]}', '#{@col[:ocnd]}', '#{@col[:ocns]}', '#{@col[:seg]}', '#{@col[:lv0]}', '#{@col[:lv1]}', '#{@col[:lv2]}', '#{@col[:lv3]}', '#{@col[:lv4]}', '#{@col[:lv5]}', '#{@col[:lv6]}', '#{@col[:lv7]}', '#{@col[:t_of]}', '#{@col[:t_is]}', '#{@col[:node]}', '#{@col[:parent]}', '#{@col[:digest_clean]}', '#{@col[:digest_all]}');"
       end
-      if @opt.act[:verbose_plus][:set]==:on
-        if @opt.act[:maintenance][:set]==:on
+      if @opt.act[:maintenance][:set]==:on
           puts @file_maint.inspect
           puts sql_entry
-        end
-        @file_maint.puts sql_entry
-      else
-        if @opt.act[:verbose_plus][:set]==:on
-          puts sql_entry
           @file_maint.puts sql_entry
-        end
+      elsif @opt.act[:verbose_plus][:set]==:on
+          puts sql_entry
       end
       if @opt.act[:verbose][:set]==:on
         if @col[:lev].inspect =~/[0-35-7]/
@@ -189,7 +184,6 @@ module SiSU_DbTuple
 #{@tp.column.src_word_count.tuple[0]}
 #{@tp.column.src_txt.tuple[0]}
 #{@tp.column.fulltext.tuple[0]}
-#{@tp.column.links.tuple[0]}
 tid)
 " +
        "VALUES (
@@ -269,16 +263,11 @@ tid)
 #{@tp.column.src_word_count.tuple[1]}
 #{@tp.column.src_txt.tuple[1]}
 #{@tp.column.fulltext.tuple[1]}
-#{@tp.column.links.tuple[1]}
 #{@id}
 );"
       if @md.opt.act[:maintenance][:set]==:on
         puts "maintenance mode on: creating sql transaction file (for last transaction set (document) only):\n\t#{@file_maint.inspect}"
         @file_maint.puts sql_entry
-      else
-        if @md.opt.act[:verbose_plus][:set]==:on
-          @file_maint.puts sql_entry
-        end
       end
       sql_entry
     end
@@ -292,10 +281,6 @@ tid)
       "VALUES (#{@u[:txt]} #{@u[:html_toc]} #{@u[:html_doc]} #{@u[:xhtml]} #{@u[:xml_sax]} #{@u[:xml_dom]} #{@u[:odf]} #{@u[:pdf_p]} #{@u[:pdf_l]} #{@u[:concordance]} #{@u[:latex_p]} #{@u[:latex_l]} #{@u[:manifest]} #{@u[:digest]} #{@u[:markup]} #{@u[:sisupod]} #{@id});"
       if @opt.act[:maintenance][:set]==:on
         @file_maint.puts sql_entry
-      else
-        if @opt.act[:verbose_plus][:set]==:on
-          @file_maint.puts sql_entry
-        end
       end
       sql_entry
     end
@@ -309,10 +294,6 @@ tid)
       "VALUES ('#{@en[:id]}', '#{@en[:lid]}', '#{@en[:nr]}', '#{@en[:txt]}', '#{@en[:body]}', '#{@en[:ocn]}', '#{@en[:ocnd]}', '#{@en[:ocns]}', '#{@en[:id_t]}', '#{@en[:hash]}');"
       if @opt.act[:maintenance][:set]==:on
         @file_maint.puts sql_entry
-      else
-        if @opt.act[:verbose_plus][:set]==:on
-          @file_maint.puts sql_entry
-        end
       end
       sql_entry
     end
index 9f31124289ab8361e530d01b4136084dc0bb5e84..c6c2e3011c0bfc95bc23358b040009b84950788a 100644 (file)
@@ -55,7 +55,7 @@
 module SiSU_DbText
   class Prepare
     def special_character_escape(str)
-      str=str.gsub(/'/m,"''"). #string.gsub!(/'/,"\047") #string.gsub!(/'/,"\\'")
+      str=str.to_s.gsub(/'/m,"''"). #string.gsub!(/'/,"\047") #string.gsub!(/'/,"\\'")
         gsub(/(\\)/m,'\1\1'). #ok but with warnings, double backslash on sqlite #str.gsub!(/[\\]/m,'\\x5C') #ok but with warnings, but not for sqlite #str.gsub!(/(\\)/m,'\1') #ok for sqlite not for pgsql
         gsub(/#{Mx[:br_line]}|#{Mx[:br_nl]}/m,"<br>\n").
         gsub(/#{Mx[:tag_o]}\S+?#{Mx[:tag_c]}/m,''). #check
index 522510ad7d772e59065f0fe8bf1b65fac460e8c3..3c7b920335d58fec64882469740ebf1ccf5a9709 100644 (file)
@@ -1305,8 +1305,8 @@ module SiSU_Param
           end
           if @home_button_image \
           and @home_button_image.is_a?(Hash) \
-          and (@home_button_image =~@rgx_image \
-            or @home_button_image =~/\S+?\.(?:jpg|png|gif)/)
+          and (@home_button_image[:home] =~@rgx_image \
+            or @home_button_image[:home] =~/\S+?\.(?:jpg|png|gif)/)
             @ec[:image] << @home_button_image
           end
           if @ec[:image].length > 0
index 6ce8b1b4f32a8f5454c071e05aea87f39fbf5e9d..ddece3739c1bb75b6cbcd7468d7dcf9dbd595d4b 100644 (file)
@@ -361,7 +361,7 @@ WOK
         dob=@data
         linkname,link=dob.obj.strip,dob.ocn
         if link \
-        and link !~/#/ #% keep eye on link
+        and link.to_s !~/#/ #% keep eye on link
           SiSU_HTML_Format::ParagraphNumber.new(@md,link)
         end
         title=linkname
@@ -384,7 +384,7 @@ WOK
         dob=@data
         linkname,link=dob.obj.strip,dob.ocn
         if link \
-        and link !~/#/ #% keep eye on link
+        and link.to_s !~/#/ #% keep eye on link
           SiSU_HTML_Format::ParagraphNumber.new(@md,link)
         end
         title=if dob.obj !~/^Metadata$/ then linkname
@@ -430,7 +430,7 @@ WOK
         dob=@data
         linkname,ocn=dob.obj.strip,dob.ocn
         p_num=if ocn \
-        and ocn !~/#/
+        and ocn.to_s !~/#/
           SiSU_HTML_Format::ParagraphNumber.new(@md,ocn)
         else nil
         end
@@ -454,7 +454,7 @@ WOK
         dob=@data
         linkname,ocn=dob.obj.strip,dob.ocn
         p_num=if ocn \
-        and ocn !~/#/
+        and ocn.to_s !~/#/
           SiSU_HTML_Format::ParagraphNumber.new(@md,ocn)
         else nil
         end
@@ -526,7 +526,7 @@ WOK
         linkname,ocn=dob.obj.strip,dob.ocn
         toc={}
         if ocn \
-        and ocn !~/#/
+        and ocn.to_s !~/#/
           fnh={
             fn: @@seg_url,
           }
@@ -551,7 +551,7 @@ WOK
         linkname,ocn=dob.obj.strip,dob.ocn
         toc={}
         if ocn \
-        and ocn !~/#/
+        and ocn.to_s !~/#/
           fnh={
             fn: @@seg_url,
           }
index 9e2f52958dc2afa8c982790bbf0c32afc73a01a8..158e391b3b59c222d1ac6b2b26df0dccb6e1d1b5 100644 (file)
       end
       def level_4
         txt=@data
-        unless txt =~/~metadata/
+        unless txt.obj =~/~metadata/
           if txt.ln ==4
             fnh={
               fn: txt.name,
index 172a88a48ec1c0ae1e9d485496f10613edf1acb5..f2a8bb4f6e39198623d706089692553716fe5380 100644 (file)
@@ -209,9 +209,9 @@ module SiSU_HTML_Scroll
             sto.table
           elsif dob.is==:break
           end
-          if dob =~/<a name="n\d+">/ \
-          and dob =~/^(?:\^~\d+\s|<!e[:_]\d+!>)/ # hmmm re-adjusted 200507, for alt endnote which should again be matched ^~ ... not in response to problem though
-            dob=''
+          if dob.obj =~/<a name="n\d+">/ \
+          and dob.obj =~/^(?:\^~\d+\s|<!e[:_]\d+!>)/ # hmmm re-adjusted 200507, for alt endnote which should again be matched ^~ ... not in response to problem though
+            dob.obj=''
           end
           unless @rcdc
             @scr[:body] << para_html unless para_html =~/\A\s*\Z/
index 1e893ce92fae3a31cdd7d288bee8ba7203a26035..8a57eaeb28358bfdd305b3201278108acf5f5e11 100644 (file)
@@ -1151,9 +1151,14 @@ WOK
         tag,inf=tr.prefix_b,@md.notes.prefix_b
         meta << meta_para(tag,inf)
       end
-      if defined? @md.classify.identifier \
-      and @md.classify.identifier=~/\S+/
-        tag,inf=tr.identifier,@md.classify.identifier
+      if defined? @md.identifier.isbn \
+      and @md.identifier.isbn=~/\S+/
+        tag,inf=tr.cls_isbn,@md.identifier.isbn
+        meta << meta_para(tag,inf)
+      end
+      if defined? @md.identifier.oclc \
+      and @md.identifier.oclc=~/\S+/
+        tag,inf=tr.cls_oclc,@md.identifier.oclc
         meta << meta_para(tag,inf)
       end
       if defined? @md.original.source \
index 57202bfde51a4696aa090e935c5129f8f112f9fa..923b7ad1819f4f2675429fb457a9a9b75302a957 100644 (file)
@@ -639,7 +639,7 @@ module SiSU_TeX
             dob
           else 'error' #should never occur
           end
-          dob=enclose(dob) unless dob.tmp =~/^$/
+          dob=enclose(dob) unless (dob.tmp.is_a?(String) && dob.tmp =~/^$/)
           dob
         else
           tst=SiSU_TeX_Pdf::FormatTextObject.new(@md,dob)
@@ -710,11 +710,11 @@ module SiSU_TeX
               dob.tmp=tst.hang
             else
               dob.tmp=dob.tmp.strip
-              dob=enclose(dob) unless dob.tmp =~/^$/
+              dob=enclose(dob) unless (dob.tmp.is_a?(String) && dob.tmp =~/^$/)
             end
           else
             dob.tmp=dob.tmp.strip unless dob.is==:code
-            dob=enclose(dob) unless dob.tmp =~/^$/
+            dob=enclose(dob) unless (dob.tmp.is_a?(String) && dob.tmp =~/^$/)
           end
           if dob.is_a?(String)
             dob.tmp=dob.tmp.gsub(/\s*(?:#{Mx[:br_line]}|#{Mx[:br_nl]})\s*/,' \newline ').   #% tread with care
@@ -722,20 +722,20 @@ module SiSU_TeX
           end
           dob
         end
-        if dob.tmp =~/(?:#{Mx[:url_o]}\S+?#{Mx[:url_c]}|image\b)/m \
+        if (dob.tmp.is_a?(String) and dob.tmp =~/(?:#{Mx[:url_o]}\S+?#{Mx[:url_c]}|image\b)/m) \
         && dob.is !=:code
           dob=SiSU_TeX_Pdf::BareUrls.new(@md,dob).bare_urls
           tst=SiSU_TeX_Pdf::FormatTextObject.new(@md,dob)
           dob=tst.urls_txt_and_images
           dob
-        elsif dob.tmp =~/https?:\/\/\S+\b/m \
+        elsif (dob.tmp.is_a?(String) and dob.tmp  =~/https?:\/\/\S+\b/m) \
         && dob.is ==:code \
         && @codeblock_box !='listings'
           dob=SiSU_TeX_Pdf::BareUrls.new(@md,dob).bare_urls_in_code
           dob
         end
         if dob.class !=Hash \
-        && dob.tmp =~/#{Mx[:lnk_o]}.+?#{Mx[:lnk_c]}image\b/ \
+        && (dob.tmp.is_a?(String) and dob.tmp =~/#{Mx[:lnk_o]}.+?#{Mx[:lnk_c]}image\b/) \
         && dob.is !=:code
           tst=SiSU_TeX_Pdf::FormatTextObject.new(@md,dob)
         end
index 513b8436bd0607671941915e46a82c7dd34a119d..c80a90df4f4e2788c7dbb2b7fef76c73321108fe 100644 (file)
@@ -579,7 +579,7 @@ module SiSU_XHTML_EPUB2
         ocn=dob.ocn
         toc={}
         if ocn \
-        and ocn !~/#/
+        and ocn.to_s !~/#/
           p_num=SiSU_XHTML_EPUB2_Format::ParagraphNumber.new(@md,ocn)
           lnk_n_txt=%{  <a href="#{@@seg_url}#{Sfx[:epub_xhtml]}#o#{ocn}">
     #{linkname}
@@ -600,7 +600,7 @@ module SiSU_XHTML_EPUB2
         ocn=dob.ocn
         toc={}
         if ocn \
-        and ocn !~/#/
+        and ocn.to_s !~/#/
           p_num=SiSU_XHTML_EPUB2_Format::ParagraphNumber.new(@md,ocn)
           lnk_n_txt=%{  <a href="#{@@seg_url}#{Sfx[:epub_xhtml]}#o#{ocn}">
   #{linkname}
@@ -621,7 +621,7 @@ module SiSU_XHTML_EPUB2
         ocn=dob.ocn
         toc={}
         if ocn \
-        and ocn !~/#/
+        and ocn.to_s !~/#/
           p_num=SiSU_XHTML_EPUB2_Format::ParagraphNumber.new(@md,ocn)
           lnk_n_txt=%{  <a href="#{@@seg_url}#{Sfx[:epub_xhtml]}#o#{ocn}">
   #{linkname}
index 4d670a92e6d0a3217cf20eb33077b6a7dbfc83e8..1f1c69b78501737d39a862e6f734084c778b9ced 100644 (file)
@@ -215,7 +215,8 @@ module SiSU_XML_ODF_ODT
         end
         unless @@docstart
           breakpage=if (@md.pagenew || @md.pagebreak) \
-          and (@md.pagenew =~m or @md.pagebreak =~m)
+          and (@md.pagenew.to_s =~m \
+            or @md.pagebreak.to_s =~m)
             '<text:p text:style-name="P_normal_page_new"> </text:p>'
           elsif @md.pageline \
           and @md.pageline =~m #fix
@@ -612,7 +613,7 @@ module SiSU_XML_ODF_ODT
         if dob.is !~/(^#{Rx[:meta]}|#{Mx[:br_eof]}|#{Mx[:br_endnotes]})/
           if @make.build.odt_ocn?
             if defined? dob.ocn \
-            and dob.ocn.is_a?(Fixnum)
+            and dob.ocn.is_a?(Integer)
               p_num=SiSU_XML_ODF_ODT_Format::ParagraphNumber.new(@make,dob.ocn).set_bookmark_and_display
             end
           end
@@ -670,7 +671,7 @@ module SiSU_XML_ODF_ODT
           word=dob.obj.scan(/\S+|\n/)
           if word
             word.each do |w| # _ - / # | : ! ^ ~
-              unless dob =~/^(?:#{Rx[:meta]}|%+ )/m
+              unless dob.obj =~/^(?:#{Rx[:meta]}|%+ )/m
                 w=w.gsub(/&#(?:126|152);/,'~'). #126 usual
                   gsub(/&nbsp;/,'&#160;')
                 if w !~/(?:&\S{2,7}?;)+/
@@ -735,9 +736,9 @@ module SiSU_XML_ODF_ODT
           dob.obj=tidywords(wordlist).join(' ').strip
           @rcdc=true if @rcdc==false \
           and (dob.obj =~/~metadata/ \
-          or dob =~/#{Mx[:lv_o]}1:meta#{Mx[:lv_x]}\s*Document Information/) #fix Mx[:lv_o]
+          or dob.obj =~/#{Mx[:lv_o]}1:meta#{Mx[:lv_x]}\s*Document Information/) #fix Mx[:lv_o]
           if dob.is !~/(^#{Rx[:meta]}|#{Mx[:br_eof]}|#{Mx[:br_endnotes]})/ #check
-            if defined? dob.ocn and dob.ocn =~/\d+/
+            if defined? dob.ocn and dob.ocn.to_s =~/\d+/
               @p_num=SiSU_XML_ODF_ODT_Format::ParagraphNumber.new(@make,dob.ocn)
             end
             if dob.is ==:heading \
@@ -859,7 +860,7 @@ WOK
         env.make_path(@md.file.output_path.odt.dir)
         filename="#{@env.processing_path.odt}/content.xml"
         od=File.new(filename,'w+')
-        @content.compact.each do |para|                                                # this is a hack
+        @content.flatten.compact.each do |para|             # this is a hack, check change does not alter behavior
           od.puts para unless para =~/\A\s*\Z/
         end
         od.close
index 7d1aceb152677eaac19ad6d329a0b64637e6b8f7..906da2a0e7ba76db7bffadbf2907fb321c87f372 100644 (file)
@@ -81,7 +81,6 @@ module SiSU_XML_Munge
           inst:  'institute',
           co:    'company',
           com:   'company',
-          conv:  'convention',
           dt:    'date',
           y:     'year',
           m:     'month',