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.rb20
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/sisu/v3/dal_doc_str.rb b/lib/sisu/v3/dal_doc_str.rb
index 6ce77057..09635066 100644
--- a/lib/sisu/v3/dal_doc_str.rb
+++ b/lib/sisu/v3/dal_doc_str.rb
@@ -179,8 +179,10 @@ module SiSU_document_structure_extract
image=image_test(obj)
note=endnote_test?(obj)
obj,tags=extract_tags(obj)
- h={ bullet_: bullet, indent: indent, obj: obj, idx: idx, note_: note, image_: image, tags: tags }
- SiSU_document_structure::Object_para.new.paragraph(h)
+ unless obj=~/\A\s*\Z/m
+ h={ bullet_: bullet, indent: indent, obj: obj, idx: idx, note_: note, image_: image, tags: tags }
+ SiSU_document_structure::Object_para.new.paragraph(h)
+ end
else nil
end
when /^[<\[](?:br)?:(?:pa?r|o(?:bj|---)?)[>\]]\s*$/ #[br:par] #[br:obj]
@@ -193,8 +195,10 @@ module SiSU_document_structure_extract
image=image_test(t_o)
note=endnote_test?(t_o)
obj,tags=extract_tags(t_o)
- h={ bullet_: false, indent: 0, obj: obj, idx: idx, note_: note, image_: image, tags: tags }
- SiSU_document_structure::Object_para.new.paragraph(h)
+ unless obj=~/\A\s*\Z/m
+ h={ bullet_: false, indent: 0, obj: obj, idx: idx, note_: note, image_: image, tags: tags }
+ SiSU_document_structure::Object_para.new.paragraph(h)
+ end
end
elsif not @@flag['code']
if t_o =~/^code\{/
@@ -311,8 +315,10 @@ module SiSU_document_structure_extract
t_o=SiSU_document_structure::Object_comment.new.comment(h) #t_o=SiSU_document_structure::Object_layout.new.insert(h)
t_o
else
- if t_o !~/^table\{/ and not t_o.nil?
- t_o.gsub!(/\n/m,"#{Mx[:tc_p]}")
+ if t_o !~/^table\{/ \
+ and not t_o.nil?
+ t_o.gsub!(/^\n+/m,'') #check added for ruby 1.9.2 not needed in 1.8 series (tested in v2)
+ t_o.gsub!(/\n+/m,"#{Mx[:tc_p]}")
@rows += t_o + Mx[:tc_c]
end
t_o=nil
@@ -803,7 +809,7 @@ module SiSU_document_structure_extract
@o_array=[]
node=ocn=ocn_dv=ocn_sp=ocnh=ocnh1=ocnh2=ocnh3=ocnh4=ocnh5=ocnh6=ocno=ocnp=ocnt=ocnc=ocng=ocni=ocnm=ocnu=ocnk=nm=0 # h heading, o other, t table, g group, i image
node_count_flag=false
- regex_exclude_ocn_and_node = /#{Rx[:meta]}|^@\S+?:\s|^4~endnotes|^#{Mx[:lv_o]}4:endnotes#{Mx[:lv_c]}|^\^~ |<:e[:_]\d+?>|^<:\#|<:- |<[:!]!4|<hr width|#{Mx[:br_endnotes]}/i #ocn here #&nbsp; added with Tune.code #¡
+ regex_exclude_ocn_and_node = /#{Rx[:meta]}|^@\S+?:\s|^4~endnotes|^#{Mx[:lv_o]}4:endnotes#{Mx[:lv_c]}|^\^~ |<:e[:_]\d+?>|^<:\#|<:- |<[:!]!4|<hr width|#{Mx[:br_endnotes]}|\A\s*\Z/mi #ocn here #&nbsp; added with Tune.code #¡
parent=node1=node2=node3=node4=node5=node6=nil
data.each do |dob|
h={}