Sunday, May 10, 2009

HTML problems in Blogging

Yesterday a post I made to my other blog included quite a bit of CLI code. Now when I tried the various commands individually from the original source, all worked perfectly.
So, I published.
Luckily, I tried the commands again today but this time I copied from my blog. Guess what? They didn't work.
The problem turned out to be that neither ["] nor ['] (basically the quote marks between the square brackets) weren't recognized as such.
However, all is explained in this article about HTML code.
In essence, I had to replace ["] by ["] and ['] by [']. so that

# curl -s myip.dk | grep '"Box"' | egrep -o '[0-9.]+'

became
# curl -s myip.dk | grep '"Box"' | egrep -o '[0-9.]+'

Now they all worked.

In Wordpress, the unsubstituted quote marks are decidedly slanted so it's easy to distinguish between them.
Incidentally, it seems that when I edited one of the CLI commands but not the others (as they had already been edited as described) the previously edited commands no longer worked. So, seems you need to edit everything at one go.
Hmmm, complicated.

No comments:

Post a Comment