aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2011-03-30 23:19:43 -0400
committerRalph Amissah <ralph@amissah.com>2011-03-30 23:21:33 -0400
commitb06c1e8a0641448b170dcc8a73f5e00f204e1d23 (patch)
treee29b64937a15973cac71eb2b836bff97ce7b050d /lib
parentv2, v3: dal_images, image path setting (diff)
v2, v3: dal_doc_str, empty line not paragraph object
* ruby1.9.2 transition related
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v2/dal_doc_str.rb14
-rw-r--r--lib/sisu/v3/dal_doc_str.rb14
2 files changed, 18 insertions, 10 deletions
diff --git a/lib/sisu/v2/dal_doc_str.rb b/lib/sisu/v2/dal_doc_str.rb
index 56bf205f..94f668a5 100644
--- a/lib/sisu/v2/dal_doc_str.rb
+++ b/lib/sisu/v2/dal_doc_str.rb
@@ -178,8 +178,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 /^<?:p[bn]>?\s*$/
@@ -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\{/
@@ -786,7 +790,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={}
diff --git a/lib/sisu/v3/dal_doc_str.rb b/lib/sisu/v3/dal_doc_str.rb
index 6ce77057..8da571e4 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\{/
@@ -803,7 +807,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={}