From b06c1e8a0641448b170dcc8a73f5e00f204e1d23 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 30 Mar 2011 23:19:43 -0400 Subject: v2, v3: dal_doc_str, empty line not paragraph object * ruby1.9.2 transition related --- lib/sisu/v2/dal_doc_str.rb | 14 +++++++++----- lib/sisu/v3/dal_doc_str.rb | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) (limited to 'lib') 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 /^?\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|
|^<:\#|<:- |<[:!]!4|
\]]\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|
|^<:\#|<:- |<[:!]!4|