DEV: Remove old link building code. (#16121)
We have a new API introduced [here](https://github.com/discourse/discourse/pull/14553).
This commit is contained in:
parent
76ece494f9
commit
136f7dbf78
|
@ -40,12 +40,6 @@ class ReviewableScoreSerializer < ApplicationSerializer
|
|||
text = I18n.t("reviewables.reasons.#{object.reason}", link: link, default: nil)
|
||||
else
|
||||
text = I18n.t("reviewables.reasons.#{object.reason}", default: nil)
|
||||
|
||||
# TODO(roman): Remove after the 2.8 release.
|
||||
# The discourse-antivirus and akismet plugins still use the backtick format for settings.
|
||||
# It'll be hard to migrate them to the new format without breaking backwards compatibility, so I'm keeping the old behavior for now.
|
||||
# Will remove after the 2.8 release.
|
||||
linkify_backticks(object.reason, text) if text
|
||||
end
|
||||
|
||||
text
|
||||
|
@ -86,15 +80,4 @@ class ReviewableScoreSerializer < ApplicationSerializer
|
|||
|
||||
"<a href=\"#{url_for(reason, text)}\">#{text.gsub('_', ' ')}</a>"
|
||||
end
|
||||
|
||||
def linkify_backticks(reason, text)
|
||||
text.gsub!(/`[a-z_]+`/) do |m|
|
||||
if scope.is_staff?
|
||||
setting = m[1..-2]
|
||||
"<a href=\"#{url_for(reason, setting)}\">#{setting.gsub('_', ' ')}</a>"
|
||||
else
|
||||
m.gsub('_', ' ')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue