mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 11:45:18 +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
|
||||
@docx
|
||||
end
|
||||
|
||||
|
||||
def self.link_prepare(scinote_url, link)
|
||||
link[0] == '/' ? scinote_url + link : link
|
||||
end
|
||||
end
|
||||
|
||||
# rubocop:enable Style/ClassAndModuleChildren
|
||||
|
|
|
@ -39,7 +39,8 @@ module PrivateMethods
|
|||
br
|
||||
elsif text_el[:type] == 'a'
|
||||
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
|
||||
text text_el[:value], link_style
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue