Dec. 6th, 2022
<br><br>
How to get your life back while formatting logs!THE FIX
Do you ever feel like you're swimming in HTML line breaks when you're posting starters, logs, or long bodies of text in applications? Is it annoying? Tedious? Do you wish you were doing something else? ...is that a new gray hair??Trust me, I get it, and I'm here to show you how to avoid this issue forever going forward. There is a hack out there for doing the same thing by stopping and re-starting your
<lj-raw>
tags around the log content, and that works just as well, but semantically it's pretty iffy—and, of course, it only works in journal entries on sites like IJ and DW, so if you're dying while doing custom HTML pages and the like, this will save you there too.Now then, let's move on to the death of
<br><br>
in our log text.THE BREAKDOWN
<lj-raw>
<section style="styling:here;styling:here;styling:here;">
Whatever thread header coding you're using
</section>
<lj-cut><section style="styling:here;styling:here;styling:here;">
<span style="white-space:pre-line;">You'll put your log text here.
Only the text content, not the coding, and you want it to sit directly inside the span with no line breaks at the start and end.
This is because of what we're using this styling to achieve: Line breaks without HTML needed. So not putting the start/end text right up against the span brackets would cause unwanted extra line breaks.</span>
</section></lj-cut>
</lj-raw>
So, in simplest terms, here's what we're doing:<span style="white-space:pre-line;">Yes</span>
And no extra whitespace before or after the text:
<span style="white-space:pre-line;">
No
</span>
<span style="white-space:pre-line;">
Also no
</span>
THE CODE
All you need is:<span style="white-space:pre-line;">Your_Log_Content</span>
You're all set! Drop that into whatever code you're using where you would normally put your log content, and you're good to go. The simplest, cleanest way to get out of needing to use HTML for your line breaks.