What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 122 Stack Exchange communities.

I have an exception which contains backtick (`) characters. I can't find a way to escape the character from markdown so that I can show the message as normal text.

Exception marked as inline code with double backticks to preserve the singles in the content:
Unable to cast object of type '<JoinIterator>d__61`4[System.Data.DataRow,System.Data.DataRow,System.Int32,<>f__AnonymousType0`1[System.Int32]]' to type 'System.Collections.Generic.IEnumerable`1[System.Data.DataRow]'.

What happens if I don't do the above (markdown treats two of the three backicks as formatting commands):
Unable to cast object of type '<JoinIterator>d__614[System.Data.DataRow,System.Data.DataRow,System.Int32,<>f__AnonymousType01[System.Int32]]' to type 'System.Collections.Generic.IEnumerable`1[System.Data.DataRow]'.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

This happened to me a few days back. See this post and its comments.

I think the short answer was to choose between using <pre> tags or escaping the backticks with backslashes.

Here are some backticks in text with pre:

blahblahblah```foobar

Here are some backticks in memes with backslashes (it turns out this is another case of displays-right-in-preview-box-but-not-reality):
freehand circles```waffles!

Markdown for using pre:
<pre>blahblahblah```foobar</pre>

share|improve this answer
    
But if you use <pre>, you have to escape angle brackets. –  mmyers Dec 10 '09 at 15:17
    
Thanks. I could've sworn I tried escaping them before posting this though. Maybe I tried using the wrong slash.. –  Dan Neely Dec 10 '09 at 16:28
add comment

You could format it as a code block:

Unable to cast object of type '<JoinIterator>d__61`4[System.Data.DataRow,System.Data.DataRow,System.Int32,<>f__AnonymousType0`1[System.Int32]]' to type 'System.Collections.Generic.IEnumerable`1[System.Data.DataRow]'.

Although admittedly, with a single long line like this, it's not very easy to read.

share|improve this answer
    
Yeah. Making it inline code so that I at least got to keep the word wrapping was the least unpleasant option I could find. –  Dan Neely Dec 10 '09 at 14:00
add comment

You must log in to answer this question.

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