rtrim when converting text tokens to html to avoid trailing newlines
authorlarssandergreen <lars@wildsight.ca>
Thu, 7 Sep 2023 03:23:11 +0000 (21:23 -0600)
committerlarssandergreen <lars@wildsight.ca>
Thu, 7 Sep 2023 03:23:11 +0000 (21:23 -0600)
Civi/Token/TokenRow.php

index abaedda56eb81f737307ce046383eb46791ca592..dbe2a5ad8e686cda5dbb6bbed281a78ae36b313c 100644 (file)
@@ -286,7 +286,7 @@ class TokenRow {
                 $htmlTokens[$entity][$field] = \CRM_Utils_String::purifyHTML($value);
               }
               else {
-                $htmlTokens[$entity][$field] = is_object($value) ? $value : nl2br(htmlentities($value, ENT_QUOTES));
+                $htmlTokens[$entity][$field] = is_object($value) ? $value : rtrim(nl2br(htmlentities($value, ENT_QUOTES)));
               }
             }
           }