From 0e49f3321abda9655f99b84bf3bf8fadd237e17a Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 24 Nov 2022 18:18:24 +0100 Subject: [PATCH] fix(pdf): strip html in type_de_champ descriptions --- app/views/dossiers/dossier_vide.pdf.prawn | 2 +- app/views/dossiers/show.pdf.prawn | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/dossiers/dossier_vide.pdf.prawn b/app/views/dossiers/dossier_vide.pdf.prawn index 12e4c5d89..d6146b7b4 100644 --- a/app/views/dossiers/dossier_vide.pdf.prawn +++ b/app/views/dossiers/dossier_vide.pdf.prawn @@ -115,7 +115,7 @@ def add_explanation(pdf, explanation) end def add_optionnal_description(pdf, champ) - add_explanation(pdf, champ.description.strip + "\n\n") if champ.description.present? + add_explanation(pdf, strip_tags(champ.description).strip + "\n\n") if champ.description.present? end def render_single_champ(pdf, champ) diff --git a/app/views/dossiers/show.pdf.prawn b/app/views/dossiers/show.pdf.prawn index 48372fbcb..94e8b1f4f 100644 --- a/app/views/dossiers/show.pdf.prawn +++ b/app/views/dossiers/show.pdf.prawn @@ -142,7 +142,7 @@ def add_single_champ(pdf, champ) when 'Champs::HeaderSectionChamp' add_section_title(pdf, tdc.libelle) when 'Champs::ExplicationChamp' - format_in_2_lines(pdf, tdc.libelle, tdc.description) + format_in_2_lines(pdf, tdc.libelle, strip_tags(tdc.description)) when 'Champs::CarteChamp' format_in_2_lines(pdf, tdc.libelle, champ.to_feature_collection.to_json) when 'Champs::SiretChamp'