From 843f95fcf88402563a82732081b2a1ea179e4f77 Mon Sep 17 00:00:00 2001 From: Liam Morland <lkmorlan@uwaterloo.ca> Date: Fri, 29 May 2020 14:59:50 -0400 Subject: [PATCH] Issue #3109697: Refactor encoding of end-of-line characters --- src/Component/Helper/FillPdfMappingHelper.php | 3 +-- src/TokenResolver.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Component/Helper/FillPdfMappingHelper.php b/src/Component/Helper/FillPdfMappingHelper.php index 3ba02d3..7767167 100644 --- a/src/Component/Helper/FillPdfMappingHelper.php +++ b/src/Component/Helper/FillPdfMappingHelper.php @@ -32,8 +32,7 @@ class FillPdfMappingHelper { $split = explode('|', $replacement); // Sometimes it isn't; don't know why. if (count($split) == 2) { - $return[$split[0]] = preg_replace('|<br />|', ' -', $split[1]); + $return[$split[0]] = preg_replace('|<br />|', "\n", $split[1]); } } } diff --git a/src/TokenResolver.php b/src/TokenResolver.php index 9428f4f..88225a2 100644 --- a/src/TokenResolver.php +++ b/src/TokenResolver.php @@ -122,8 +122,7 @@ class TokenResolver implements TokenResolverInterface { $resolved_string = str_replace(array_keys($replacements), array_values($replacements), $text); // Replace <br /> occurrences with newlines. - $resolved_string = preg_replace('|<br />|', ' -', $resolved_string); + $resolved_string = preg_replace('|<br />|', "\n", $resolved_string); // Apply transformation replacements. if (isset($options['replacements'][$resolved_string])) { -- GitLab