Substitution

edit

Terasail, thank you for developing template {{Respond}} and applying it to relevant templates (example). Templates in the Category:Image with comment templates seem like people might want to substitute them sometimes. Should usages of {{Respond}} be prepared for substitution? —⁠andrybak (talk) 20:55, 9 March 2023 (UTC)Reply

As an example, Template:Done, one of the most popular such templates, uses safesubst for this reason. —⁠andrybak (talk) 20:57, 9 March 2023 (UTC)Reply
I added it, thanks for the note. Terasail[✉️] 02:10, 10 March 2023 (UTC)Reply

Template-protected edit request, January 16, 2026

edit

Non-breaking spaces don't work as expected after images — compare the wrapping behavior of this template with {{not done}} in my sandbox.

<includeonly>[[File:{{{{{|safesubst:}}}#switch:{{{1|{{{icon|}}}}}} |{{{1|{{{icon|Pictogram voting question.svg}}}}}}}}|{{{size|18px}}}|alt={{{alt|}}}]]'''&nbsp;{{{2|{{{text|Response}}}}}}'''</includeonly><noinclude>
+
<includeonly><span class="nowrap">[[File:{{{{{|safesubst:}}}#switch:{{{1|{{{icon|}}}}}} |{{{1|{{{icon|Pictogram voting question.svg}}}}}}}}|{{{size|18px}}}|alt={{{alt|}}}]]''' </span>{{{2|{{{text|Response}}}}}}'''</includeonly><noinclude>

TechnoSquirrel69 (sigh) 05:54, 16 January 2026 (UTC)Reply

This appears to be a browser difference. Firefox implements the expected behavior. Izno (talk) 16:50, 16 January 2026 (UTC)Reply
 Done, except with the closing /span in the right place. Please make changes in the sandbox and test them before creating an edit request. (P.S. to Izno; it is possible that you tested after I changed the template. The text was wrapping for me in Firefox.) – Jonesey95 (talk) 16:51, 16 January 2026 (UTC)Reply
@Jonesey95: The placement of the closing tag wasn't a mistake. The intent was to make just the space between the image and text non-breaking, rather than the entire second parameter (since that can be made arbitrarily long based on user input, potentially causing wrapping issues). TechnoSquirrel69 (sigh) 17:04, 16 January 2026 (UTC)Reply
It looked like an error, since you referred to {{not done}} and had not tested your edits in the sandbox. Lacking test cases, I referred to that template for guidance on the syntax. As always, please demonstrate your changes in the /sandbox and on the /testcases page, as the edit notice for template-protected edit requests clearly asks editors to do (Be specific; say exactly what you would like to be changed. If applicable, create or replace the sandbox with a copy of the current template, apply the edit there and create some test cases that demonstrate it.). You are welcome to do that now if you want further changes. – Jonesey95 (talk) 17:18, 16 January 2026 (UTC)Reply
Yeah, I could have been more clear, in retrospect. I didn't feel the need to sandbox this change as I've already used this kind of markup on templates like {{DCWC participant}}, where it's worked well. Anyways, I've sandboxed it now, and you can see the difference in behavior at Template:Respond/testcases § Test case very long text, which you created earlier this morning. Thanks for bringing up the difference with {{not done}} — I actually hadn't noticed that, and I'll check through the rest of the template family and request changes where necessary. I've reactivated the edit request. TechnoSquirrel69 (sigh) 21:02, 16 January 2026 (UTC)Reply
 Done, after adding a relevant test case and fixing a misnested tag error in the sandbox. Please do add test cases that demonstrate the thing you are trying to fix. – Jonesey95 (talk) 21:36, 16 January 2026 (UTC)Reply
I had to restore my original change. The new version was causing too many Linter errors, described at mw:Help:Lint_errors/tidy-whitespace-bug. People will just have to be concise with their custom text. – Jonesey95 (talk) 01:00, 18 January 2026 (UTC)Reply