WordPress and PRE elements

I wonder if WordPress.com supports PRE elements properly (unlike all other WP versions)…

export d=$(date +'%Y-%m-%d') mkdir -p backup/$d for i in `echo "show tables" | mysql -uusername -ppassword database|grep -v Tables_in_`; do 	echo Backing up $i... 	mysqldump --add-drop-table --allow-keywords -q -a -c -uusername -ppassword database $i > backup/$d/$i.sql done echo 0m6, d0n3! ph34r my 1337 b4kcUp sk1ll2!!1

It doesn’t. Tsk.

5 Responses to “WordPress and PRE elements”

  1. Mathias Says:

    The data in between PRE tags is stored in the database as a one-liner, and every instance of " suddenly turns into its escaped version (\").

    How come? Could this be caused by the wpautop() function? I always thought WordPress stored posts as unformatted data by default…

  2. Oliver Zheng Says:

    I think WordPress displays it properly. I look a look at the source code – everything seems to be in order. The reason it’s sticking out like that probably has something to do with the theme. If the CSS had defined the pre tag to be a certain width, then this wouldn’t happen.

  3. Mathias Says:

    No it doesn’t. Did you read the above comment?

    The data I put inside the PRE element can be viewed as a text file by clicking here. (This code sample is taken from my article on creating and restoring MySQL backups using the command line, in case anyone was wondering.)

    See how it’s fucked up?

  4. Oliver Zheng Says:

    Ah so that’s the intended output.

  5. Mathias Says:

    Indeed. You can try it out on your own blog, I’m quite sure it won’t work over there either.

Leave a Reply