From 839f03743a261716e4c6b5f97f4bd5723ff97eb4 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 5 Mar 2013 21:43:31 -0500 Subject: v4: html, epub, minor "cleaning" of output --- lib/sisu/v4/epub_format.rb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'lib/sisu/v4/epub_format.rb') diff --git a/lib/sisu/v4/epub_format.rb b/lib/sisu/v4/epub_format.rb index 49139667..683228c3 100644 --- a/lib/sisu/v4/epub_format.rb +++ b/lib/sisu/v4/epub_format.rb @@ -70,25 +70,26 @@ module SiSU_EPUB_Format make=SiSU_Env::ProcessingSettings.new(@md) if make.build.ocn? ocn_class='ocn' - if @ocn.to_i==0 - @ocn.gsub(/^(\d+|)$/,'') + if @ocn==nil \ + or @ocn.to_i==0 \ + or @ocn.empty? + %{} else @ocn.gsub(/^(\d+|)$/, %{}) end else - ocn_class='ocn_off' - @ocn.gsub(/^(\d+|)$/,'') + %{} end end def name - %{} + (@ocn==nil || @ocn.empty?) ? '' : %{} end def id #w3c? "tidy" complains about numbers as identifiers ! annoying - (@ocn.empty?) ? '' : %{id="o#{@ocn}"} + (@ocn==nil || @ocn.empty?) ? '' : %{id="o#{@ocn}"} end def goto - %{} + (@ocn==nil || @ocn.empty?) ? '' : %{} end end class CSS -- cgit v1.2.3