From c36e976c00bac90fd01fe12f6c9bc632e3b209b7 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 10 Mar 2010 16:43:15 -0500 Subject: epub, html: make robust where missing param values --- lib/sisu/v2/html.rb | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'lib/sisu/v2/html.rb') diff --git a/lib/sisu/v2/html.rb b/lib/sisu/v2/html.rb index 4959d683..834eefa1 100644 --- a/lib/sisu/v2/html.rb +++ b/lib/sisu/v2/html.rb @@ -533,7 +533,7 @@ WOK format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,txt_obj) toc_shared << format_txt_obj.center_bold @segtoc << format_txt_obj.center_bold - if @md.creator.author + if defined? @md.creator.author creator_endnote=@md.creator.author.gsub(/(\*+)/,%{ \\1}) tmp_head=creator_endnote + "\n" txt_obj={:txt =>tmp_head} @@ -553,13 +553,20 @@ WOK end tmp_head=nil toc_shared << @links_guide_toc - toc_shared << rights if @md.rights.all - toc_shared << prefix_b if @md.prefix_b + if defined? @md.rights.all #and ? @md.rights.all + toc_shared << rights + end + if defined? @md.prefix_b + toc_shared << prefix_b + end #Table of Contents added/appended here toc_shared << @toc[:scr] @segtoc << @links_guide_toc @segtoc << @toc[:seg] - @segtoc << rights if @md.rights.all + if defined? @md.rights.all \ + and not @md.rights.all.empty? + @segtoc << rights + end @segtoc << prefix_b if @md.prefix_b #Segtoc tail added here @segtoc << "

\n" #bugfix sort later DEBUGNOW -- cgit v1.2.3