Quantcast

Tumblr’s post editor doesn’t have a <code> button, but the monospaced typewriter font looks nice both in the dashboard and on my blog.

Both Linux and Mac OS X have a terminal or command-line which hooks into decades-old unix commands for processing plain text.

  1. xsel -ob > the-post-im-working-on
  2. sed -i.′bak s#strike>#code>#g the-post-im-working-on
  3. xsel -ib < the-post-im-working-on

Or, cut out the intermediate steps of making a file and backing it up:

  • xsel | sed s#strong>#code>#g | xsel -ib

In Mac OS X it would be

  • pbpaste | sed s#strike>#code>#g | pbcopy

You may need to escape the > symbol to \> like this:

  • xclip -o | sed s#strike\>#code\>#g | xclip -i

You could also just search for s/strike/ rather than s!strike>!. But that would catch the actual word “strike” if you used it in your writing. (This is more of an issue if you use <em> or <strong> as demarcators. I do that when I want to insert <small> or <big> tags.) Whereas strike> catches either <strike> or </strike> only. (Especially since < and > are encoded as &lt; and &gt; if they’re used in text—so the > is really mostly likely to only catch HTML tags.)

I don’t know if this can be done in Windows PowerShell. It either can’t be done in a GUI at all, or it would be more cumbersome to do in standard point-and-clicks.

12 notes

  1. syntaxcoloring said: Why not just use the Markdown editing feature?
  2. isomorphismes posted this