#4881: strange behaviour of rst from django.contrib.markup
----------------------------+-----------------------------------------------
Reporter: Rafael Weber | Owner: adrian
Status: closed | Component: Contrib apps
Version: SVN | Resolution: fixed
Keywords: | Stage: Unreviewed
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
----------------------------+-----------------------------------------------
Changes (by anonymous):
* status: reopened => closed
* resolution: => fixed
Comment:
Hmm -- I uploaded the patch but the trac shows that the file is empty (not
correct, the patch is in the file).
So, here is the patch:
{{{
#!diff
Index: django/trunk/django/contrib/markup/templatetags/markup.py
===================================================================
@@ -42,18 +42,17 @@
def restructuredtext(value):
try:
- from docutils.core import publish_parts
+ from docutils.core import publish_string
except ImportError:
if settings.DEBUG:
raise template.TemplateSyntaxError, "Error in {%
restructuredtext %} filter: The Python docutils library isn't installed."
return force_unicode(value)
else:
docutils_settings = getattr(settings,
"RESTRUCTUREDTEXT_FILTER_SETTINGS", {})
- parts = publish_parts(source=smart_str(value),
writer_name="html4css1", settings_overrides=docutils_settings)
- return force_unicode(parts["fragment"])
+ result = publish_string(source=smart_str(value),
writer_name="html4css1", settings_overrides=docutils_settings)
+ return force_unicode(result)
register.filter(textile)
register.filter(markdown)
register.filter(restructuredtext)
-
}}}
Sorry for this two attachments but it didn't work though the patch was in
the correct file.
--
Ticket URL: <http://code.djangoproject.com/ticket/4881#comment:3>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---