On Wed, Mar 2, 2011 at 11:50 PM, Niklasro <nikla...@gmail.com> wrote:
> Hi
> I got problems with escape displaying like junk when upgrading from
> django 0.96 to 1.2 with google app engine.
> The code is
>
>     # let user choose authenticator
>        for p in openIdProviders:
>            p_name = p.split('.')[0] # take "AOL" from "AOL.com"
>            p_url = p.lower()        # "AOL.com" -> "aol.com"
>            loginmsg = loginmsg + '<a href="%s">%s</a> ' % ( #'','')
>                   users.create_login_url(federated_identity=p_url),
> p_name)
>        loginmsg = loginmsg + '<a href=\"%s\">%s</a>' %
> ('login',_("Log in"))
>
> And the output is strange. View source show this:
>
> <ul><li><a href="ai">Add</a></li><li><a href="li">03 Mar</a></li>
>
> <li>Log in&lt;a href=&quot;google.com&quot;&gt;Google&lt;/a&gt; &lt;a
> href=&quot;google.com&quot;&gt;Yahoo&lt;/a&gt; &lt;a
> href=&quot;google.com&quot;&gt;MySpace&lt;/a&gt; &lt;a
> href=&quot;google.com&quot;&gt;AOL&lt;/a&gt; &lt;a
> href=&quot;login&quot;&gt;Log in&lt;/a&gt;</li>
>
> </ul>
>
> Can you make ad advice how to proceed? Many thanks,

IIRC, at some point after v0.96, Django made
HTML-character-entity-escaping of values in templates the default
behavior; your code assumes the opposite, hence your excessive
escaping problem. I'm sure there's a way to indicate that certain
values should be treated literally and not get HTML-escaped.

Check the transition docs / release notes, and/or try asking on the
django-specific mailing list
(http://groups.google.com/group/django-users )
(You should probably ask there first with any future Django questions too.)

Cheers,
Chris
--
http://blog.rebertia.com
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to