Fix add newline on blank line
Some checks failed
/ Run tests (push) Failing after 14s
/ Run system tests (push) Failing after 14s
/ Build, push and deploy image (push) Has been skipped

This commit is contained in:
david 2024-10-26 20:06:32 +02:00
parent 69693d0a37
commit d90f1b86b8

View file

@ -10,6 +10,8 @@ module RichTextTargetBlank
# Define the before_save callback to modify the links
before_save do
next # FIXME: This adds additional newlines for each blank line.
rich_text_attribute = send(name)
if rich_text_attribute.present?
doc = Nokogiri::HTML::DocumentFragment.parse(rich_text_attribute.body.to_html)