diff options
Diffstat (limited to 'app/lib/link_details_extractor.rb')
-rw-r--r-- | app/lib/link_details_extractor.rb | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/app/lib/link_details_extractor.rb b/app/lib/link_details_extractor.rb index d2bcf0c25..fabbd244d 100644 --- a/app/lib/link_details_extractor.rb +++ b/app/lib/link_details_extractor.rb @@ -2,6 +2,7 @@ class LinkDetailsExtractor include ActionView::Helpers::TagHelper + include LanguagesHelper # Some publications wrap their JSON-LD data in their <script> tags # in commented-out CDATA blocks, they need to be removed before @@ -218,14 +219,6 @@ class LinkDetailsExtractor nil end - def valid_locale_or_nil(str) - return nil if str.blank? - - code, = str.split(/_-/) # Strip out the region from e.g. en_US or ja-JA - locale = ISO_639.find(code) - locale&.alpha2 - end - def link_tag(name) document.xpath("//link[@rel=\"#{name}\"]").map { |link| link['href'] }.first end |