Make rich_text searchable and renderable in pdf

This commit is contained in:
david 2024-07-21 01:41:08 +02:00
parent 6d3a269231
commit 879670983d
6 changed files with 26 additions and 5 deletions

View file

@ -0,0 +1,8 @@
module PdfHelper
def prepare_rich_text(rich_text)
%w[div p del blockquote pre code].each do |tag|
rich_text = rich_text.to_s.gsub(%r{<#{tag}.*?>|</#{tag}>}, '')
end
rich_text
end
end