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
Copy link
Copy Markdown

@floroks floroks commented May 29, 2026

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
Copy link
Copy Markdown
Member

ubmarco commented May 29, 2026

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
Copy link
Copy Markdown
Author

floroks commented May 29, 2026

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

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 2a79acd to c4906c1 Compare June 1, 2026 08:33
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