|
ticket id 000049 |
status closed |
priority ??? |
assigned to NOBODY |
Reported by: Jason Ford Component: |
If you create a reference to a URL, but don't define it later, you get an unclosed anchor tag. It seems that desired behavior would be for the link to be ignored.
Here's the code that gave me trouble
Django's support for [CouchDB][] (another technology we are using with FeedMagnet) is a good example of this.
The problem was that I never defined CouchDB like this
[CouchDB]:
Forgetting to define the link reference can happen on accident fairly easily if your text has a lot of links in it. If this scenario occurs, I would think the desired HTML output would be:
Django's support for [CouchDB][] (another technology we are using with FeedMagnet) is a good example of this.
or maybe even drop the brackets all-together to fail more gracefully:
Django's support for CouchDB (another technology we are using with FeedMagnet) is a good example of this.
But instead, I got this:
Django's support for [CouchDB]<a href="another technology we are using with FeedMagnet" /> is a good example of this.
In Safari, this doesn't look so bad - but in Firefox (and possibly other browsers) this results in the rest of the page being a link to nowhere, since there is no closing anchor tag. This seems to be a bug since one of the primary reasons (at least from my perspective) in using Markdown, is to prevent accidental HTML syntax errors like the unclosed anchor tag this scenario is generating.
Comments
By Waylan on Nov 16, 2009:
What version of Python-Markdown are you using. I can't seem to reproduce this on the most recent version (2.0.3). Note:
>>> import markdown
>>> markdown.version
2.0.3
>>> markdown.markdown('Foo [bar][] baz.')
u'<p>Foo [bar][] baz.</p>'
>>> markdown.markdown('Foo [bar][] baz.\n\n[bar]: http://example/com')
u'<p>Foo <a href="http://example.com">bar</a> baz.</p>'
And just to make sure it wasn't the parentheses after the non-link that were triggering the problem:
>>> markdown.markdown('foo [bar][] (baz).')
u'<p>foo [bar][] (baz).</p>'
Resolution
wontfix