A lot :)
This commit is contained in:
parent
aad67af0d1
commit
63fc206c27
153 changed files with 2043 additions and 646 deletions
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module RichTextTargetBlank
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
@ -11,7 +13,7 @@ module RichTextTargetBlank
|
|||
rich_text_attribute = send(name)
|
||||
if rich_text_attribute.present?
|
||||
doc = Nokogiri::HTML::DocumentFragment.parse(rich_text_attribute.body.to_html)
|
||||
doc.css('a').each { |a| a['target'] ||= '_blank' }
|
||||
doc.css("a").each { |a| a["target"] ||= "_blank" }
|
||||
rich_text_attribute.body = doc.to_html
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue