tumblr adding weird line breaks
I often do a sort of post stutter when submitting. That is, I edit it after submitting. Since I write most of each post in the HTML editor, I find it irksome when my code inside of <pre> tags gets full of empty lines when I go back to it. What I do is I open up the HTML editor in tumblr, and copy all of the HTML source into a text editor that supports find and replace using regular expressions. In my case, I use Smultron, a nice editor for Mac OSX. They say on the site it’s only compatible with Leopard (10.5), but they have a Tiger (10.4) version too. Then I open up “Advanced Find” (or whatever you might call your find and replace) and put ^\n in the “Find” field, and nothing in the replace, making sure to click the “Use Regular Expressions” checkbox. That regular expression finds beginnings of lines that are immediately followed by ends of lines, so it’s pretty usefull for cleaning enpty crap out of files. If you want lines that appear blank but may contain whitespace, I recommend: ^ *\n which finds any number (including zero) of spaces on the line. This does not count tabs, so you might want to check for that too.
For reasons unbeknownst, tumblr didn’t like me typing the regexs inside of <pre> tags, so just take everything inside of the quotes, and nothing outside. Also, I have no idea why all of my attempts to make this work in sed have come to naught.
