Skip to content

🐛 Fix trailing separator in string_links for single-value fields#1718

Open
floroks wants to merge 1 commit into
useblocks:masterfrom
floroks:fix/string-links-trailing-separator
Open

🐛 Fix trailing separator in string_links for single-value fields#1718
floroks wants to merge 1 commit into
useblocks:masterfrom
floroks:fix/string-links-trailing-separator

Conversation

@floroks

@floroks floroks commented May 29, 2026

Copy link
Copy Markdown

The separator condition used len(data) which refers to the original string length instead of len(data_list) which is the split list. This caused a trailing "; " to always appear after single-value fields when needs_string_links is configured.

Added a regression test that verifies single-value string_links fields render without a trailing separator.

--
Florian Roks <florian.roks@mercedes-benz.com>, Mercedes-Benz Tech Innovation GmbH
Provider Information

@floroks floroks force-pushed the fix/string-links-trailing-separator branch from c5f79e9 to ad03c33 Compare May 29, 2026 11:22
@ubmarco

ubmarco commented May 29, 2026

Copy link
Copy Markdown
Member

May I ask for a test?

@floroks floroks force-pushed the fix/string-links-trailing-separator branch from ad03c33 to 2a79acd Compare May 29, 2026 17:01
@floroks

floroks commented May 29, 2026

Copy link
Copy Markdown
Author

May I ask for a test?

added a test, not sure if the test documentation referring to the original issue is acceptable, or a new issue should be created. the test however fails if the code is reverted, so it seems to be working perfectly fine.

another future extension could be making the separator configurable, not a huge fan of the semicolon

@floroks floroks force-pushed the fix/string-links-trailing-separator branch from 2a79acd to c4906c1 Compare June 1, 2026 08:33
@floroks floroks force-pushed the fix/string-links-trailing-separator branch from c4906c1 to 8c4e2c8 Compare June 8, 2026 11:08
@floroks floroks force-pushed the fix/string-links-trailing-separator branch 2 times, most recently from 002e616 to 4e735d3 Compare June 18, 2026 07:13
@floroks

floroks commented Jun 18, 2026

Copy link
Copy Markdown
Author

pipeline build failures don't seem to be related to this MR

When a string_links field contained a single value, a trailing separator
"; " was incorrectly rendered because len(data) checked the string
length instead of the list length. Changed to len(data_list).

Added a regression test that verifies single-value string_links fields
render without a trailing separator.
@floroks floroks force-pushed the fix/string-links-trailing-separator branch from 4e735d3 to 35afd4b Compare June 18, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants