﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
2132	Markup contrib module return different types for different markups	David Larlet <larlet@…>	Adrian Holovaty	"I want to use '''from django.contrib.markup.templatetags.markup import *''' and after:

{{{
MARKUP_CHOICES = (
    ('textile', 'Textile'),
    ('markdown', 'Markdown'),
    ('restructuredtext', 'ReST'),
)

def save(self):
    markup_func = globals()[self.markup]
    self.content_html = markup_func(self.content)
    super(Post, self).save() # Call the ""real"" save() method.

}}}

It works well for textile and markdown but there is an issue with restructuredtext because it returns unicode and not string so I have to do:

{{{
    self.content_html = str(markup_func(self.content))
}}}


This not really a critical bug but it's annoying because markup functions didn't return the same type... the patch is really easy:
in /django/contrib/markup/templatetags/markup.py, replace :

{{{
return parts[""fragment""]
}}}


by:

{{{
return str(parts[""fragment""])
}}}


I don't know if it's a problem for filters."	defect	closed	Contrib apps		normal	duplicate			Unreviewed	0	0	0	0	0	0
