And sometimes I want articles inserted in my slug, but it's an unusual case. For example, a title like 'This is the way this works' gets reduced to 'way-works', which is not very useful. But I can easily tweak the slug by hand. I think the occasional desire to blog about HTML entities is a similar case.
Beside that, dammit, it just feels wrong to type *&* without *amp;*. Added note for clarity-- I'm also referring to urlify.js here... If I'm not mistaken, slugify() handles things a little less stringently. On Wed, Jul 7, 2010 at 12:06 PM, Luke Plant <l.plant...@cantab.net> wrote: > On Wed, 2010-07-07 at 21:27 +0800, Russell Keith-Magee wrote: > > On Wed, Jul 7, 2010 at 4:00 AM, C. Alan Zoppa <alan.zo...@gmail.com> > wrote: > > > I occasionally enter special characters as HTML entities (e.g. “, > > > ®, etc.) in an object's title. I feel that slugify() would be more > > > useful if these were removed entirely from the returned slug. For > example: > > > At the moment, a title of “Object Title ” returns the slug > > > "ldquoobject-titlerdquo." It is my opinion that "object-title" would be > more > > > useful in this situation. > > > > I can't think of any way that ldquo et al could be considered helpful > > in a slug, so yes -- this sounds like a bug to me. > > > > Really? I thought Jerome was right here - slugify should be applied > *before* escaping. Alan seems to be storing HTML in the model itself, > if I understand correctly, and wanting the HTML escaped string to > produce nice slugs with slugify. That would require slugify to > un-HTML-escape first, which would strictly speaking be incorrect for > some people. (e.g. the pathological case - a blog post with the title > "Why you see < and > in RSS feeds" - the slug would be > why-you-see-lt-and-gt-in-rss-feeds, not why-you-see-and-in-rss-feeds) > > The normal way to do this is to store special characters as unicode > characters, and apply slugify to that, which works fine. > > Luke > > -- > "Where a person wishes to attract, they should always be ignorant." > (Jane Austen) > > Luke Plant || http://lukeplant.me.uk/ > > -- > You received this message because you are subscribed to the Google Groups > "Django developers" group. > To post to this group, send email to django-develop...@googlegroups.com. > To unsubscribe from this group, send email to > django-developers+unsubscr...@googlegroups.com<django-developers%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/django-developers?hl=en. > > -- C. Alan Zoppa Web Developer Open PGP: 0x322D2EA7 F60F D3F8 E89C 10A3 1403 5CA8 D50D 0CE2 322D 2EA7 "It is an astonishing fact about our species that we understand so much about the history of the universe, the forces that make it tick, the stuff it’s made of, the origin of living things and the machinery of life. A failure to nurture this knowledge shows a philistine indifference to the magnificent achievements humanity is capable of, like allowing a great work of art to molder in a warehouse." (Steven Pinker) -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.