﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
19988	django.contrib.humanize : ordinal returns escaped HTML code in some languages	maxime.lorant@…	Garry Polley	"Hi guys,

I found that the ordinal filter returns escaped HTML in some languages, due to the translation. In English, the filter make this:

 {{ 1|ordinal }} becomes 1st
 {{ 2|ordinal }} becomes 2nd

In French, the expected behavior is:

 {{ 1|ordinal }} becomes 1^er^
 {{ 2|ordinal }} becomes 2^e^

However, with Django 1.4 and 1.5 (haven't try with older versions but do we really care now ?), I got: 
 
 {{ 1|ordinal }} becomes 1<sup>er</sup>
 {{ 2|ordinal }} becomes 2<sup>e</sup>
 {{ ""2""|ordinal }} becomes 2^e^ (!!!)

As you can see, the HTML is escaped if the argument is a int, and it doesn't if the argument is a string, precisely à SafeString in the filter. I've tried to patch this bug by marking the output string safe, cast the argument in the filter, etc. No success. I think it's possible with a single line, but I hope someone more competent will found this in one second :)

The problem comes from the translation, which can returns HTML in some languages. You can try with LANGUAGE_CODE = 'fr-fr' to test it.

"	Bug	closed	contrib.humanize	1.5	Normal	fixed	humanize ordinal html escaped	Garry Polley	Accepted	1	0	0	0	1	0
