[wp-trac] Re: [WordPress Trac] #8446: Using Slug-Data in CSS
Classes does not work
WordPress Trac
wp-trac at lists.automattic.com
Sat May 23 06:28:57 GMT 2009
#8446: Using Slug-Data in CSS Classes does not work
-------------------------------------+--------------------------------------
Reporter: lilyfan | Owner: westi
Type: defect (bug) | Status: closed
Priority: high | Milestone: 2.8
Component: i18n | Version: 2.7
Severity: major | Resolution: fixed
Keywords: has-patch tested commit |
-------------------------------------+--------------------------------------
Comment(by demetris):
Replying to [comment:64 westi]:
> Replying to [comment:62 demetris]:
> > This may very well be a stupid question, but I’ll ask it.
> >
> > Does the CSS class name have to come either from the slug or from the
term ID?
> >
> > Why not get it from the category/tag *name*?
>
> For now the slugs are a good source for this data because they are close
to the sanitised value as an endpoint as they have been reduced down to
ascii + %encoding of other chars. We can easily strip out the %encoded
ones and return a simple ascii version for a good 80% of names.
>
> When we have a better solution for speedily producing names in other
character sets we can revisit the source data for the sanitisation.
Aren’t names, tag names for example, already sanitized?
I’m insisting just to make sure we don’t miss something obvious.
Before asking I did a quick test:
1. I removed the new sanitizing function.
2. I replaced `$tags->slug` with `$tags->name`.
Result:
I got nice UTF-8 CSS class names in my HTML source, in all the scripts of
the world, and then I used the UTF-8 class names in my stylesheet and
everything worked OK. (A few replacements will be needed, obviously, e.g.
replacing spaces with hyphens for the CSS class names.)
If this works with at least UTF-8, then we have UTF-8 and its perfect
subset ASCII already covered, which is a huge improvement over what WP2.7
did.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/8446#comment:66>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list