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

I added a comment to Jquery ID Selector Not Working but something strange is happening. The end code reads "); but SO decided to change that to ";);.

screenshot

I did not add a ; in front of ).

share|improve this question
2  
Always write code between ` ` (backtick) –  Alpine Mar 19 '11 at 13:18
    
$("img[id=Char_" + Character + "]").attr("src", "image.xboxlive.com/global/t.584108a4/tile/0/2800d"); could not recreate –  Alpine Mar 19 '11 at 13:21
    
$("img[id=Char_" + Character + "]").attr("src", "image.xboxlive.com/global/t.584108a4/tile/0/2800d"); could not re-create with link –  Alpine Mar 19 '11 at 13:28
    
@alpine Though I agree with you, some people don't have back tick on their keyboard. Can you reproduce this on the same post jao posted to, to make sure there aren't differences in comment markdown between meta and SO? –  Adam Davis Mar 19 '11 at 13:39
    
@Adam Davis Yes, could not re-create on the same post –  Alpine Mar 19 '11 at 14:23
    
@Adam There's a "code sample" button above the editor too –  Michael Mrozek Mar 19 '11 at 15:44
    
What i did was, I copied the string from the original post, then pasted it into the comment box (where it looked okay) $("img[id='Char_" + Character + "']").attr("src", "image.xboxlive.com/global/t.584108a4/tile/0/2800d"); but now it does the same thing here. it probably is some funny character replacing thing –  jao Mar 19 '11 at 15:49
1  
@Michael We're talking about comments, and as far as I can see there's no buttons above the comment edit box... –  Adam Davis Mar 19 '11 at 16:38
    
While I can't reproduce the issue with the given example line of code, it's easy to reproduce with balpha's example below: "http://xyz.com/a/b/c" --> "xyz.com/a/b/c"; So the bug is valid, although users really should be putting code into backticks, as has been discussed before some users don't have backticks on their keyboard, and thus far Stack Exchange has chosen not to implement another method of adding code blocks into comments. It would seem that either Stack Exchange should fix this bug or add another method to delineate code blocks in comments. –  Adam Davis Mar 19 '11 at 16:48
    
@adam define "some people don't have backtick on their keyboard". Maybe some people have no letters on their keyboard, either? –  Jeff Atwood Jan 15 '12 at 2:42
1  
@JeffAtwood meta.stackexchange.com/questions/61235/… –  Adam Davis Jan 15 '12 at 17:51

2 Answers 2

To explain what happens here:

"http://xyz.com/a/b/c"

is turned into

"http://xyz.com/a/b/c"

The auto-linker sees this as a link to http://xyz.com/a/b/c&quot, so the semicolon is left over, and that's where it suddenly appears from.

Granted, this is isn't exactly the expected result.

share|improve this answer
    
Interesting. "http://xyz.com/a/b/c" does show this issue: "xyz.com/a/b/c"; It's odd that we can't reproduce it with his code line though... –  Adam Davis Mar 19 '11 at 16:46
    
"xyz.com/a/b/c" –  Alpine Mar 19 '11 at 16:51
    
"xyz.com/a/b/c"; –  Alpine Mar 19 '11 at 16:52
    
Now I can see ; –  Alpine Mar 19 '11 at 16:53
    
$("img[id=Char_" + Character + "]").attr("src", "image.xboxlive.com/global/t.584108a4/tile/0/2800d"); –  Alpine Mar 19 '11 at 16:55
    
Wouldn't it make sense to have the auto-linker not even try to create clickable links when the http part is not preceded with some whitespace? On the other hand, maybe punctuation such as preceding dots, commas, and... semicolons, still needs to be allowed then, as some don't properly type a space after those, like:example.com And when allowing those, the semi-colon in the preceding " would still trigger the auto-linking. –  Arjan Mar 3 '12 at 13:45

I was able to reproduce it

We were trying

$("img[id=Char_" + Character + "]").attr("src", "image.xboxlive.com/global/t.584108a4/tile/0/2800d");

But as jao said in the comments

What i did was, I copied the string from the original post, then pasted it into the comment box (where it looked okay) $("img[id='Char_" + Character + "']").attr("src", "image.xboxlive.com/global/t.584108a4/tile/0/2800d";); but now it does the same thing here. it probably is some funny character replacing thing – jao

The code that jao is copy / pasting is

$("img[id=Char_" + Character + "]").attr("src", "http://image.xboxlive.com/global/t.584108a4/tile/0/2800d");

As balpha demonstrated in an example

"http://xyz.com/a/b/c"

is turned into

"http://xyz.com/a/b/c"

The http:// in the link is the key

Try the code with http:// and see

share|improve this answer

You must log in to answer this question.

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