#6387: Markdown for Python v1.7 support needed in contrib.markup -- handling of
unicode data changed
-----------------------------------+----------------------------------------
          Reporter:  cogg          |         Owner:  cogg            
            Status:  reopened      |     Milestone:                  
         Component:  Contrib apps  |       Version:  SVN             
        Resolution:                |      Keywords:  unicode markdown
             Stage:  Unreviewed    |     Has_patch:  1               
        Needs_docs:  0             |   Needs_tests:  1               
Needs_better_patch:  1             |  
-----------------------------------+----------------------------------------
Changes (by italomaia):

  * status:  closed => reopened
  * needs_better_patch:  0 => 1
  * resolution:  fixed =>
  * needs_tests:  0 => 1

Comment:

 This last change breaks markdown for me. Using ubuntu hardy, sqlite3 and
 python-markdown 1.6b1(repository).

 {{{
 return mark_safe(force_unicode(markdown.markdown(smart_str(value),
 extensions, safe_mode=safe_mode)))

 # unicode support only in markdown v1.7 or above.
 # version_info exist only in markdown v1.6.2rc-2 or above.
 if getattr(markdown, "version_info", None) < (1,7):
     return mark_safe(force_unicode(markdown.markdown(smart_str(value),
 extensions, safe_mode=safe_mode)))
 else:
     return mark_safe(markdown.markdown(force_unicode(value), extensions,
 safe_mode=safe_mode))
 }}}

 If i use
 {{{
 return mark_safe(markdown.markdown(force_unicode(value), extensions,
 safe_mode=safe_mode))
 }}}

 The error occors when i have a string with special characters on it, like
 ã or ç.

 Without
 {{{
 if getattr(markdown, "version_info", None) < (1,7):
     return mark_safe(force_unicode(markdown.markdown(smart_str(value),
 extensions, safe_mode=safe_mode)))
 else:
 }}}
 it works great!

-- 
Ticket URL: <http://code.djangoproject.com/ticket/6387#comment:8>
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to