Links in [link text][number] format don't work properly if they follow a tag using the new [tag:tagName] format. Here's the result of [tag:python] [gold badge page][1]:

[gold badge page]1

Putting the tag inside the link is worse. Here's the result of [[meta-tag:bug] some text][2], where [2] is google.com:

some text

The part of the link outside the tag just disappears silently.

EDIT:
To be more precise, the entire link to [2] disappears. The markup that is produced contains (invalid) nested anchor tags, as shown here from Firefox's "View Source":

<a href="http://google.com" rel="nofollow"><a href="/questions/tagged/bug" class="post-tag required-tag" title="show questions tagged 'bug'" rel="tag">bug</a> some text</a>

So the tag is still a link, but it is a link to the tag page, which is the behavior it would have if the link to [2] didn't exist at all. The user's desired behavior in this case is... ambiguous, to be charitable.

EDIT 2:
I briefly included markup from Firebug here, but it turned out to be irrelevant. It has now been removed to improve readability. See the revision history if you're interested.

share|improve this question
1  
the link disappears completely actually. –  jjnguy Nov 19 '10 at 14:40
    
@jjn, yeah, word choice on my part... I didn't want to say that the tag link disappeared, because it didn't... I'll edit. –  Pops Nov 19 '10 at 15:30
add comment

2 Answers

up vote 8 down vote accepted

The <a>[tag:name]</a> generating bad html is mildly annoying, even if I don't really think its a valid use case. I've gone ahead and checked in a fix to dev (we just won't process the tag syntax if it appears in an anchor tag).

The [tag] [text] [index] is actually by design. The markdown spec allows a space between a link's text and its "index." Its kind of a goofy use case, but its in there.

Markdown Link Spec

You can optionally use a space to separate the sets of brackets:
This is [an example] [id] reference-style link.

share|improve this answer
5  
it's a totally goofy use case. I didn't even know that was supported! –  Jeff Atwood Nov 19 '10 at 23:15
add comment

Case 1 can be worked-around by inserting two spaces after [tag:python].

[tag:python]  [gold badge page][1]

gold badge page

share|improve this answer
    
as Kevin pointed out this is because the markdown spec allows a space between [link title][1] .. much to my surprise. –  Jeff Atwood Nov 19 '10 at 23:16
add comment

You must log in to answer this question.

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