5

I was trying to follow the link to GitHub in this question:

What are some interesting features of the EveryBlock.com source code?

but it contained a percent-escaped underscore, though the source didn't. Escaping the link broke it (which may be GitHub's fault, but nevertheless...).

Specifically, the link should have been (and was written in the source as):

http://github.com/brosner/everyblock_code/tree/master

but was rendered as:

http://github.com/brosner/everyblock%5Fcode/tree/master

I couldn't figure out any way to fix the link so it worked (aside from sending it through a URL shortening service or similar). There's no need to escape _ in URLs; perhaps it could just be passed through. Or is there some way to do this?

6
  • I am interested in the ways how this bug can be solved. --- It seems that the problem is in the current browsers. Is there any solution to the problem?
    – Masi
    Jul 26, 2009 at 19:51
  • It looks fine to me.
    – mmyers
    Aug 5, 2009 at 21:06
  • 2
    the link seems to work now (and webservers that don't unescape are configured incorrectly) but see dlamblin's answer for alt forms Aug 13, 2009 at 4:26
  • It doesn't work for me on the original question, nor in dlamblin's comment below. Aug 30, 2009 at 1:59
  • Sorry Nicholas is right, It only appears to work in the preview but not when posting. I'll try it out in this comment: code.google.com/apis/ajax/playground/…
    – dlamblin
    Nov 12, 2009 at 18:53
  • As you can see, the link's _ is not changed to %5F in a comment, and therefore works. All the other underscore in URL threads have been (sadly) closed as by-design or declined. Personally I think it's annoying to expect the rest of the world to come around to decoding URLs instead of just letting the _ be.
    – dlamblin
    Nov 12, 2009 at 18:56

4 Answers 4

2

Using the original markdown.pl implementation:

echo "[a](http://example.com/test_ing)" | markdown.pl

..returns..

<p><a href="http://example.com/test_ing">a</a></p>

..as one would expect.

The showdown.js preview in the editor also does not escape the underscore, so the preview is different from the final result..

Thus I'm fairly sure it's correct to blame this on a bug in the SO markdown renderer..

2
  • Now if only I can convince TPTB of that... Oct 24, 2009 at 16:12
  • @Nicholas Riley: Who/what do you mean by "TPTB"?
    – dbr
    Oct 24, 2009 at 17:41
1

If you used the ctrl+L part of the provided editor it would work.*****

It would end up looking like this:

If you used the ctrl+L part of the provided editor it would [work][1].


  [1]: http://github.com/brosner/everyblock_code/tree/master

*Update This is once again a difference between previewing and posting. It does not work, but appears to in the preview.

For a different example of a URL that does not decode %5F into _ and therefore breaks look at: http://code.google.com/apis/ajax/playground/?type=visualization#column_chart

1
0

I ran into the same issue with a link with underscores.

Now this is weird. I'm trying to replicate the issue here (using the link button or ctrl + L) and am not able to. Is meta running a different version of the editor than SO?

Anyway, I worked around it by using a href.

-1

I believe it invalidates the markup if there is an underscore. Same with an ampersand.

You must log in to answer this question.

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