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

Consider the following text

<code>[Collections#sort][1]</code>

[1]: http://java.sun.com/j2se/1.4.2/docs/api/java/util/Collections.html#sort(java.util.List, java.util.Comparator)

It does render correctly on preview, but incorrectly once saved. See http://stackoverflow.com/questions/2455448/sorting-and-re-arranging-list-of-hashmaps/2455497#2455497 for this example in real life

share|improve this question
    
    
Confirmed. I've tried to fix it, but to no avail. –  fretje Mar 16 '10 at 15:32
    
Apparently the problem was with the url, and not with the <code></code> part. Encoding the space did the trick (see o.k.w's answer ==> meta.stackexchange.com/questions/42414/markdown-rendering-bug/…) –  fretje Mar 16 '10 at 15:36

2 Answers 2

up vote 4 down vote accepted

The problem is the space which breaks the URL. Try the url encoded one like:
sort(java.util.List%2C+java.util.Comparator)
instead of
sort(java.util.List, java.util.Comparator)

You can also use backticks ` for inline codes.

E.g.:

Notice that, if you want to change sort algorithm during list usage, you can instead use Collections#sort.

Source:

Notice that, if you want to change sort algorithm during list usage, 
you can instead use [`Collections#sort`][1].

[1]: http://java.sun.com/j2se/1.4.2/docs/api/java/util/Collections.html#sort(java.util.List%2C+java.util.Comparator)
share|improve this answer
1  
Oh, indeed, encoding the space to %20 did the trick! –  fretje Mar 16 '10 at 15:35
    
@fretje, yea the 'evil' spaces... –  o.k.w Mar 16 '10 at 15:38
    
@o.k.w:whoneedsthemanyway? –  fretje Mar 16 '10 at 15:40
    
Wow, thanks for the reply and the fix in my answer (didn't even know you could do that !) –  Riduidel Mar 16 '10 at 15:55
    
@Riduidel: see the bottom part of the faq (stackoverflow.com/faq): Other people can edit my stuff?! Like Wikipedia, this site is collaboratively edited, and all edits are tracked. If you are not comfortable with the idea of your posts being edited by other trusted users, this may not be the site for you. –  fretje Mar 16 '10 at 16:37

As of recently, when entering a link via the button (or Ctrl-L), the characters will automatically be escaped, so this is the safest way.

share|improve this answer

You must log in to answer this question.

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