Skip to content

Commit

Permalink
fix: summaries don't get over-escaped (#2558)
Browse files Browse the repository at this point in the history
  • Loading branch information
kimadactyl authored Aug 15, 2024
1 parent f4635a4 commit 82caec5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions app/jobs/calendar_importer/events/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def html_sanitize(input, as_plaintext: false)

# do we have HTML? yeah let's get rid of that
doc = Nokogiri::HTML.fragment(clean_text)
if as_plaintext
clean_text = doc.text

if as_plaintext
doc.text
else
tags = doc.css('*')

Expand Down Expand Up @@ -75,10 +75,9 @@ def html_sanitize(input, as_plaintext: false)
body_text = doc.serialize
clean_text = ActionController::Base.helpers.sanitize(body_text, tags: ALLOWED_TAGS)
end
end

# convert HTML tags into markdown kramdown
Kramdown::Document.new(clean_text, input: input_mode).to_kramdown.strip
Kramdown::Document.new(clean_text, input: input_mode).to_kramdown.strip
end
end

def attributes
Expand Down

0 comments on commit 82caec5

Please sign in to comment.