aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/dal_doc_str.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3/dal_doc_str.rb')
-rw-r--r--lib/sisu/v3/dal_doc_str.rb24
1 files changed, 11 insertions, 13 deletions
diff --git a/lib/sisu/v3/dal_doc_str.rb b/lib/sisu/v3/dal_doc_str.rb
index ab5f9199..012e7a33 100644
--- a/lib/sisu/v3/dal_doc_str.rb
+++ b/lib/sisu/v3/dal_doc_str.rb
@@ -233,11 +233,11 @@ module SiSU_DAL_DocumentStructureExtract
end
else nil
end
- when /^[<\[](?:br)?:(?:pa?r|o(?:bj|---)?)[>\]]\s*$/ #[br:par] #[br:obj]
+ when /^<(?:br)?:(?:pa?r|o(?:bj|---)?)>\s*$/ #[br:par] #[br:obj]
SiSU_DAL_DocumentStructure::ObjectLayout.new.break(Hx[:br_obj])
- when /^(?:[<\[](?:br)?:pg[>\]]|<?:pb>?)\s*$/ #[br:pg]
+ when /^(?:-\\\\-|<:pb>)\s*$/ #[br:pg]
SiSU_DAL_DocumentStructure::ObjectLayout.new.break(Hx[:br_page])
- when /^[<\[](?:br)?:pg?n[>\]]\s*$/ #[br:pgn]
+ when /^(?:=\\\\=|<:pn>)\s*$/ #[br:pgn]
SiSU_DAL_DocumentStructure::ObjectLayout.new.break(Hx[:br_page_new])
else #paragraph
image=image_test(t_o)
@@ -363,8 +363,8 @@ module SiSU_DAL_DocumentStructureExtract
t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) #t_o=SiSU_DAL_DocumentStructure::ObjectLayout.new.insert(h)
t_o
else
- if t_o !~/^table\{/ \
- and not t_o.nil?
+ if t_o.is_a?(String) \
+ and t_o !~/^table\{/
t_o=t_o.gsub(/^\n+/m,''). #check added for ruby 1.9.2 not needed in 1.8 series (tested in v2)
gsub(/\n+/m,"#{Mx[:tc_p]}")
@rows += t_o + Mx[:tc_c]
@@ -385,8 +385,7 @@ module SiSU_DAL_DocumentStructureExtract
t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) #t_o=SiSU_DAL_DocumentStructure::ObjectLayout.new.insert(h)
end
if @@flag['code'] \
- and t_o.class==String \
- and not t_o.nil? #you may need to introduce t_o.class==String test more widely
+ and t_o.is_a?(String)
sub_array=t_o.dup + "#{Mx[:br_nl]}"
@line_mode=sub_array.scan(/.+/)
@line_mode=[]
@@ -461,7 +460,7 @@ module SiSU_DAL_DocumentStructureExtract
if @@flag['poem'] \
or @@flag['group'] \
or @@flag['alt']
- if t_o.class==String
+ if t_o.is_a?(String)
t_o=t_o.gsub(/\n/m,"#{Mx[:br_nl]}").
gsub(/[ ][ ]/m,"#{Mx[:nbsp]*2}").
gsub(/#{Mx[:nbsp]}\s/,"#{Mx[:nbsp]*2}")
@@ -527,7 +526,7 @@ module SiSU_DAL_DocumentStructureExtract
lines.each do |line|
line=if line =~/\S/ \
and line !~/^code\{|^\}code/ \
- and line.class != Hash
+ and not line.is_a?(Hash)
@@counter+=1 if @@flag['code']
line=line.gsub(/\s\s/,"#{Mx[:nbsp]*2}").
gsub(/#{Mx[:nbsp]}\s/,"#{Mx[:nbsp]*2}")
@@ -858,10 +857,9 @@ module SiSU_DAL_DocumentStructureExtract
tuned_file=tuned_file.flatten
end
def tags(o)
- tag=if o[:status]=='open'
- %{<#{o[:lv]} id="#{o[:node]}">}
- else "</#{o[:lv]}>"
- end
+ tag=(o[:status]=='open') \
+ ? %{<#{o[:lv]} id="#{o[:node]}">}
+ : "</#{o[:lv]}>"
ln=case o[:lv]
when 'A'; 1
when 'B'; 2