From 56b0be0700c223fb73a2ce64420c1fa40472a103 Mon Sep 17 00:00:00 2001 From: Christy Karpinski Date: Tue, 11 Jul 2023 13:22:51 -0500 Subject: [PATCH 1/4] added citations like the DL using PALS files and added CSS for them --- .rubocop_todo.yml | 5 +- app/assets/stylesheets/atla-overrides.scss | 18 ++++ .../citation_behaviors/common_behavior.rb | 14 +++ .../hyrax/citation_behaviors/formatters.rb | 30 ++++++ .../formatters/apa_formatter.rb | 94 +++++++++++++++++++ .../formatters/chicago_formatter.rb | 64 +++++++++++++ .../formatters/mla_formatter.rb | 75 +++++++++++++++ .../hyrax/citation_behaviors/name_behavior.rb | 53 +++++++++++ .../publication_behavior.rb | 48 ++++++++++ .../citation_behaviors/title_behavior.rb | 54 +++++++++++ app/helpers/hyrax/citations_behavior.rb | 28 ++++++ app/views/hyrax/base/_citations.html.erb | 35 +++++++ 12 files changed, 517 insertions(+), 1 deletion(-) create mode 100644 app/helpers/hyrax/citation_behaviors/common_behavior.rb create mode 100644 app/helpers/hyrax/citation_behaviors/formatters.rb create mode 100644 app/helpers/hyrax/citation_behaviors/formatters/apa_formatter.rb create mode 100644 app/helpers/hyrax/citation_behaviors/formatters/chicago_formatter.rb create mode 100644 app/helpers/hyrax/citation_behaviors/formatters/mla_formatter.rb create mode 100644 app/helpers/hyrax/citation_behaviors/name_behavior.rb create mode 100644 app/helpers/hyrax/citation_behaviors/publication_behavior.rb create mode 100644 app/helpers/hyrax/citation_behaviors/title_behavior.rb create mode 100644 app/helpers/hyrax/citations_behavior.rb create mode 100644 app/views/hyrax/base/_citations.html.erb diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 902a1647..d4783517 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -132,11 +132,14 @@ Rails/HasManyOrHasOneDependent: Exclude: - 'app/models/endpoint.rb' -# Offense count: 5 +# Offense count: 7 Rails/OutputSafety: Exclude: - 'app/forms/hyrax/forms/admin/appearance.rb' - 'app/helpers/blacklight/catalog_helper_behavior.rb' + - 'app/helpers/hyrax/citations_behaviors/formatters/apa_formatter.rb' + - 'app/helpers/hyrax/citations_behaviors/formatters/chicago_formatter.rb' + - 'app/helpers/hyrax/citations_behaviors/formatters/mla_formatter.rb' # Offense count: 1 # Cop supports --auto-correct. diff --git a/app/assets/stylesheets/atla-overrides.scss b/app/assets/stylesheets/atla-overrides.scss index 12c86144..192c35e0 100644 --- a/app/assets/stylesheets/atla-overrides.scss +++ b/app/assets/stylesheets/atla-overrides.scss @@ -56,6 +56,24 @@ div.facets h3 {font-size: 1em;} /* admin dashboard available works ETD all caps*/ .dashboard label[for="input-Etd"] {text-transform: uppercase;} +/* citations style */ +button.btn.btn-default.btn-block.citations-button.center-block {margin-top: 1em;} +.mla-citation, .apa-citation, .chicago-citation { + line-height: 1.25em; + display: inline-block; + width: 100%; + font-size:0.875em; +} +div#collapse-citations{text-align:left;overflow-wrap: break-word;} +div#collapse-citations h4 {font-size:1em;} +div#collapse-citations p {font-size:0.85em;} +button.btn.btn-default.btn-block.citations-button.center-block:hover, button.btn.btn-default.btn-block.citations-button.center-block:focus{ + background-color:#337ab7; + border-color: #204d75; + color:white; +} + + @media only screen and (min-width: 768px) { .hyc-banner .hyc-title h1 {margin-bottom: 0em;} diff --git a/app/helpers/hyrax/citation_behaviors/common_behavior.rb b/app/helpers/hyrax/citation_behaviors/common_behavior.rb new file mode 100644 index 00000000..3c30e38e --- /dev/null +++ b/app/helpers/hyrax/citation_behaviors/common_behavior.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Hyrax + module CitationsBehaviors + module CommonBehavior + def persistent_url(work); end + + def clean_end_punctuation(text) + return text[0, text.length - 1] if text && ([".", ",", ":", ";", "/"].include? text[-1, 1]) + text + end + end + end +end diff --git a/app/helpers/hyrax/citation_behaviors/formatters.rb b/app/helpers/hyrax/citation_behaviors/formatters.rb new file mode 100644 index 00000000..2c7130be --- /dev/null +++ b/app/helpers/hyrax/citation_behaviors/formatters.rb @@ -0,0 +1,30 @@ +# Hyrax Override: Improve Citations Format +# frozen_string_literal: true + +module Hyrax + module CitationsBehaviors + module Formatters + class BaseFormatter + include Hyrax::CitationsBehaviors::CommonBehavior + include Hyrax::CitationsBehaviors::NameBehavior + + attr_reader :view_context + + def initialize(view_context) + @view_context = view_context + end + + # Hyrax Override: Adds new functionality for citations + def add_link_to_original(work) + persistent_url(work).to_s + end + # end + end + + autoload :ApaFormatter, 'hyrax/citations_behaviors/formatters/apa_formatter' + autoload :ChicagoFormatter, 'hyrax/citations_behaviors/formatters/chicago_formatter' + autoload :MlaFormatter, 'hyrax/citations_behaviors/formatters/mla_formatter' + autoload :OpenUrlFormatter, 'hyrax/citations_behaviors/formatters/open_url_formatter' + end + end +end diff --git a/app/helpers/hyrax/citation_behaviors/formatters/apa_formatter.rb b/app/helpers/hyrax/citation_behaviors/formatters/apa_formatter.rb new file mode 100644 index 00000000..d6f05241 --- /dev/null +++ b/app/helpers/hyrax/citation_behaviors/formatters/apa_formatter.rb @@ -0,0 +1,94 @@ +# Hyrax Override: Improve Format of Citations +# frozen_string_literal: true + +module Hyrax + module CitationsBehaviors + module Formatters + class ApaFormatter < BaseFormatter + include Hyrax::CitationsBehaviors::PublicationBehavior + include Hyrax::CitationsBehaviors::TitleBehavior + + def format(work) + text = '' + text += authors_text_for(work) + text += pub_date_text_for(work) + text += add_title_text_for(work) + # Hyrax Override: adds addtl content for citation + text += " #{add_link_to_original(work)}" + # end + text.html_safe + end + + private + + def authors_text_for(work) + # setup formatted author list + authors_list = author_list(work).reject(&:blank?) + author_text = format_authors(authors_list) + if author_text.blank? + author_text + else + "#{author_text} " + end + end + + public + + def format_authors(authors_list = []) + return '' if authors_list.blank? + authors_list = Array.wrap(authors_list).collect { |name| name.strip } + text = '' + text += convert_to_initials(authors_list.first) if authors_list.first + authors_list[1..-1].each do |author| + text += if author == authors_list.last + ", & #{convert_to_initials(author)}" + else + ", #{convert_to_initials(author)}" + end + end + text += "." unless text.end_with?(".") + text + end + + private + + def pub_date_text_for(work) + # Get Pub Date + pub_date = setup_pub_date(work) + format_date(pub_date) + end + + def add_title_text_for(work) + # setup title info + title_info = setup_title_info(work) + format_title(title_info) + end + + def add_publisher_text_for(work) + # Publisher info + pub_info = clean_end_punctuation(setup_pub_info(work)) + if pub_info.blank? + '' + else + pub_info + "." + end + end + + def convert_to_initials(name) + name = name.split(" ") + name.map { |n| n.equal?(name.last) ? n.capitalize : n[0].capitalize }.join(". ") + end + + public + + def format_date(pub_date) + pub_date.blank? ? "" : "(" + pub_date + "). " + end + + def format_title(title_info) + title_info.nil? ? "" : "#{title_info} " + end + end + end + end +end diff --git a/app/helpers/hyrax/citation_behaviors/formatters/chicago_formatter.rb b/app/helpers/hyrax/citation_behaviors/formatters/chicago_formatter.rb new file mode 100644 index 00000000..2759883d --- /dev/null +++ b/app/helpers/hyrax/citation_behaviors/formatters/chicago_formatter.rb @@ -0,0 +1,64 @@ +# Hyrax Override: Improve Citations Format +# frozen_string_literal: true + +module Hyrax + module CitationsBehaviors + module Formatters + class ChicagoFormatter < BaseFormatter + include Hyrax::CitationsBehaviors::PublicationBehavior + include Hyrax::CitationsBehaviors::TitleBehavior + def format(work) + text = "" + + # setup formatted author list + authors_list = all_authors(work) + text += format_authors(authors_list) + text = "#{text}" if text.present? + text += format_title(work.to_s) + pub_info = setup_pub_info(work, false) + text += " #{whitewash(pub_info)}." unless pub_info.blank? + pub_date = setup_pub_date(work) + text += " #{whitewash(pub_date)}." unless pub_date.nil? + text += " #{add_link_to_original(work)}" + # end + + text.html_safe + end + + def format_authors(authors_list = []) + return '' if authors_list.blank? + text = '' + text += authors_list.first if authors_list.first + authors_list[1..6].each_with_index do |author, index| + text += if index + 2 == authors_list.length # we've skipped the first author + ", and #{author}." + else + ", #{author}" + end + end + text += " et al." if authors_list.length > 7 + # if for some reason the first author ended with a comma + text = text.gsub(',,', ',') + text += "." unless text.end_with?(".") + whitewash(text) + end + + def format_date(pub_date); end + + def format_title(title_info) + return "" if title_info.blank? + title_text = chicago_citation_title(title_info) + title_text += '.' unless title_text.end_with?(".") + title_text = whitewash(title_text) + " #{title_text}" + end + + private + + def whitewash(text) + Loofah.fragment(text.to_s).scrub!(:whitewash).to_s + end + end + end + end +end diff --git a/app/helpers/hyrax/citation_behaviors/formatters/mla_formatter.rb b/app/helpers/hyrax/citation_behaviors/formatters/mla_formatter.rb new file mode 100644 index 00000000..d846d2c1 --- /dev/null +++ b/app/helpers/hyrax/citation_behaviors/formatters/mla_formatter.rb @@ -0,0 +1,75 @@ +# Hyrax Override: Improve Citations Format +# frozen_string_literal: true + +module Hyrax + module CitationsBehaviors + module Formatters + class MlaFormatter < BaseFormatter + include Hyrax::CitationsBehaviors::PublicationBehavior + include Hyrax::CitationsBehaviors::TitleBehavior + + def format(work) + text = '' + + # setup formatted author list + authors = author_list(work).reject(&:blank?) + text += "#{format_authors(authors)}" + # setup title + title_info = setup_title_info(work) + text += format_title(title_info) + + # Hyrax Override: adds contributor + text += " #{work.contributor.join(', ')}." unless work.contributor.blank? + + # Publication + pub_info = clean_end_punctuation(setup_pub_info(work, true)) + text += "#{pub_info}. " unless pub_info.blank? + # text += (pub_info + ".") if pub_info.present? + + # Hyrax Override: adds addtl content for citation + # text += add_link_to_original(work) + text += " #{add_link_to_original(work)}" + # end + + text.html_safe + end + + def format_authors(authors_list = []) + return "" if authors_list.blank? + authors_list = Array.wrap(authors_list) + text = concatenate_authors_from(authors_list) + if text.present? + text += "." unless text.end_with?(".") + text += " " + end + text + end + + def concatenate_authors_from(authors_list) + text = '' + text += authors_list.first + if authors_list.length > 1 + if authors_list.length < 4 + authors_list[1...-1].each do |author| + text += ", #{author}" + end + text += ", and #{authors_list.last}" + else + text += ", et al" + end + end + text + end + private :concatenate_authors_from + + def format_date(pub_date) + " #{pub_date.join(', ')}." + end + + def format_title(title_info) + title_info.blank? ? "" : "#{mla_citation_title(title_info)} " + end + end + end + end +end diff --git a/app/helpers/hyrax/citation_behaviors/name_behavior.rb b/app/helpers/hyrax/citation_behaviors/name_behavior.rb new file mode 100644 index 00000000..a0508eca --- /dev/null +++ b/app/helpers/hyrax/citation_behaviors/name_behavior.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +module Hyrax + module CitationsBehaviors + module NameBehavior + include Hyrax::CitationsBehaviors::CommonBehavior + # return all unique authors with end punctuation removed + def author_list(work) + all_authors(work) { |author| clean_end_punctuation(CGI.escapeHTML(author)) } + end + + # return all unique authors of a work or nil if none + def all_authors(work, &block) + authors = work.creator.uniq.compact + block_given? ? authors.map(&block) : authors + end + + def given_name_first(name) + name = clean_end_punctuation(name) + return name unless name.include?(',') + temp_name = name.split(/,\s*/) + temp_name.last + " " + temp_name.first + end + + def surname_first(name) + name = name.join('') if name.is_a? Array + # make sure we handle "Cher" correctly + return name if name.include?(',') + name_segments = name.split(' ') + given_name = name_segments.first + surnames = name_segments[1..-1] + if surnames + "#{surnames.join(' ')}, #{given_name}" + else + given_name + end + end + + def abbreviate_name(name) + abbreviated_name = '' + name = name.join('') if name.is_a? Array + + # make sure we handle "Cher" correctly + return name unless name.include?(' ') || name.include?(',') + name = surname_first(name) + name_segments = name.split(/,\s*/) + abbreviated_name += name_segments.first + abbreviated_name += ", #{name_segments.last.first}" if name_segments[1] + abbreviated_name + "." + end + end + end +end diff --git a/app/helpers/hyrax/citation_behaviors/publication_behavior.rb b/app/helpers/hyrax/citation_behaviors/publication_behavior.rb new file mode 100644 index 00000000..f7811180 --- /dev/null +++ b/app/helpers/hyrax/citation_behaviors/publication_behavior.rb @@ -0,0 +1,48 @@ +# Hyrax Override: Improve Citations Format +# frozen_string_literal: true + +module Hyrax + module CitationsBehaviors + module PublicationBehavior + include Hyrax::CitationsBehaviors::CommonBehavior + def setup_pub_date(work) + first_date = work.date_created.first if work.date_created + if first_date.present? + first_date = CGI.escapeHTML(first_date) + date_value = first_date.gsub(/[^0-9|n\.d\.]/, "")[0, 4] + return nil if date_value.nil? + end + clean_end_punctuation(date_value) if date_value + end + + # @param [Hyrax::WorkShowPresenter] work_presenter + def setup_pub_place(work_presenter) + work_presenter.based_near_label&.first + end + + def setup_pub_publisher(work) + work.publisher&.first + end + + def setup_pub_info(work, include_date = false) + pub_info = "" + + if (place = setup_pub_place(work)) + pub_info += CGI.escapeHTML(place) + end + + if (publisher = setup_pub_publisher(work)) + # Hyrax Override: format was wrong + # ':' should only be added if there is previous info + pub_info += ":" unless pub_info.empty? + pub_info += " #{CGI.escapeHTML(publisher)}" + end + + pub_date = include_date ? setup_pub_date(work) : nil + pub_info += ". #{pub_date}" unless pub_date.nil? + + pub_info.strip.presence + end + end + end +end diff --git a/app/helpers/hyrax/citation_behaviors/title_behavior.rb b/app/helpers/hyrax/citation_behaviors/title_behavior.rb new file mode 100644 index 00000000..d33b8991 --- /dev/null +++ b/app/helpers/hyrax/citation_behaviors/title_behavior.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +module Hyrax + module CitationsBehaviors + module TitleBehavior + include Hyrax::CitationsBehaviors::CommonBehavior + + TITLE_NOCAPS = ["a", "an", "and", "but", "by", "for", "it", "of", "the", "to", "with"].freeze + EXPANDED_NOCAPS = TITLE_NOCAPS + ["about", "across", "before", "without"] + + def chicago_citation_title(title_text) + process_title_parts(title_text) do |w, index| + if (index.zero? && w.casecmp(w).zero?) || (w.length > 1 && w.casecmp(w).zero? && !EXPANDED_NOCAPS.include?(w)) + # the split("-") will handle the capitalization of hyphenated words + w.split("-").map!(&:capitalize).join("-") + else + w + end + end + end + + def mla_citation_title(title_text) + process_title_parts(title_text) do |w| + if TITLE_NOCAPS.include? w + w + else + w.capitalize + end + end + end + + def process_title_parts(title_text, &block) + if block_given? + title_text.split(" ").collect.with_index(&block).join(" ") + else + title_text + end + end + + def setup_title_info(work) + text = '' + title = work.to_s + if title.present? + title = CGI.escapeHTML(title) + title_info = clean_end_punctuation(title.strip) + text += title_info + end + + return nil if text.strip.blank? + clean_end_punctuation(text.strip) + "." + end + end + end +end diff --git a/app/helpers/hyrax/citations_behavior.rb b/app/helpers/hyrax/citations_behavior.rb new file mode 100644 index 00000000..aa3ea963 --- /dev/null +++ b/app/helpers/hyrax/citations_behavior.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Hyrax + module CitationsBehavior + include Hyrax::CitationsBehaviors::CommonBehavior + include Hyrax::CitationsBehaviors::Formatters + include Hyrax::CitationsBehaviors::PublicationBehavior + include Hyrax::CitationsBehaviors::NameBehavior + include Hyrax::CitationsBehaviors::TitleBehavior + + def export_as_apa_citation(work) + Hyrax::CitationsBehaviors::Formatters::ApaFormatter.new(self).format(work) + end + + def export_as_chicago_citation(work) + Hyrax::CitationsBehaviors::Formatters::ChicagoFormatter.new(self).format(work) + end + + def export_as_mla_citation(work) + Hyrax::CitationsBehaviors::Formatters::MlaFormatter.new(self).format(work) + end + + # MIME type: 'application/x-openurl-ctx-kev' + def export_as_openurl_ctx_kev(work) + Hyrax::CitationsBehaviors::Formatters::OpenUrlFormatter.new(self).format(work) + end + end +end diff --git a/app/views/hyrax/base/_citations.html.erb b/app/views/hyrax/base/_citations.html.erb new file mode 100644 index 00000000..7087632f --- /dev/null +++ b/app/views/hyrax/base/_citations.html.erb @@ -0,0 +1,35 @@ + + +
+
+

MLA citation style (9th ed.)

+ <%= export_as_mla_citation(@presenter) %> + <%= request.original_url.sub(/^https?\:\/\/(www.)?/,'') %>. + +

+ +

APA citation style (7th ed.)

+ <%= export_as_apa_citation(@presenter) %> + <%= request.original_url %> + +

+ +

Chicago citation style (CMOS 17, author-date)

+ <%= export_as_chicago_citation(@presenter) %> + <%= request.original_url %>. +

+ +

+ Note: + These citations are programmatically generated and may be incomplete. +

+
\ No newline at end of file From 165cb75881a4affc158f5db9e7e1d5b4eeb93ac3 Mon Sep 17 00:00:00 2001 From: Christy Karpinski Date: Tue, 11 Jul 2023 14:26:52 -0500 Subject: [PATCH 2/4] changed citation button text --- config/locales/hyrax.en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/hyrax.en.yml b/config/locales/hyrax.en.yml index 491abdbb..f876d30f 100644 --- a/config/locales/hyrax.en.yml +++ b/config/locales/hyrax.en.yml @@ -346,7 +346,7 @@ en: background_attribution_html: "" base: citations: - header: "Citations:" + header: "Cite this item" form_child_work_relationships: actions: remove: Remove from this work From c91a3c1a17fefd1fcc7f86eda7c0494b434a8dcc Mon Sep 17 00:00:00 2001 From: Christy Karpinski Date: Tue, 11 Jul 2023 14:40:40 -0500 Subject: [PATCH 3/4] rubocop fixes --- .../hyrax/citation_behaviors/formatters/apa_formatter.rb | 2 +- .../hyrax/citation_behaviors/formatters/chicago_formatter.rb | 2 +- .../hyrax/citation_behaviors/formatters/mla_formatter.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/helpers/hyrax/citation_behaviors/formatters/apa_formatter.rb b/app/helpers/hyrax/citation_behaviors/formatters/apa_formatter.rb index d6f05241..afa17f61 100644 --- a/app/helpers/hyrax/citation_behaviors/formatters/apa_formatter.rb +++ b/app/helpers/hyrax/citation_behaviors/formatters/apa_formatter.rb @@ -36,7 +36,7 @@ def authors_text_for(work) def format_authors(authors_list = []) return '' if authors_list.blank? - authors_list = Array.wrap(authors_list).collect { |name| name.strip } + authors_list = Array.wrap(authors_list).collect(&:strip) text = '' text += convert_to_initials(authors_list.first) if authors_list.first authors_list[1..-1].each do |author| diff --git a/app/helpers/hyrax/citation_behaviors/formatters/chicago_formatter.rb b/app/helpers/hyrax/citation_behaviors/formatters/chicago_formatter.rb index 2759883d..bf892de1 100644 --- a/app/helpers/hyrax/citation_behaviors/formatters/chicago_formatter.rb +++ b/app/helpers/hyrax/citation_behaviors/formatters/chicago_formatter.rb @@ -16,7 +16,7 @@ def format(work) text = "#{text}" if text.present? text += format_title(work.to_s) pub_info = setup_pub_info(work, false) - text += " #{whitewash(pub_info)}." unless pub_info.blank? + text += " #{whitewash(pub_info)}." if pub_info.present? pub_date = setup_pub_date(work) text += " #{whitewash(pub_date)}." unless pub_date.nil? text += " #{add_link_to_original(work)}" diff --git a/app/helpers/hyrax/citation_behaviors/formatters/mla_formatter.rb b/app/helpers/hyrax/citation_behaviors/formatters/mla_formatter.rb index d846d2c1..4910d740 100644 --- a/app/helpers/hyrax/citation_behaviors/formatters/mla_formatter.rb +++ b/app/helpers/hyrax/citation_behaviors/formatters/mla_formatter.rb @@ -19,11 +19,11 @@ def format(work) text += format_title(title_info) # Hyrax Override: adds contributor - text += " #{work.contributor.join(', ')}." unless work.contributor.blank? + text += " #{work.contributor.join(', ')}." if work.contributor.present? # Publication pub_info = clean_end_punctuation(setup_pub_info(work, true)) - text += "#{pub_info}. " unless pub_info.blank? + text += "#{pub_info}. " if pub_info.present? # text += (pub_info + ".") if pub_info.present? # Hyrax Override: adds addtl content for citation From 3705ae1cde1d067c3015d391eaf34a6315c8af45 Mon Sep 17 00:00:00 2001 From: Christy Karpinski Date: Mon, 17 Jul 2023 12:41:53 -0500 Subject: [PATCH 4/4] disabled rubocop around tagging string html error --- .../hyrax/citation_behaviors/formatters/apa_formatter.rb | 2 +- .../hyrax/citation_behaviors/formatters/chicago_formatter.rb | 2 +- .../hyrax/citation_behaviors/formatters/mla_formatter.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/hyrax/citation_behaviors/formatters/apa_formatter.rb b/app/helpers/hyrax/citation_behaviors/formatters/apa_formatter.rb index afa17f61..cb58a979 100644 --- a/app/helpers/hyrax/citation_behaviors/formatters/apa_formatter.rb +++ b/app/helpers/hyrax/citation_behaviors/formatters/apa_formatter.rb @@ -16,7 +16,7 @@ def format(work) # Hyrax Override: adds addtl content for citation text += " #{add_link_to_original(work)}" # end - text.html_safe + text.html_safe # rubocop:disable Rails/OutputSafety end private diff --git a/app/helpers/hyrax/citation_behaviors/formatters/chicago_formatter.rb b/app/helpers/hyrax/citation_behaviors/formatters/chicago_formatter.rb index bf892de1..7390cc89 100644 --- a/app/helpers/hyrax/citation_behaviors/formatters/chicago_formatter.rb +++ b/app/helpers/hyrax/citation_behaviors/formatters/chicago_formatter.rb @@ -22,7 +22,7 @@ def format(work) text += " #{add_link_to_original(work)}" # end - text.html_safe + text.html_safe # rubocop:disable Rails/OutputSafety end def format_authors(authors_list = []) diff --git a/app/helpers/hyrax/citation_behaviors/formatters/mla_formatter.rb b/app/helpers/hyrax/citation_behaviors/formatters/mla_formatter.rb index 4910d740..14986a96 100644 --- a/app/helpers/hyrax/citation_behaviors/formatters/mla_formatter.rb +++ b/app/helpers/hyrax/citation_behaviors/formatters/mla_formatter.rb @@ -31,7 +31,7 @@ def format(work) text += " #{add_link_to_original(work)}" # end - text.html_safe + text.html_safe # rubocop:disable Rails/OutputSafety end def format_authors(authors_list = [])