Re: [Django] #20568: templatetag truncatewords_html split words containing HTML entities

2013-10-08 Thread Django
#20568: templatetag truncatewords_html split words containing HTML entities
---+
 Reporter:  yann0@…|Owner:  jaap3
 Type:  Bug|   Status:  closed
Component:  Utilities  |  Version:  master
 Severity:  Normal |   Resolution:  fixed
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by Tim Graham ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"40b95a24ae159b6600457a23d6c2779a18037b7b"]:
 {{{
 #!CommitTicketReference repository=""
 revision="40b95a24ae159b6600457a23d6c2779a18037b7b"
 Fixed #20568 -- truncatewords_html no longer splits words containing HTML
 entities.

 Thanks yann0 at hotmail.com for the report.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/075.20de7b3ed7d54484305ba174f51afbcb%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #20568: templatetag truncatewords_html split words containing HTML entities

2013-07-05 Thread Django
#20568: templatetag truncatewords_html split words containing HTML entities
---+
 Reporter:  yann0@…|Owner:  jaap3
 Type:  Bug|   Status:  assigned
Component:  Utilities  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by jaap3):

 * status:  new => assigned
 * owner:  nobody => jaap3
 * has_patch:  0 => 1


Comment:

 Noticed that the `django.utils.text` module already had an
 `unescape_entities` function. So I created this pull request:

 https://github.com/django/django/pull/1332

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/075.06ad606691e4d16efd2de1a30a22f17b%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #20568: templatetag truncatewords_html split words containing HTML entities

2013-07-05 Thread Django
#20568: templatetag truncatewords_html split words containing HTML entities
---+
 Reporter:  yann0@…|Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Utilities  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by jaap3):

 What about converting html entities back to chars before the regex? Just
 whipped up a quick proof of concept that seems to work fine (and uses just
 stdlib code)

 {{{
 >>> import xml.sax.saxutils
 >>> import htmlentitydefs
 >>> entity2unicode = dict([('&%s;' % k, unichr(v)) for k, v in
 htmlentitydefs.name2codepoint.items()])
 >>> truncatewords_html(xml.sax.saxutils.unescape(s, entity2unicode), 8)
 u'Depuis mars 2008, le programme RECYC-FRIGO d\u2019Hydro-Qu\xe9bec ...'
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/075.82c915d4c7ba5d1ba3942525eca76430%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #20568: templatetag truncatewords_html split words containing HTML entities (was: templatetag truncatewords_html split words on special caracters)

2013-06-15 Thread Django
#20568: templatetag truncatewords_html split words containing HTML entities
---+
 Reporter:  yann0@…|Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Utilities  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by bmispelon):

 * cc: bmispelon@… (added)
 * version:  1.3 => master
 * stage:  Unreviewed => Accepted


Comment:

 Hi,

 Thanks for reopening this, there does appear to be an issue.

 I made some quick tests and it seems that this behavior has always been
 present.

 The problem seems to be that the regexp used to split words [1] doesn't
 consider a `&` to be part of a word, hence the behavior.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/075.0d22b3c1231f24d8c80aca43ab8ca7fc%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.