From fb6abb03ac0cfa136afbe1ca0471c14f9bbb52b4 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 31 Jan 2013 18:43:17 -0500 Subject: v4 v3: dal (obj), html, br_page* behavior in html depending on origin of break * markup specified v auto --- data/doc/sisu/CHANGELOG_v3 | 3 +++ data/doc/sisu/CHANGELOG_v4 | 3 +++ lib/sisu/v3/dal_doc_objects.rb | 13 +++++++------ lib/sisu/v3/dal_doc_str.rb | 4 ++-- lib/sisu/v3/html_scroll.rb | 6 ++++-- lib/sisu/v3/html_segments.rb | 4 +++- lib/sisu/v4/dal_doc_objects.rb | 13 +++++++------ lib/sisu/v4/dal_doc_str.rb | 4 ++-- lib/sisu/v4/html_scroll.rb | 6 ++++-- lib/sisu/v4/html_segments.rb | 4 +++- 10 files changed, 38 insertions(+), 22 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index 0a8e960b..f7cb4879 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -38,6 +38,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.3.7.orig.tar.xz * v3: dal, on ocn excluded paragraphs (~# -#), hang/indent bullet, fix [bug reported indirectly by Cory Doctorow (discovered in work with markup)] +* v3: dal (obj), html, br_page* behavior in html depending on origin of break + (markup specified v auto) + %% 3.3.6.orig.tar.xz (2013-01-27:03/7) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_3.3.6 http://www.jus.uio.no/sisu/pkg/src/sisu_3.3.6.orig.tar.xz diff --git a/data/doc/sisu/CHANGELOG_v4 b/data/doc/sisu/CHANGELOG_v4 index 55acb451..86d18d8b 100644 --- a/data/doc/sisu/CHANGELOG_v4 +++ b/data/doc/sisu/CHANGELOG_v4 @@ -32,6 +32,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_4.0.4.orig.tar.xz * v4: epub, constants, debug alternative for various readers ... work on +* v4: dal (obj), html, br_page* behavior in html depending on origin of break + (markup specified v auto) + %% 4.0.3.orig.tar.xz (2013-01-27:03/7) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_4.0.3 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_4.0.3-1 diff --git a/lib/sisu/v3/dal_doc_objects.rb b/lib/sisu/v3/dal_doc_objects.rb index 37dfdcd3..13fd8ddb 100644 --- a/lib/sisu/v3/dal_doc_objects.rb +++ b/lib/sisu/v3/dal_doc_objects.rb @@ -420,17 +420,18 @@ module SiSU_DAL_DocumentStructure end end class ObjectLayout - attr_accessor :obj,:is,:of,:tmp + attr_accessor :obj,:is,:of,:from,:tmp def initialize @of=:layout - @is=@obj=@tmp=nil + @is=@obj=@from=@tmp=nil end - def break(h,o=nil) #decide how to deal with, perhaps no obj? + def break(h,f=nil) #decide how to deal with of= @of #String, classification - group is= :break #String, classification - specific type - obj= h[:obj] || ((defined? o.obj) ? o.obj : nil) #String, text content - tmp= h[:tmp] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use - @of,@is,@obj,@tmp=of,is,obj,tmp + obj= h[:obj] #String, text content + from= f + tmp= h[:tmp] #available for processing, empty after use + @of,@is,@obj,@from,@tmp=of,is,obj,from,tmp self end def insert(h,o=nil) #decide how to deal with, could mimic paragraph? diff --git a/lib/sisu/v3/dal_doc_str.rb b/lib/sisu/v3/dal_doc_str.rb index dafed778..a04ad3ad 100644 --- a/lib/sisu/v3/dal_doc_str.rb +++ b/lib/sisu/v3/dal_doc_str.rb @@ -236,9 +236,9 @@ module SiSU_DAL_DocumentStructureExtract when /^<(?:br)?:(?:pa?r|o(?:bj|---)?)>\s*$/ #[br:par] #[br:obj] SiSU_DAL_DocumentStructure::ObjectLayout.new.break(Hx[:br_obj]) when /^(?:-\\\\-|<:pb>)\s*$/ #[br:pg] - SiSU_DAL_DocumentStructure::ObjectLayout.new.break(Hx[:br_page]) + SiSU_DAL_DocumentStructure::ObjectLayout.new.break(Hx[:br_page],:markup) when /^(?:=\\\\=|<:pn>)\s*$/ #[br:pgn] - SiSU_DAL_DocumentStructure::ObjectLayout.new.break(Hx[:br_page_new]) + SiSU_DAL_DocumentStructure::ObjectLayout.new.break(Hx[:br_page_new],:markup) else #paragraph image=image_test(t_o) note=endnote_test?(t_o) diff --git a/lib/sisu/v3/html_scroll.rb b/lib/sisu/v3/html_scroll.rb index ec07e6a4..15bea9eb 100644 --- a/lib/sisu/v3/html_scroll.rb +++ b/lib/sisu/v3/html_scroll.rb @@ -99,8 +99,7 @@ module SiSU_HTML_Scroll @rcdc=true end dob.obj=dob.obj.gsub(/href="[a-z0-9._-]+(#\S+?")/m,'href="\1'). # internal document links - gsub(/href="#{Xx[:segment]}/m,'href="'). - gsub(/(?:\s*#{Mx[:br_page]}\s*|\s*#{Mx[:br_page_new]}\s*)+/m,'


') + gsub(/href="#{Xx[:segment]}/m,'href="') if dob.obj !~/(^#{Rx[:meta]}|#{Mx[:br_eof]})/ unless dob.is ==:code dob.obj=dob.obj.gsub(/(?:#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})\s*/m,' ') @@ -123,6 +122,9 @@ module SiSU_HTML_Scroll elsif dob.ln==6 sto.heading_body6 end + elsif dob.is==:break \ + and dob.from==:markup + '


' elsif dob.is==:heading_insert x=if dob.ln==1 unless dob.obj.empty? diff --git a/lib/sisu/v3/html_segments.rb b/lib/sisu/v3/html_segments.rb index b48c6ddd..a10409f6 100644 --- a/lib/sisu/v3/html_segments.rb +++ b/lib/sisu/v3/html_segments.rb @@ -474,7 +474,9 @@ module SiSU_HTML_Seg sto.code elsif dob.is==:table sto.table - elsif dob.is==:break + elsif dob.is==:break \ + and dob.from==:markup + '


' end if @md.flag_separate_endnotes dob.obj=dob.obj.gsub(/"\s+href="#_(\d+)">/,%{" href=\"endnotes#{Sfx[:html]}#_\\1">}) #endnote- twice #removed file type diff --git a/lib/sisu/v4/dal_doc_objects.rb b/lib/sisu/v4/dal_doc_objects.rb index 37dfdcd3..13fd8ddb 100644 --- a/lib/sisu/v4/dal_doc_objects.rb +++ b/lib/sisu/v4/dal_doc_objects.rb @@ -420,17 +420,18 @@ module SiSU_DAL_DocumentStructure end end class ObjectLayout - attr_accessor :obj,:is,:of,:tmp + attr_accessor :obj,:is,:of,:from,:tmp def initialize @of=:layout - @is=@obj=@tmp=nil + @is=@obj=@from=@tmp=nil end - def break(h,o=nil) #decide how to deal with, perhaps no obj? + def break(h,f=nil) #decide how to deal with of= @of #String, classification - group is= :break #String, classification - specific type - obj= h[:obj] || ((defined? o.obj) ? o.obj : nil) #String, text content - tmp= h[:tmp] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use - @of,@is,@obj,@tmp=of,is,obj,tmp + obj= h[:obj] #String, text content + from= f + tmp= h[:tmp] #available for processing, empty after use + @of,@is,@obj,@from,@tmp=of,is,obj,from,tmp self end def insert(h,o=nil) #decide how to deal with, could mimic paragraph? diff --git a/lib/sisu/v4/dal_doc_str.rb b/lib/sisu/v4/dal_doc_str.rb index dafed778..a04ad3ad 100644 --- a/lib/sisu/v4/dal_doc_str.rb +++ b/lib/sisu/v4/dal_doc_str.rb @@ -236,9 +236,9 @@ module SiSU_DAL_DocumentStructureExtract when /^<(?:br)?:(?:pa?r|o(?:bj|---)?)>\s*$/ #[br:par] #[br:obj] SiSU_DAL_DocumentStructure::ObjectLayout.new.break(Hx[:br_obj]) when /^(?:-\\\\-|<:pb>)\s*$/ #[br:pg] - SiSU_DAL_DocumentStructure::ObjectLayout.new.break(Hx[:br_page]) + SiSU_DAL_DocumentStructure::ObjectLayout.new.break(Hx[:br_page],:markup) when /^(?:=\\\\=|<:pn>)\s*$/ #[br:pgn] - SiSU_DAL_DocumentStructure::ObjectLayout.new.break(Hx[:br_page_new]) + SiSU_DAL_DocumentStructure::ObjectLayout.new.break(Hx[:br_page_new],:markup) else #paragraph image=image_test(t_o) note=endnote_test?(t_o) diff --git a/lib/sisu/v4/html_scroll.rb b/lib/sisu/v4/html_scroll.rb index bccc96ff..f8d104bb 100644 --- a/lib/sisu/v4/html_scroll.rb +++ b/lib/sisu/v4/html_scroll.rb @@ -99,8 +99,7 @@ module SiSU_HTML_Scroll @rcdc=true end dob.obj=dob.obj.gsub(/href="[a-z0-9._-]+(#\S+?")/m,'href="\1'). # internal document links - gsub(/href="#{Xx[:segment]}/m,'href="'). - gsub(/(?:\s*#{Mx[:br_page]}\s*|\s*#{Mx[:br_page_new]}\s*)+/m,'


') + gsub(/href="#{Xx[:segment]}/m,'href="') if dob.obj !~/(^#{Rx[:meta]}|#{Mx[:br_eof]})/ unless dob.is ==:code dob.obj=dob.obj.gsub(/(?:#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})\s*/m,' ') @@ -123,6 +122,9 @@ module SiSU_HTML_Scroll elsif dob.ln==6 sto.heading_body6 end + elsif dob.is==:break \ + and dob.from==:markup + '


' elsif dob.is==:heading_insert x=if dob.ln==1 unless dob.obj.empty? diff --git a/lib/sisu/v4/html_segments.rb b/lib/sisu/v4/html_segments.rb index 5a110b41..543dc209 100644 --- a/lib/sisu/v4/html_segments.rb +++ b/lib/sisu/v4/html_segments.rb @@ -474,7 +474,9 @@ module SiSU_HTML_Seg sto.code elsif dob.is==:table sto.table - elsif dob.is==:break + elsif dob.is==:break \ + and dob.from==:markup + '


' end if @md.flag_separate_endnotes dob.obj=dob.obj.gsub(/"\s+href="#_(\d+)">/,%{" href=\"endnotes#{Sfx[:html]}#_\\1">}) #endnote- twice #removed file type -- cgit v1.2.3