address-format icon indicating copy to clipboard operation
address-format copied to clipboard

Remove %n in front and back of string

Open jmslbam opened this issue 1 year ago • 2 comments
trafficstars

So if RECIPIENT or ORGANIZATION are not filled or empty, then this results in only a STREET_ADDRESS that's prefix with an %n which will be replace by a <br> which results in an address that's starts a line lower then needed.

Fixes #23

jmslbam avatar Sep 15 '24 21:09 jmslbam

@adamlc, Ah yes I see that now. As it's not related to the scope of this issue, shall I update them in a different branch so those can be merged first before proceding with this PR's.

The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3, actions/cache@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/

Looks like we be needing actions/checkout@v4.

jmslbam avatar Sep 16 '24 09:09 jmslbam

I'll be honest I haven't used this library or php for years, but it looks like the unit test is actually broken.

1) FormatTest::testDeAddressFormat
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
 'Eberhard Wellhausen\n
 Wittekindshof\n
 Schulstrasse 4\n
-32547 Oyenhause'
+32547 Oyenhausen'

The final n is being trimmed off the address, which could mean that it is related to this change.

adamlc avatar Sep 17 '24 10:09 adamlc

I'll be honest I haven't used this library or php for years, but it looks like the unit test is actually broken. The final n is being trimmed off the address, which could mean that it is related to this change.

Sorry for the slow response, new dad here :)

You're right, I updated the PR and also added a test for this scenario 👍

jmslbam avatar Jan 10 '25 13:01 jmslbam

Amazing thanks for all your work @jmslbam

adamlc avatar Jan 14 '25 08:01 adamlc

@adamlc you're welcome! Thank you for the initial work of the package!

jmslbam avatar Jan 14 '25 12:01 jmslbam