Board Thread:Support Requests - Getting Technical/@comment-653063-20150218021309/@comment-4189499-20150306013859

MediaWiki templates are one of the few "coding languages" (if it can be called that) I've come across (which is, admittedly, a limited sample size) which don't ignore white space, so you can be forgiven for making mistakes like that. The space-at-the-begining-of-a-line=pre thing does seems to be a bit unnecessary, especially as it doesn't even do the job of a proper pre. It's designed I guess to make writing single lines of code for demonstrative reasons easier, but with the space in front, it still parses the code, eg: Links are written like this: help:links Links are written like this: help:links So in the end it's a fairly useless function which often renders people's messages unreadable if they accidentally put a space at the beginning of the first line, as text inside the box generated from a line starting with a space doesn't wrap.
 * Space in front:
 * Pre tags

You want to know the best way to avoid this problem? Use proper HTML tags instead of wiki tags for structural things such as tables, as HTML ignores whitespace, and if you have to spread out parser functions for readability, put a line break before the pipes separating arguments. That should minimise the problems created by white space in templates. How are you supposed to learn this? Well, if not the forums, trial and error and staring at what other people have done. Hmm, maybe somebody should create a Help:Whitespace...