diff --git a/app/services/reports/docx.rb b/app/services/reports/docx.rb index fd9f0a573..ef668f4f5 100644 --- a/app/services/reports/docx.rb +++ b/app/services/reports/docx.rb @@ -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 diff --git a/app/services/reports/docx/private_methods.rb b/app/services/reports/docx/private_methods.rb index 31231e74b..392ee1714 100644 --- a/app/services/reports/docx/private_methods.rb +++ b/app/services/reports/docx/private_methods.rb @@ -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