View Single Post
Old 12-12-2008, 03:01 PM   #1
Snowman
Zealot
Snowman can teach chickens to fly.Snowman can teach chickens to fly.Snowman can teach chickens to fly.Snowman can teach chickens to fly.Snowman can teach chickens to fly.Snowman can teach chickens to fly.Snowman can teach chickens to fly.Snowman can teach chickens to fly.Snowman can teach chickens to fly.Snowman can teach chickens to fly.Snowman can teach chickens to fly.
 
Posts: 106
Karma: 3566
Join Date: Aug 2008
Location: London UK
Device: iPhone 5, Kindle K3, Kindle Voyage
Some horrible and outrageous examples of disgraceful coding

I tried to start a new [non-baen] sci-fi novel today, by an author I like. The previous ones in the series were very good. But the formatting was sufficiently bad on this one that it distracted me from my reading. So I ... um ... managed ... yes ... to extract the original html with a view to clean up the layout a bit.

Its usually quite easy to strip out the bad, and replace it with my preferred style. I normally make an initial couple of runs through 'html tidy' both to find potential problems, and to 'normalize' the html, thus making global edits easy.

This time however, 'tidy' laughed so hard that after chucking out nearly 5k warnings and errors it barfed.

Now I'm no html coder or design artist, I'm a sysadmin with scripting skills. However, when I took a closer look I thought that I would just have to share some examples of the mess that I found.

Why spoil a perfectly good ebook with this crap? ... (I've used a horrid color for the examples because they deserve it.)

Example 1 "How not to code":
<p class="tx"><div style="text-indent: 1em; text-align: justify"><font size="3">Paragraph text paragraph text</font></div></p>
  • One does not embed a <div> in a <p>, as any fule kno.
  • Why force justification and text size on me?
  • This layout formed most of the paras, hence the error count.
Example 2 "How not to achieve a line break":
<div style="margin-top: 1em"></div><p class="ls2"><div style="text-indent: ; text-align: center"><font size="5">&nbsp;</font></div></p><div style="margin-top: 1em"></div>
  • or to put it another way: <br><br> or possibly <br><br><br>
Example 3 "The Revolting Chapter Header":
<div style="margin-top: 3em"></div><p class="ctag1"><div style="text-indent: ; text-align: center"><font><span class="bold"><span class="italic">CHAPTER</span></span></font></div></p>
<p class="cn"><div style="text-indent: 4em; text-align: center"><font size="6"><span class="bold"><span class="italic">THREE</span></span></font></div></p><div style="margin-top: 4em"></div>
  • *Shudder*
  • And screaming the whole thing at me IN BOLD CAPS just makes it that much worse.
Example 4 "Continue to annoy your readers":
<div style="margin-top: 2em"></div><p class="cotx"><div style="text-indent: ; text-align: justify"><font size="3"><span class="dropcap"><font size="7"><span class="bold">T</span></font></span>ext para text</font></div></p>
  • This forces the first character of a paragraph to GIANT BOLD, and looks revolting.
  • I'm happy enough seeing a discrete drop cap, slightly enlarging the first word word of the first para in a chapter, or even capitalizing it. But this is beyond the pale. IMNSHO.
I've found some egregious html examples in a few other ebooks, but I think I have vented more than sufficient spleen for this post!

Snowman (with assistance from N. Molesworth, esq.)
----------------
Now playing on Winamp: Les Patineurs

Last edited by Snowman; 12-12-2008 at 03:03 PM. Reason: add to sig line
Snowman is offline   Reply With Quote