aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v4/html_minitoc.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v4/html_minitoc.rb')
-rw-r--r--lib/sisu/v4/html_minitoc.rb27
1 files changed, 21 insertions, 6 deletions
diff --git a/lib/sisu/v4/html_minitoc.rb b/lib/sisu/v4/html_minitoc.rb
index d333e3fe..2733affb 100644
--- a/lib/sisu/v4/html_minitoc.rb
+++ b/lib/sisu/v4/html_minitoc.rb
@@ -153,14 +153,21 @@
txt=@data
unless txt =~/~metadata/
if txt.ln ==4
- seg_link=%{ <a href="#{txt.name}#{@md.lang_code_insert}#{Sfx[:html]}" target="_top">
+ fnh={
+ fn: txt.name,
+ }
+ f=@md.file.base_filename.html_seg(fnh)
+ seg_link=%{ <a href="#{f}" target="_top">
#{txt.obj}
</a> }
@@seg_url=txt.name
elsif txt.obj =~/\d+.\d+.\d+.\d+|\d+.\d+.\d+|\d+.\d+|\d+/
- seg_link=txt.obj.gsub(/^(\d+.\d+.\d+.\d+|\d+.\d+.\d+|\d+.\d+|\d+)(.*)/,
- %{<a href="\\2#{@md.lang_code_insert}#{Sfx[:html]}" } +
- %{target="_top">\\1 \\2</a> })
+ fn,hd=/^(\d+.\d+.\d+.\d+|\d+.\d+.\d+|\d+.\d+|\d+)(.*)/.match(dob.obj)[1,2]
+ fnh={
+ fn: fn,
+ }
+ f=@md.file.base_filename.html_seg(fnh)
+ seg_link=%{<a href="#{f}" target="_top">#{fn} #{hd}</a> }
end
txt_obj={ txt: seg_link }
format_toc=SiSU_HTML_Format::FormatToc.new(@md,txt_obj)
@@ -175,7 +182,11 @@
&& txt.ocn !=0
txt.obj=txt.obj.gsub(@pat_strip_heading_name,'\1')
end
- lnk_n_txt=%{ <a href="#{@@seg_url}#{@md.lang_code_insert}#{Sfx[:html]}##{txt.ocn}">
+ fnh={
+ fn: @@seg_url,
+ }
+ f=@md.file.base_filename.html_seg(fnh)
+ lnk_n_txt=%{ <a href="#{f}##{txt.ocn}">
#{txt.obj}
</a>}
txt_obj={ txt: lnk_n_txt }
@@ -190,7 +201,11 @@
&& txt.ocn !=0
txt.obj=txt.obj.gsub(@pat_strip_heading_name,'\1')
end
- lnk_n_txt=%{ <a href="#{@@seg_url}#{@md.lang_code_insert}#{Sfx[:html]}##{txt.ocn}">
+ fnh={
+ fn: @@seg_url,
+ }
+ f=@md.file.base_filename.html_seg(fnh)
+ lnk_n_txt=%{ <a href="#{f}##{txt.ocn}">
#{txt.obj}
</a>}
txt_obj={ txt: lnk_n_txt }