mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 05:02:50 +08:00
Fix global links in reports (#1894)
This commit is contained in:
parent
4fe3119bd2
commit
c8b0d87054
2 changed files with 7 additions and 1 deletions
|
@ -35,6 +35,11 @@ class Reports::Docx
|
||||||
end
|
end
|
||||||
@docx
|
@docx
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def self.link_prepare(scinote_url, link)
|
||||||
|
link[0] == '/' ? scinote_url + link : link
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# rubocop:enable Style/ClassAndModuleChildren
|
# rubocop:enable Style/ClassAndModuleChildren
|
||||||
|
|
|
@ -39,7 +39,8 @@ module PrivateMethods
|
||||||
br
|
br
|
||||||
elsif text_el[:type] == 'a'
|
elsif text_el[:type] == 'a'
|
||||||
if text_el[:link]
|
if text_el[:link]
|
||||||
link text_el[:value], scinote_url + text_el[:link], link_style
|
link_url = Reports::Docx.link_prepare(scinote_url, text_el[:link])
|
||||||
|
link text_el[:value], link_url, link_style
|
||||||
else
|
else
|
||||||
text text_el[:value], link_style
|
text text_el[:value], link_style
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue