Contents

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

Contents

Photo by Florian Olivo on Unsplash

Introduction

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:

./images/carried_away.png

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

./images/carried_away_2.png

Save it and BOOM:

/2019-02-10-damn-2-formatting-with-html-source-codes/images/carried_away_3-1.png

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

./images/spacing-issue.png

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

./images/spacing-issue_2.png

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

./images/spacing-issue_3.png

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.