Why do code blocks delete double-spaces? Double-spaces are required in some code. Code blocks should not alter the text in them at all, because code sometimes has weird formatting.

Example: compare the source of this to the rendered version: sudo apt-get remove $(dpkg -l|egrep '^ii linux-(im|he)'|awk '{print $2}'|grep -v `uname -r`); sudo apt-get upgrade

1 Answer 1


Really nothign to do with SE and everything to do with how browsers render <code> tags. Double spaces (and tabs, etc) are munched down into single spaces.

If you want a proper code block, use four spaces at the beginning of the lines. This wraps the <code> tag in a <pre> which makes the browser behave more literally:

sudo apt-get remove $(dpkg -l|egrep '^ii  linux-(im|he)'|awk '{print $2}'|grep -v `uname -r`); sudo apt-get upgrade

And your search is better represented by:

dpkg -l | awk '/^ii +linux\-(im|he)[a-z\-]+[0-9]/&&!/'"$(uname -r)"'/ { print $2 }'

A bit longer than yours but it won't remove meta-packages and hey, three commands, not five. It's still not perfect because in my situation, I've installed a new kernel but I'm not running on it yet. This sort of search would remove the newer kernel. Automating this stuff is dangerous.

  • By the way, putting 4 spaces there fails miserably, and doesn't create a code block. CTRL-K-ing only puts backticks around it. Commented May 27, 2013 at 17:26
  • @YetAnotherUser Click edit on my post to view the source of it. And/or see: meta.askubuntu.com/editing-help#code
    – Oli Mod
    Commented May 28, 2013 at 7:56
  • The edit button is grayed out. Commented Jun 12, 2013 at 19:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .