Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Replace calls to `Rinku.auto_link` with the Rails wrapper method

Aaron Contreras1cbf22476c2a
diff --git a/lib/open_project/text_formatting/filters/autolink_filter.rb b/lib/open_project/text_formatting/filters/autolink_filter.rb
index 368de9b2c0f..97a39b83257 100644
--- a/lib/open_project/text_formatting/filters/autolink_filter.rb
+++ b/lib/open_project/text_formatting/filters/autolink_filter.rb
@@ -25,7 +25,7 @@
#
# See COPYRIGHT and LICENSE files for more details.
#++
-require 'rinku'
+require 'rails_rinku'
module OpenProject::TextFormatting
module Filters
diff --git a/lib/open_project/text_formatting/filters/plain_filter.rb b/lib/open_project/text_formatting/filters/plain_filter.rb
index db79252b3f1..89669405010 100644
--- a/lib/open_project/text_formatting/filters/plain_filter.rb
+++ b/lib/open_project/text_formatting/filters/plain_filter.rb
@@ -35,8 +35,7 @@ module OpenProject::TextFormatting
include ActionView::Helpers::UrlHelper
def call
- escaped = CGI::escapeHTML(text)
- linked = Rinku.auto_link(escaped, :all)
+ linked = auto_link(text, :all)
simple_format(linked)
end
end
diff --git a/modules/meeting/app/components/meetings/row_component.rb b/modules/meeting/app/components/meetings/row_component.rb
index 1421f797927..bc384ecb100 100644
--- a/modules/meeting/app/components/meetings/row_component.rb
+++ b/modules/meeting/app/components/meetings/row_component.rb
@@ -47,9 +47,9 @@ module Meetings
end
def location
- ::Rinku.auto_link(h(model.location),
- :all,
- 'target="_blank"').html_safe
+ helpers.auto_link(model.location,
+ link: :all,
+ html: { target: '_blank' })
end
end
end