Django

Code

Ticket #6387 (closed: fixed)

Opened 6 months ago

Last modified 3 months ago

Markdown for Python v1.7 support needed in contrib.markup -- handling of unicode data changed

Reported by: cogg Assigned to: cogg
Milestone: Component: Contrib apps
Version: SVN Keywords: unicode markdown
Cc: waylan@gmail.com, yatiohi@ideopolis.gr, jerojasro@gmail.com, roderikk@gmail.com, django@jensdiemer.de Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

In v1.7rc1 Markdown moved to expecting unicode and always returning unicode. This causes the utf-8 encoding method that django.contrib.markup currently uses to generate incorrect encodings.

I am attaching a patch that changes the Markdown version and correctly passes unicode if the version is high enough.

Attachments

markdown-1.7-support.diff (0.9 kB) - added by cogg on 01/16/08 16:45:41.
Support for Markdown for Python v1.7rc1 and later
markdown-1.7-support2.diff (1.0 kB) - added by jedie on 03/27/08 03:38:17.
markdown-1.7-support2.2.diff (1.0 kB) - added by Dmitri Fedortchenko <zeraien@gmail.com> on 03/31/08 17:04:27.
Minor syntax error in previous patch, : missing from if statement. Corrected.

Change History

01/15/08 23:25:23 changed by cogg

  • owner changed from nobody to cogg.
  • status changed from new to assigned.

Link to mailing list announcement that describes changes to markdown. Relevant bit:

Additionally, the `encoding` argument has been removed from both `markdown` and
`Markdown`. Markdown expects unicode (or ascii) input and it is the
users responsibility to ensure that's what is provided. Therefore, all
output is in unicode. Only `markdownFromFile` accepts an encoding.

01/16/08 16:45:41 changed by cogg

  • attachment markdown-1.7-support.diff added.

Support for Markdown for Python v1.7rc1 and later

02/11/08 13:27:43 changed by wayla

  • cc set to waylan@gmail.com.

There is a duplicate of this at #6577 with some additional comments.

02/17/08 11:59:01 changed by ctrochalakis

  • cc changed from waylan@gmail.com to waylan@gmail.com, yatiohi@ideopolis.gr.

02/20/08 09:37:45 changed by anonymous

  • cc changed from waylan@gmail.com, yatiohi@ideopolis.gr to waylan@gmail.com, yatiohi@ideopolis.gr, jerojasro@gmail.com.

03/24/08 14:11:13 changed by anonymous

  • cc changed from waylan@gmail.com, yatiohi@ideopolis.gr, jerojasro@gmail.com to waylan@gmail.com, yatiohi@ideopolis.gr, jerojasro@gmail.com, roderikk@gmail.com.

The patch works fine. How can we get this implemented?

03/27/08 03:37:50 changed by jedie

  • cc changed from waylan@gmail.com, yatiohi@ideopolis.gr, jerojasro@gmail.com, roderikk@gmail.com to waylan@gmail.com, yatiohi@ideopolis.gr, jerojasro@gmail.com, roderikk@gmail.com, django@jensdiemer.de.

The patch didn't work for older version of markdown! The version_info added in v1.6.2rc-2 previous versions has no version_info, see: http://python-markdown.svn.sourceforge.net/viewvc/python-markdown/markdown.py?r1=30&r2=31&pathrev=94

I will attached a new patch.

03/27/08 03:38:17 changed by jedie

  • attachment markdown-1.7-support2.diff added.

03/31/08 17:04:27 changed by Dmitri Fedortchenko <zeraien@gmail.com>

  • attachment markdown-1.7-support2.2.diff added.

Minor syntax error in previous patch, : missing from if statement. Corrected.

04/14/08 21:00:16 changed by mtredinnick

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [7423]) Fixed #6387 -- Updated markdown filter to handle markdown-1.7 as well as earlier versions. Patch from cogg, jedie and Dmitri Fedortchenko.


Add/Change #6387 (Markdown for Python v1.7 support needed in contrib.markup -- handling of unicode data changed)




Change Properties
Action