From 19c1043b94f8f74632fd23ff8bb282314afbfb9a Mon Sep 17 00:00:00 2001 From: clemkeirua Date: Thu, 3 Sep 2020 16:01:55 +0200 Subject: [PATCH] replace tabs with spaces in attestation --- .../attestation_templates/show.pdf.prawn | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/views/new_administrateur/attestation_templates/show.pdf.prawn b/app/views/new_administrateur/attestation_templates/show.pdf.prawn index a77a6711c..a09a03d91 100644 --- a/app/views/new_administrateur/attestation_templates/show.pdf.prawn +++ b/app/views/new_administrateur/attestation_templates/show.pdf.prawn @@ -19,9 +19,13 @@ max_logo_width = body_width max_logo_height = 50.mm max_signature_size = 50.mm -title = @attestation.fetch(:title) -body = @attestation.fetch(:body) -footer = @attestation.fetch(:footer) +def normalize_pdf_text(text) + text&.tr("\t", ' ') +end + +title = normalize_pdf_text(@attestation.fetch(:title)) +body = normalize_pdf_text(@attestation.fetch(:body)) +footer = normalize_pdf_text(@attestation.fetch(:footer)) created_at = @attestation.fetch(:created_at) logo = @attestation[:logo]