User talk:Jimyoda/Whitespace in Template:VersionFrame/reply (4)
After some experimenting I had some success.
There are at least three methods to eliminate the extra line breaks.
1 - Remove all the carriage returns within the code itself. It's effective, but not very readable or easily edited when you have a series of IF statements in a single (window-wrapping) train. So not a good solution.
2 - Consolidate the each section's pair of IF statements into one, thereby reducing the amount of natural carriage returns. That might have worked, but I didn't try.
3 - In each IF statement replace the 'value if empty' parameter with an actual null surrounded by single quotes. I saw that if you put ANY text, there was no line break. However, we don't want anything to show. The nbsp code to create a space works, but a null is even better.
I used option 3. It was very simple to implement and very effective.