12

It is quite common (especially in the single-word-request tag) to want an "empty field" for example phrases:

"Having children of my own ________ me"

Since markdown uses underscores for formatting, it has a tendency to eat up or mess with underscores. However, as you can see, if you use enough underscores, a few will still get through, but the result is a bit "choppy".

I wasn't sure which tags to use: is there any way around this problem (discussion), or is it possible to change the parser to treat a string of 3+ underscores as plaintext instead of trying to format it (feature-request)?

18

The best solution is to escape the underscore with the backslash. Using a backslash forces the following character to be used literally rather than as part of Markdown formatting:

\_\_\_\_\_\_
______

You could also use code formatting (with backticks), which is always literal, but that also adds a grey background which may not be universally liked.

______

Click Edit below to see how this post is formatted. If you can't do that, here's a picture:

Image of edit window

  • 1
    The source can't be viewed: "Suggested edits are not allowed on non-tag-wiki posts on meta sites." – IQAndreas Jan 21 '14 at 9:09
  • 2
    I didn't realise that. I've added a picture. – Andrew Leach Jan 21 '14 at 11:23
  • Oh, for Pete's sake. This is why I only use HTML when I write questions and answers. Markdown assumes too many things about too many things. – phenry Jan 24 '14 at 21:18
  • I thought the use of backticks for emphasis was discouraged on SE sites – toryan Jan 29 '14 at 19:38
  • @toryan It is, which is why I mentioned "may not be universally liked". In this case, it's not emphasis, it's providing a space which looks like a form field. Backslashes are definitely better. – Andrew Leach Jan 29 '14 at 19:43
3

The gray box produced by <code> tags / backticks might even be turned into an advantage:

"Having children of my own <code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</code> me" 
  • "Having children of my own             me"

or, perhaps more simply:

"Having children of my own `...........` me" 
  • "Having children of my own ........... me"

(Somehow, the dots look a lot nicer than underscores in combination with the box, at least IMO.)

Yes, I realize that this is kind of abusing the markup, but honestly, how often do you see real code on ELU?

  • I'm a bit disturbed that <code> doesn't stop entities from being interpreted. Is that not a bug? – Andrew Leach Jan 22 '14 at 18:57
  • 1
    @AndrewLeach: I'm pretty sure it's deliberate: backticks do disable entities, but HTML tags like <code> don't. – Ilmari Karonen Jan 22 '14 at 18:59
  • Indeed, not a bug but a feature, IMO. Over on StackOverflow, <code> tags are often the only way to demonstrate exactly the content in question. – jbeldock Jan 27 '14 at 3:57
-1

The closest solution I have found is using ASCII character 242 since it isn't parsed by Markdown, but in some fonts, it shows up as double underscores:

"Having children of my own ‗‗‗‗‗‗‗‗‗‗‗‗‗‗ me"

  • 7
    That's not an ASCII character; it's an "extended ASCII" character that only has the value 242 on Windows machines. Its proper (i.e., Unicode) value is U+2017. – jwodder Jan 23 '14 at 20:31

You must log in to answer this question.

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