aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5/html.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-01-06 22:31:25 -0500
committerRalph Amissah <ralph@amissah.com>2014-01-06 22:31:28 -0500
commita90463bbbc266938a39ef9110db3e0edf56b5f94 (patch)
tree80115f18400af6c89b53f4851292a4fbe5cd5bf9 /lib/sisu/v5/html.rb
parentbin/sisu, version dir (fix) & version info (diff)
v4 v5: fixes
* ao_doc_str, nodes, possible parents, correction * epub, url closure decoration * sysenv, qrcode report absent program, minor * html scroll toc, clean links where none, exclude metadata
Diffstat (limited to 'lib/sisu/v5/html.rb')
-rw-r--r--lib/sisu/v5/html.rb23
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/sisu/v5/html.rb b/lib/sisu/v5/html.rb
index 955b57f1..fda8e8ab 100644
--- a/lib/sisu/v5/html.rb
+++ b/lib/sisu/v5/html.rb
@@ -342,7 +342,7 @@ WOK
and link !~/#/ #% keep eye on link
SiSU_HTML_Format::ParagraphNumber.new(@md,link)
end
- title=if dob.obj !~/Metadata/ then linkname
+ title=if dob.obj !~/^Metadata$/ then linkname
else
link='metadata'
%{<b><a href="#{link}#{@md.lang_code_insert}#{Sfx[:html]}">#{linkname}</a></b>}
@@ -370,16 +370,13 @@ WOK
end
else
@@toc[:scr] << '<br />'
- link=(dob.ln) \
- ? dob.ln
- : ''
- %{<b><a href="##{link}">#{linkname}</a></b>}
+ %{<b><a href="##{dob.ocn}">#{linkname}</a></b>}
end
txt_obj={ txt: title }
format_toc=SiSU_HTML_Format::FormatToc.new(@md,txt_obj)
- toc[:scr]=if dob.name =~/^meta/ \
- and dob.obj =~/Document Information/
- format_toc.lev0
+ toc[:scr]=if dob.obj =~/^Metadata$/ then ''
+ elsif txt_obj[:txt] =~/<a href="#">/
+ format_toc.lev1.gsub(/<a href="#">|<\/a>/,'')
else format_toc.lev1
end
toc
@@ -401,7 +398,10 @@ WOK
title=%{#{p_num.goto}#{linkname}</a>}
txt_obj={ txt: title }
format_toc=SiSU_HTML_Format::FormatToc.new(@md,txt_obj)
- toc[:scr]=format_toc.lev2
+ toc[:scr]=if txt_obj[:txt] =~/<a href="#">/
+ format_toc.lev2.gsub(/<a href="#">|<\/a>/,'')
+ else format_toc.lev2
+ end
end
toc
end
@@ -422,7 +422,10 @@ WOK
title=%{#{p_num.goto}#{linkname}</a>}
txt_obj={ txt: title }
format_toc=SiSU_HTML_Format::FormatToc.new(@md,txt_obj)
- toc[:scr]=format_toc.lev3
+ toc[:scr]=if txt_obj[:txt] =~/<a href="#">/
+ format_toc.lev3.gsub(/<a href="#">|<\/a>/,'')
+ else format_toc.lev3
+ end
end
toc
end