"Damn I Should've Done That Years Ago"(2): Formatting with HTML Source Codes

2018-11-17 2019-02-10 2020-11-06

Photo by Florian Olivo on Unsplash

I was an idiot when I first started to change the text style. My neurotic self hated the inconsistency of fonts, formats and styles. At one point I remember manually spacing the paragraphs by pressing enter for every paragraph. Luckily, it didn’t take me long to think, ”Do I really have to do it this way?” I looked at the source codes and with some basic HTML knowledge, I could do what would take me 15 minutes in 30 seconds.

For example, you want to leave the HTML style, but it gets carried to new characters:


Press Ctrl + Shift + F6 to open up the HTML source code file and fix it there:


Save it and BOOM:


Another example. The spacing from your source could be messed up like this:

Spacing issue

Again, press Ctrl + Shift + F6. Simply find and replace all the unwanted tags.

Spacing issue_2

Now all paragraphs are nicely spaced. No more manual editing.

Spacing issue_3

For proper spacing (applicable for most cases):

1. Replace <BR> to <P> for consistency

2. Remove all empty tags like <P></P>, <DIV></DIV>, <BR></BR>

3. If you don’t like the ending whitespace, most of the reason is the .</DIV> code. So just simply press CTRL + H, Replace .</DIV> with .</P>. No more trailing whitespace.

4. Rinse your source through textpad before importing. This completely removes all formatting. Then remove all the empty tags to remove extra spacing.

Note: Sometimes, it doesn’t show but the HTML formatting can be really complicated. It takes a long time to load. I like to remove them.