Opened 12 years ago

Closed 12 years ago

#425 closed defect (fixed)

Markdown Links in media description broken for media/dokuwiki targets

Reported by: chrono Owned by: Jakob Kramer
Priority: major Milestone:
Component: programming Keywords:
Cc: Parent Tickets:

Description

Links to media- or dokuwiki pages are broken when using markdown syntax and turn out empty, probably due to the ":" namespace separator.

Reproduce Example:

markdown in description field:

[Odyssey](https://apollo.open-resource.org/mission:tech:odyssey)

turns into:

<p><a href="">Odyssey</a> </p>

As there currently is no other way to place links for more information, I would consider it a major defect :)

Change History (12)

comment:1 by Jakob Kramer, 12 years ago

The development version of “Python-Markdown” supports colons in hrefs already.

comment:2 by Christopher Allan Webber, 12 years ago

Component: component1programming

I wonder if this is a python-markdown issue or a lxml.html.clean() issue?

in reply to:  2 comment:3 by Jakob Kramer, 12 years ago

python-markdown

comment:4 by Christopher Allan Webber, 12 years ago

Markdown 2.2.0 came out but things still seem broken on this... not sure what next steps are.

I checked... this isn't our cleaning utility, it's markdown itself:

cwebber@grumps:~/devel/mediagoblin$ ./bin/python
Python 2.7.3rc2 (default, Apr 22 2012, 22:35:38)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from mediagoblin.tools.text import MARKDOWN_INSTANCE
>>> MARKDOWN_INSTANCE.convert("[Odyssey](https://apollo.open-resource.org/mission:tech:odyssey)")
u'<p><a href="">Odyssey</a></p>'
>>> import markdown
>>> markdown.__file__
'/home/cwebber/devel/mediagoblin/local/lib/python2.7/site-packages/Markdown-2.2.0-py2.7.egg/markdown/__init__.pyc'
>>> markdown.Markdown().convert("[Odyssey](https://apollo.open-resource.org/mission:tech:odyssey)")
u'<p><a href="https://apollo.open-resource.org/mission:tech:odyssey">Odyssey</a></p>'
>>>

This is sad but I'm going to declare it not a mediagoblin bug unless someone else seriously objects. What it looks like is happening is that turning on safe mode means that it breaks links with colons in them. I'm not sure how to fix that, but I think turning off safe mode is a bad idea?

If we really think this is safe, maybe a patch to markdown upstream is proper to declare colons to be safe?

comment:5 by Christopher Allan Webber, 12 years ago

Resolution: wontfix
Status: newclosed

Marking as wontfix because I think it should be updated on markdown's end.

comment:6 by Christopher Allan Webber, 12 years ago

Resolution: wontfix
Status: closedreopened

Optionally we could stop using markdown's cleaning pass because we already doing it via lxml.html.clean, but I'm not sure that's a good idea?

Reopening. If someone wants to look into the way markdown's clenaing works and compare it to what we're already doing via lxml.html.clean, that would be interesting to know.

comment:7 by Jakob Kramer, 12 years ago

I filed this as a bug upstream.

comment:8 by Christopher Allan Webber, 12 years ago

Resolution: fixed
Status: reopenedclosed

Alright, I'm content to close this then.

comment:9 by Jakob Kramer, 12 years ago

Resolution: fixed
Status: closedreopened

We still have to fix it. Just disable python-markdown’s "safe mode."

comment:10 by Jakob Kramer, 12 years ago

Owner: set to Jakob Kramer
Status: reopenedassigned
Last edited 12 years ago by Jakob Kramer (previous) (diff)

comment:11 by joar, 12 years ago

Merged, tested and pushed. Thank you gandaro :)

comment:12 by joar, 12 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.