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 --- data/doc/sisu/CHANGELOG_v2 | 2 ++ data/doc/sisu/CHANGELOG_v3 | 2 ++ lib/sisu/v2/dal_doc_str.rb | 14 +++++++++----- lib/sisu/v3/dal_doc_str.rb | 14 +++++++++----- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v2 b/data/doc/sisu/CHANGELOG_v2 index 94db9176..a9487585 100644 --- a/data/doc/sisu/CHANGELOG_v2 +++ b/data/doc/sisu/CHANGELOG_v2 @@ -16,6 +16,8 @@ Reverse Chronological: http://git.sisudoc.org/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/3.0.6-1 * (ruby 1.9.2 (transition related) fixes) + * dal_doc_str + * empty line not paragraph object * dal_images, image path setting * param, nested regex match backport from v3 * cgi sample-search-form, string output (also cleaned unused help text) diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index 2481d41b..e39a12ed 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -21,6 +21,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.0.6.orig.tar.gz sisu_3.0.6-1.debian.tar.gz * (ruby 1.9.2 (transition related) fixes) + * dal_doc_str + * empty line not paragraph object * dal_images, image path setting * cgi sample-search-form, string output (also cleaned unused help text) 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|