From af4d5210848dcf656db7b64ca7b71f53cda4214e Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 30 Mar 2011 23:22:06 -0400 Subject: v2, v3: dal_doc_str.rb, table structure issue * ruby1.9.2 transition related * double spaced empty line creates spurious newline --- data/doc/sisu/CHANGELOG_v2 | 1 + data/doc/sisu/CHANGELOG_v3 | 1 + lib/sisu/v2/dal_doc_str.rb | 4 +++- lib/sisu/v3/dal_doc_str.rb | 6 ++++-- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v2 b/data/doc/sisu/CHANGELOG_v2 index a9487585..f563f8b4 100644 --- a/data/doc/sisu/CHANGELOG_v2 +++ b/data/doc/sisu/CHANGELOG_v2 @@ -18,6 +18,7 @@ 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 + * table structure issue, double spaced empty line creates spurious newline * 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 e39a12ed..ab9c925d 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -23,6 +23,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.0.6.orig.tar.gz * (ruby 1.9.2 (transition related) fixes) * dal_doc_str * empty line not paragraph object + * table structure issue, double spaced empty line creates spurious newline * 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 94f668a5..6fd7eff2 100644 --- a/lib/sisu/v2/dal_doc_str.rb +++ b/lib/sisu/v2/dal_doc_str.rb @@ -310,7 +310,9 @@ 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? + 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 t_o.gsub!(/\n/m,"#{Mx[:tc_p]}") @rows += t_o + Mx[:tc_c] end diff --git a/lib/sisu/v3/dal_doc_str.rb b/lib/sisu/v3/dal_doc_str.rb index 8da571e4..09635066 100644 --- a/lib/sisu/v3/dal_doc_str.rb +++ b/lib/sisu/v3/dal_doc_str.rb @@ -315,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 -- cgit v1.2.3