aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3dv/db_import.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3dv/db_import.rb')
-rw-r--r--lib/sisu/v3dv/db_import.rb34
1 files changed, 23 insertions, 11 deletions
diff --git a/lib/sisu/v3dv/db_import.rb b/lib/sisu/v3dv/db_import.rb
index 93b47029..3bb6e210 100644
--- a/lib/sisu/v3dv/db_import.rb
+++ b/lib/sisu/v3dv/db_import.rb
@@ -261,10 +261,14 @@ module SiSU_DbImport
data.obj.gsub!(/#{Mx[:gl_o]}(●)#{Mx[:gl_c]}\s*/,'\1 ')
data.obj.gsub!(/#{Mx[:tag_o]}\S+?#{Mx[:tag_c]}/,'') #check
@col[:seg]=@@seg
- if data.of =~/para|heading|block|group/ # regular text what of code-blocks grouped text etc.
+ if data.of ==:para \
+ || :heading \
+ || :heading_insert \
+ || :block \
+ || :group # regular text what of code-blocks grouped text etc.
notedata=data.obj.dup
- if data.is=='heading' \
- and data.ln.inspect=~/[123]/
+ if data.is==:heading \
+ && (data.ln.inspect=~/[123]/)
@col[:lev],txt,@col[:ocn],@col[:lev_an],@col[:ocnd],@col[:ocns],@col[:t_of],@col[:t_is],@col[:node],@col[:parent],@col[:digest_clean],@col[:digest_all]=data.ln,data.obj,data.ocn,data.lv,data.odv,data.osp,data.of,data.is,data.node,data.parent,'',''
@col[:lid]+=1
txt=endnotes(txt).extract_any
@@ -287,8 +291,8 @@ module SiSU_DbImport
when /3/; @col[:lv3]+=1
end
@col[:lev]=@col[:plaintext]=@col[:body]=''
- elsif data.is=='heading' \
- and data.ln==4
+ elsif data.is==:heading \
+ && data.ln==4
@@seg,txt,@col[:ocn],@col[:lev_an],@col[:ocnd],@col[:ocns],@col[:t_of],@col[:t_is],@col[:node],@col[:parent],@col[:digest_clean],@col[:digest_all]=data.name,data.obj,data.ocn,data.lv,data.odv,data.osp,data.of,data.is,data.node,data.parent,'',''
@col[:seg]=@@seg
@col[:lv4]+=1
@@ -313,9 +317,12 @@ module SiSU_DbImport
t=SiSU_DbTuple::LoadDocuments.new(@conn,@col,@opt,@file)
@tuple_array << t.tuple
@col[:lev]=@col[:plaintext]=@col[:body]=''
- elsif data.is=='heading' and data.ln==5
+ elsif data.is==:heading \
+ && data.ln==5
txt,@col[:ocn],@col[:lev_an],@col[:ocnd],@col[:ocns],@col[:t_of],@col[:t_is],@col[:node],@col[:parent],@col[:digest_clean],@col[:digest_all]=data.obj,data.ocn,data.lv,data.odv,data.osp,data.of,data.is,data.node,data.parent,'',''
- @@seg_full=data.name if data.is=='heading' and data.ln==5 and data.name #check data.name
+ @@seg_full=data.name if data.is==:heading \
+ && data.ln==5 \
+ && data.name #check data.name
@@seg ||='' #nil # watch
@col[:seg]=@@seg
@col[:lv5]+=1
@@ -340,9 +347,10 @@ module SiSU_DbImport
t=SiSU_DbTuple::LoadDocuments.new(@conn,@col,@opt,@file)
@tuple_array << t.tuple
@col[:lev]=@col[:plaintext]=@col[:body]=''
- elsif data.is=='heading' and data.ln==6
+ elsif data.is==:heading \
+ && data.ln==6
txt,@col[:ocn],@col[:lev_an],@col[:ocnd],@col[:ocns],@col[:t_of],@col[:t_is],@col[:node],@col[:parent],@col[:digest_clean],@col[:digest_all]=data.obj,data.ocn,data.lv,data.odv,data.osp,data.of,data.is,data.node,data.parent,'',''
- @@seg_full=data.name if data.is=='heading' and data.ln==6 and data.name #check data.name
+ @@seg_full=data.name if data.is==:heading && data.ln==6 && data.name #check data.name
@@seg ||='' #nil # watch
@col[:seg]=@@seg
@col[:lv6]+=1
@@ -367,6 +375,10 @@ module SiSU_DbImport
t=SiSU_DbTuple::LoadDocuments.new(@conn,@col,@opt,@file)
@tuple_array << t.tuple
@col[:lev]=@col[:plaintext]=@col[:body]=''
+ elsif data.of==:structure \
+ || data.of==:layout \
+ || data.of==:comment
+ #added watch
else #% regular text
@col[:lid]+=1
txt=''
@@ -390,9 +402,9 @@ module SiSU_DbImport
@en_a,@en_z=@en[0].first,@en[0].last if @en[0]
@en_a_asterisk,@en_z_asterisk=@en_ast[0].first,@en_ast[0].last if @en_ast[0]
@en_a_plus,@en_z_plus=@en_pls[0].first,@en_pls[0].last if @en_pls[0]
- @col[:body]=if data.is=='table'
+ @col[:body]=if data.is==:table
SiSU_FormatShared::CSS_Format.new(@md,data).html_table
- elsif data.is=='code'
+ elsif data.is==:code
SiSU_FormatShared::CSS_Format.new(@md,data).code
elsif defined? data.indent \
and defined? data.hang \