aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/sst_to_s_xml_node.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2007-10-15 19:27:16 +0100
committerRalph Amissah <ralph@amissah.com>2007-10-15 19:27:16 +0100
commite1ec4bd2dad2bd22ad97cea398ae1cfcfae183a2 (patch)
tree6ffe3ae1b2453578a032ce053934a31f980645e9 /lib/sisu/v0/sst_to_s_xml_node.rb
parentregex matching of images, (and rearrangement of conditionals) (diff)
mostly the arrangement of conditionals
Diffstat (limited to 'lib/sisu/v0/sst_to_s_xml_node.rb')
-rw-r--r--lib/sisu/v0/sst_to_s_xml_node.rb31
1 files changed, 23 insertions, 8 deletions
diff --git a/lib/sisu/v0/sst_to_s_xml_node.rb b/lib/sisu/v0/sst_to_s_xml_node.rb
index cbaf7672..38c025c0 100644
--- a/lib/sisu/v0/sst_to_s_xml_node.rb
+++ b/lib/sisu/v0/sst_to_s_xml_node.rb
@@ -228,9 +228,11 @@ WOK
end
if lv.to_s =~/^[1-6]/; @@current=lv
end
- if o.node == 1 or lv == 1
+ if o.node == 1 \
+ or lv == 1
@@parent[:node][o.node]=0
- elsif @@current == lv and @@current !=nil
+ elsif @@current == lv \
+ and @@current !=nil
if @node[:no][lv-1] != nil
@@parent[:node][o.node]=@node[:no][lv-1]
elsif @node[:no][lv-2] != nil
@@ -240,12 +242,14 @@ WOK
else puts 'error'
end
elsif lv == nil
- if o.ocn.class == Fixnum and @@current
+ if o.ocn.class == Fixnum \
+ and @@current
@@parent[:node][o.node]=@node[:no][@@current]
end
else puts 'error'
end
- if @@current == lv and @@current !=nil
+ if @@current == lv \
+ and @@current !=nil
if @node[:ocn][lv-1] != nil
@@parent[:ocn][o.ocn]=@node[:ocn][lv-1]
elsif @node[:ocn][lv-2] != nil
@@ -255,7 +259,8 @@ WOK
else puts 'error'
end
elsif lv == nil
- if o.ocn.class == Fixnum and @@current
+ if o.ocn.class == Fixnum \
+ and @@current
@@parent[:ocn][o.ocn]=@node[:ocn][@@current]
end
else puts 'error'
@@ -418,8 +423,11 @@ WOK
obj.each do |o|
para=o.txt unless o.txt =~/^%% / #comments are lost, consider
if para
- @rcdc=true if @rcdc==false and (para =~/~metadata/ or para =~/^1~meta\s+Document Information/)
+ if @rcdc==false \
+ and (para =~/~metadata/ or para =~/^1~meta\s+Document Information/)
if para !~/(^0~|^@\S+?:|^\s*$|<ENDNOTES>|<EOF>)/
+ @rcdc=true
+ end
@sto=SiSU_text_parts::Split_text_object.new(@md,para).lev_segname_para
unless @rcdc
format_scroll=SiSU_XML_format::Format_scroll.new(@md,@sto.text) if @sto.format =~/i[12]|null/
@@ -457,7 +465,11 @@ WOK
obj.each do |o|
para=o.txt unless o.txt =~/^%% / #comments are lost, consider
if para
- @rcdc=true if @rcdc==false and (para =~/~metadata/ or para =~/^1~meta\s+Document Information/)
+ if @rcdc==false \
+ and (para =~/~metadata/ \
+ or para =~/^1~meta\s+Document Information/)
+ @rcdc=true
+ end
if para !~/(^0~|^@\S+?:|^\s*$|<ENDNOTES>|<EOF>)/
@sto=SiSU_text_parts::Split_text_object.new(@md,para).lev_segname_para
unless @rcdc
@@ -497,7 +509,10 @@ WOK
else xml_structure(o,para,nil,nil)
end
end
- para='' if para =~/<a name="n\d+">/ and para =~/^(-\{{2}~\d+|<!e[:_]\d+!>)/ # -endnote
+ if para =~/<a name="n\d+">/ \
+ and para =~/^(-\{{2}~\d+|<!e[:_]\d+!>)/ # -endnote
+ para=''
+ end
if para =~/.*<:#>.*$/
para=case para
when /<:i1>/