Merge pull request #5536 from betagouv/5529-tabs-in-attestations

#5529 - Replacement des tabulations par des espaces dans l’attestation
This commit is contained in:
Keirua 2020-09-09 10:42:11 +02:00 committed by GitHub
commit 8785d3608d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,9 +19,13 @@ max_logo_width = body_width
max_logo_height = 50.mm max_logo_height = 50.mm
max_signature_size = 50.mm max_signature_size = 50.mm
title = @attestation.fetch(:title) def normalize_pdf_text(text)
body = @attestation.fetch(:body) text&.tr("\t", ' ')
footer = @attestation.fetch(:footer) 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) created_at = @attestation.fetch(:created_at)
logo = @attestation[:logo] logo = @attestation[:logo]