aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v4/epub_format.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2013-03-05 21:47:08 -0500
committerRalph Amissah <ralph@amissah.com>2013-03-05 21:47:08 -0500
commit98b3549d115436c0419d29cf7d7f5521a3640e7b (patch)
treecaf01b400b81813983283778e03060c86e529136 /lib/sisu/v4/epub_format.rb
parentdebian/changelog (4.0.9-1) (diff)
parentv4: html, epub, minor "cleaning" of output (diff)
Merge tag 'sisu_4.0.10' into debian/sid
SiSU 4.0.10
Diffstat (limited to 'lib/sisu/v4/epub_format.rb')
-rw-r--r--lib/sisu/v4/epub_format.rb15
1 files changed, 8 insertions, 7 deletions
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?
+ %{<label class="ocn_off"></label>}
else
@ocn.gsub(/^(\d+|)$/,
%{<label class="#{ocn_class}"><a href="#o\\1" class="lnk#{ocn_class}">\\1</a></label>})
end
else
- ocn_class='ocn_off'
- @ocn.gsub(/^(\d+|)$/,'')
+ %{<label class="ocn_off"></label>}
end
end
def name
- %{<a name="#{@ocn}"></a>}
+ (@ocn==nil || @ocn.empty?) ? '' : %{<a name="#{@ocn}"></a>}
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
- %{<a href="##{@ocn}">}
+ (@ocn==nil || @ocn.empty?) ? '' : %{<a href="##{@ocn}">}
end
end
class CSS