Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: DFtext template strips leading/trailing spaces  (Read 10821 times)

Ziusudra

  • Bay Watcher
    • View Profile
DFtext template strips leading/trailing spaces
« on: February 20, 2021, 06:47:40 pm »

An example can be seen with the caption for the image on the Combat page.

This can be worked around by replacing leading/trailing spaces with the HTML entity  .

Should we do that or look into changing the template to not strip them? Or something else?
Logged
Ironblood didn't use an axe because he needed it. He used it to be kind. And right now he wasn't being kind.

lethosor

  • Bay Watcher
    • View Profile
Re: DFtext template strips leading/trailing spaces
« Reply #1 on: February 20, 2021, 07:14:13 pm »

Bah. This happened recently because I changed the template recently to add a new parameter, and added an "#if" call in the process, which strips leading/trailing whitespace from its parameters. This page has some solutions, and of these, I think using <nowiki/> is the clearest, so I'll try that.

As a side note:
- Discussions related to individual pages fit best on the corresponding talk page, and are easier to find there as well.
- I would generally recommend against raw numeric entities like "&#32;" for maintainability reasons. If an entity is necessary, something like "&nbsp;" is fairly well-known and easier to understand without having to look it up every time. (In this case, it's not the same as a space, though, but in some situations it can work.)
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

lethosor

  • Bay Watcher
    • View Profile
Re: DFtext template strips leading/trailing spaces
« Reply #2 on: February 22, 2021, 06:13:30 pm »

Forgot to reply - it looks to me like the fix is working now. Thanks for the report, and let me know if something's still not looking right!
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.