diff options
author | Ralph Amissah <ralph@amissah.com> | 2013-07-30 21:42:02 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2013-07-30 21:42:02 -0400 |
commit | d15713b728f0c923837e6c417d095e5e1fe2d443 (patch) | |
tree | b293b1310a352fb99b5bd7a3b6fed46ba49b9a46 /lib/sisu/v5/concordance.rb | |
parent | debian/changelog (4.1.7-1) (diff) | |
parent | v5: cgi helper script, sample search form, single form, monolingual option (diff) |
Merge tag 'sisu_4.1.8' into debian/sid
SiSU 4.1.8
Diffstat (limited to 'lib/sisu/v5/concordance.rb')
-rw-r--r-- | lib/sisu/v5/concordance.rb | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/lib/sisu/v5/concordance.rb b/lib/sisu/v5/concordance.rb index f2143bb8..48ac1aac 100644 --- a/lib/sisu/v5/concordance.rb +++ b/lib/sisu/v5/concordance.rb @@ -239,15 +239,26 @@ WOK %{<a href="doc#{@md.lang_code_insert}#{Sfx[:html]}\##{wordlocation}">#{wordlocation}</a>; } end def location_seg(wordlocation,show) ##fix - @word_location_seg=wordlocation.gsub(/(.+?)\#(\d+)/,"\\1#{@md.lang_code_insert}#{Sfx[:html]}#\\2") unless wordlocation.nil? case wordlocation - when @rxp_t1 - %{[<a href="doc#{@md.lang_code_insert}#{Sfx[:html]}##{show}">H</a>]#{show}, } - when @rxp_t2 - %{[<a href="doc#{@md.lang_code_insert}#{Sfx[:html]}##{show}">H</a>]#{show}, } - when @rxp_t3 - %{[<a href="doc#{@md.lang_code_insert}#{Sfx[:html]}##{show}">H</a>]#{show}, } - else %{<a href="#{@word_location_seg}">#{show}</a>, } + when /@rxp_t1|@rxp_t2|@rxp_t3/ + fnh={ + fn: 'doc', + lng: @md.lang_code_insert + } + fn=@md.file.base_filename.html_seg(fnh) + %{[<a href="#{fn}##{show}">H</a>]#{show}, } + else + if not wordlocation.nil? \ + and wordlocation =~ /(.+?)\#(\d+)/ + seg,loc=/(.+?)\#(\d+)/.match(wordlocation)[1,2] + fnh={ + fn: seg, + lng: @md.lang_code_insert + } + fn=@md.file.base_filename.html_seg(fnh) + word_location_seg=%{#{fn}##{loc}} + %{<a href="#{word_location_seg}">#{show}</a>, } + end end end def map_para |