Opened 9 years ago

Closed 8 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 :)

Subtickets

Change History (12)

comment:1 Changed 9 years ago by Jakob Kramer

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

comment:2 Changed 8 years ago by Christopher Allan Webber

Component: component1programming

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

comment:3 in reply to:  2 Changed 8 years ago by Jakob Kramer

python-markdown

comment:4 Changed 8 years ago by Christopher Allan Webber

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 Changed 8 years ago by Christopher Allan Webber

Resolution: wontfix
Status: newclosed

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

comment:6 Changed 8 years ago by Christopher Allan Webber

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 Changed 8 years ago by Jakob Kramer

I filed this as a bug upstream.

comment:8 Changed 8 years ago by Christopher Allan Webber

Resolution: fixed
Status: reopenedclosed

Alright, I'm content to close this then.

comment:9 Changed 8 years ago by Jakob Kramer

Resolution: fixed
Status: closedreopened

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

comment:10 Changed 8 years ago by Jakob Kramer

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

comment:11 Changed 8 years ago by joar

Merged, tested and pushed. Thank you gandaro :)

comment:12 Changed 8 years ago by joar

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