Forum:Spacing when there are multiple transaction types

From Fallen London Wiki
Forums: Index > Feedback and Suggestions > Spacing when there are multiple transaction types

Spacing when there are multiple transaction types[edit]

When a page using Template:Item has multiple non-empty returns from Template:Transaction, the resulting string is written in one line with no spaces between. For an example, see Well-Placed Pawn, where we see the text, "It cannot be bought or sold at The Echo Bazaar!.It can be purchased from..."

One simple fix would be to place a space at the end of each Template:Transaction call in Template:Item. HTML collapses multiple spaces into one space, and drops any trailing space. - Stelio (talk) 13:02, 12 January 2024 (UTC)

Thanks for pointing it out. FYI, the reason for this is slightly more arcane.

If you can buy something for items, the first thing Template:Transaction does is setting a category for the loss of said item (in this case, Category:Rat-Shilling Loss). Categories, however, gobble up all the whitespace around them (which makes sense if they are at the end of an article, but not so much if they are inserted between "normal" text). So no matter how much space you put around the Transaction calls, it all gets collapsed into an empty string (and not into one space as HTML would do).

You can see this by going to Special:ExpandTemplates and putting {{:Well-Placed Pawn}} in the input.

I am not sure how to fix this; I know I researched the issue at some point, but I don't think I ever came up with a solution. RagCall (talk) 14:59, 17 January 2024 (UTC)
Oh, yeah! That's interesting.

A little playing around shows that if you have a line break between the category and the text following it, the collapsed text resolves to a space as required. Possible solution? You're better placed to work out whether that will break anything else. Stelio (talk) 14:08, 23 January 2024 (UTC)