diff options
Diffstat (limited to 'lib/sisu/v3dv/db_import.rb')
-rw-r--r-- | lib/sisu/v3dv/db_import.rb | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/lib/sisu/v3dv/db_import.rb b/lib/sisu/v3dv/db_import.rb index adbe5af5..a2b66937 100644 --- a/lib/sisu/v3dv/db_import.rb +++ b/lib/sisu/v3dv/db_import.rb @@ -212,7 +212,7 @@ module SiSU_DbImport src=special_character_escape(src) @tp[:sisutxt_f],@tp[:sisutxt_i]='sisutxt, ',"'#{src}', " txt=clean_searchable_text(txt_arr) - #special_character_escape(txt) + #txt=special_character_escape(txt) @tp[:fulltxt_f],@tp[:fulltxt_i]='fulltxt, ',"'#{txt}', " end #% title @@ -268,7 +268,7 @@ module SiSU_DbImport @col[:lid]+=1 txt=endnotes(txt).extract_any @col[:body]=SiSU_FormatShared::CSS_Format.new(@md,data).lev4_minus - special_character_escape(@col[:body]) + @col[:body]=special_character_escape(@col[:body]) @col[:plaintext]=@col[:body].dup @col[:plaintext]=strip_markup(@col[:plaintext]) @col[:plaintext]=clean_searchable_text(@col[:plaintext]) @@ -302,7 +302,7 @@ module SiSU_DbImport @base_url="#{@env.url.root}/#{@md.fnb}/#{@hname}.html" txt=endnotes(txt).extract_any @col[:body]=SiSU_FormatShared::CSS_Format.new(@md,data).lev4_plus - special_character_escape(@col[:body]) + @col[:body]=special_character_escape(@col[:body]) @col[:plaintext]=@col[:body].dup @col[:plaintext]=strip_markup(@col[:plaintext]) @col[:plaintext]=clean_searchable_text(@col[:plaintext]) @@ -329,7 +329,7 @@ module SiSU_DbImport @base_url="#{@env.url.root}/#{@md.fnb}/#{@hname}.html" txt=endnotes(txt).extract_any @col[:body]=SiSU_FormatShared::CSS_Format.new(@md,data).lev4_plus - special_character_escape(@col[:body]) + @col[:body]=special_character_escape(@col[:body]) @col[:plaintext]=@col[:body].dup @col[:plaintext]=strip_markup(@col[:plaintext]) @col[:plaintext]=clean_searchable_text(@col[:plaintext]) @@ -356,7 +356,7 @@ module SiSU_DbImport @base_url="#{@env.url.root}/#{@md.fnb}/#{@hname}.html" txt=endnotes(txt).extract_any @col[:body]=SiSU_FormatShared::CSS_Format.new(@md,data).lev4_plus - special_character_escape(@col[:body]) + @col[:body]=special_character_escape(@col[:body]) @col[:plaintext]=@col[:body].dup @col[:plaintext]=strip_markup(@col[:plaintext]) @col[:plaintext]=clean_searchable_text(@col[:plaintext]) @@ -406,7 +406,7 @@ module SiSU_DbImport else SiSU_FormatShared::CSS_Format.new(@md,data).norm end - special_character_escape(@col[:body]) + @col[:body]=special_character_escape(@col[:body]) @col[:plaintext]=@col[:body].dup @col[:plaintext]=strip_markup(@col[:plaintext]) @col[:plaintext]=clean_searchable_text(@col[:plaintext]) @@ -424,9 +424,9 @@ module SiSU_DbImport nr,txt,digest_clean=$1,$2.strip,0 end @id_n+=1 - special_character_escape(txt) + txt=special_character_escape(txt) body=SiSU_FormatShared::CSS_Format.new(@md,data).endnote(nr,txt) - strip_markup(txt) + txt=strip_markup(txt) if txt.size > (SiSU_DbColumns::ColumnSize.new.endnote_clean - 1) puts "\n\nTOO LARGE (ENDNOTE - see error log)\n\n" open("#{Dir.pwd}/pg_documents_error_log",'a') do |error| @@ -463,9 +463,9 @@ module SiSU_DbImport nr,txt,digest_clean=$1,$2.strip,0 end @id_n+=1 - special_character_escape(txt) + txt=special_character_escape(txt) body=SiSU_FormatShared::CSS_Format.new(@md,data).endnote(nr,txt) - strip_markup(txt) + txt=strip_markup(txt) if txt.size > (SiSU_DbColumns::ColumnSize.new.endnote_clean - 1) puts "\n\nTOO LARGE (ENDNOTE - see error log)\n\n" open("#{Dir.pwd}/pg_documents_error_log",'a') do |error| @@ -502,9 +502,9 @@ module SiSU_DbImport nr,txt,digest_clean=$1,$2.strip,0 end @id_n+=1 - special_character_escape(txt) + txt=special_character_escape(txt) body=SiSU_FormatShared::CSS_Format.new(@md,data).endnote(nr,txt) - strip_markup(txt) + txt=strip_markup(txt) if txt.size > (SiSU_DbColumns::ColumnSize.new.endnote_clean - 1) puts "\n\nTOO LARGE (ENDNOTE - see error log)\n\n" open("#{Dir.pwd}/pg_documents_error_log",'a') do |error| @@ -568,14 +568,14 @@ module SiSU_DbImport : nil end def clean_text(base_url=nil) - if base_url - @txt.gsub!(/#{Mx[:en_a_o]}(\d+).+?#{Mx[:en_a_c]}/,%{<sup><a href="#{base_url}#_\\1" name="-\\1">\\1</a></sup>}) - @txt.gsub!(/#{Mx[:en_b_o]}([*]\d+).+?#{Mx[:en_b_c]}/,%{<sup><a href="#{base_url}#_\\1" name="-\\1">\\1</a></sup>}) - @txt.gsub!(/#{Mx[:en_b_o]}([+]\d+).+?#{Mx[:en_b_c]}/,%{<sup><a href="#{base_url}#_\\1" name="-\\1">\\1</a></sup>}) + @txt=if base_url + @txt.gsub(/#{Mx[:en_a_o]}(\d+).+?#{Mx[:en_a_c]}/,%{<sup><a href="#{base_url}#_\\1" name="-\\1">\\1</a></sup>}). + gsub(/#{Mx[:en_b_o]}([*]\d+).+?#{Mx[:en_b_c]}/,%{<sup><a href="#{base_url}#_\\1" name="-\\1">\\1</a></sup>}). + gsub(/#{Mx[:en_b_o]}([+]\d+).+?#{Mx[:en_b_c]}/,%{<sup><a href="#{base_url}#_\\1" name="-\\1">\\1</a></sup>}) else - @txt.gsub!(/#{Mx[:en_a_o]}(\d+).+?#{Mx[:en_a_c]}/,'<sup>\1</sup>') - @txt.gsub!(/#{Mx[:en_b_o]}([*]\d+).+?#{Mx[:en_b_c]}/,'<sup>\1</sup>') - @txt.gsub!(/#{Mx[:en_b_o]}([+]\d+).+?#{Mx[:en_b_c]}/,'<sup>\1</sup>') + @txt.gsub(/#{Mx[:en_a_o]}(\d+).+?#{Mx[:en_a_c]}/,'<sup>\1</sup>'). + gsub(/#{Mx[:en_b_o]}([*]\d+).+?#{Mx[:en_b_c]}/,'<sup>\1</sup>'). + gsub(/#{Mx[:en_b_o]}([+]\d+).+?#{Mx[:en_b_c]}/,'<sup>\1</sup>') end @txt end |