Re: Storing HTML: HTML entities being rendered in that raw form

Поиск
Список
Период
Сортировка
Искать
От
Marco Colombo
Тема
Re: Storing HTML: HTML entities being rendered in that raw form
Дата
Msg-id
49DF0ACB.3000508@esiway.net
Ответ на
Список
Дерево обсуждения
Re: Storing HTML: HTML entities being rendered in that raw form linnewbie <linnewbie@gmail.com>
Re: Storing HTML: HTML entities being rendered in that raw form Richard Huxton <dev@archonet.com>
Re: Storing HTML: HTML entities being rendered in that raw form Marco Colombo <pgsql@esiway.net>
linnewbie wrote:
> On Apr 9, 1:00 pm, st...@blighty.com (Steve Atkins) wrote:
>> On Apr 9, 2009, at 9:27 AM, linnewbie wrote:
>>
>>> Hi all,
>>> I have stored HTML in a text field that I subsequently render on the
>>> web.  However when I retrieve and render this data on the web I  am
>>> getting the entities being rendered in their raw form, ie, instead of
>>> getting the '&' symbol when '&' is stored  I'm getting the 'raw'
>>> '&'.
>>> I would be grateful if anyone can point out how I can get around this.
>> It's a problem in your code, not the database. You're probably
>> escaping it one time to many or unescaping it one time too few.
>>
>> Cheers,
>>    Steve
>>
>> --
>> Sent via pgsql-general mailing list (pgsql-gene...@postgresql.org)
>> To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-general
> 
> To clarify, I am not escaping the string in any way.
> 
> Say the page I am saving the database is the about us page form a
> company website.
> First, make a from to create the about us page in a  text area field,
> then I copy the
> html from my text editor and past it ino this text area from.  I then
> have a cgi script which
> takes the contents from the text area field and stores it in the
> database.
> 
> What I have on disk would be:
> 
> ................................
> ..............................
> 

Bonnie & Clyde

> > which would usually be rendered as: > > Bonnie & Clype > > but this is not happening, it's being rendered > as: > > Bonnie & Clyde That's because, as someone else suggested, something is quoting the &. In order to be rendered 'Bonnie & Clyde' by the browser, it needs to be 'Bonnie &amp; Clyde' in the HTML (just view the HTML source from inside the browser). You haven't provided any detail on the rendering phase, BTW. .TM.
В списке pgsql-general по дате отправления
От: Richard Huxton
Дата:
От: Raymond O'Donnell
Дата:
FAQ