Re: textile does not replace &?

"Roberto Antonio Ferreira De Almeida" <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
Aslak Raanes said:
> På 6. okt 2004 kl. 11:18 skrev Gábor Farkas:
>> it seems that the textile pyblosxom plugin does not replace '&'.
>> if i write a blog entry with the text "a&b", i get "a&b" in the html
>> file.

> I think Roberto De Almeida explained why in the latest release of
> pytextile (...)

Actually, I was wrong. :)

I thought that ampersands shouldn't be escaped inside <pre> tags, because
if you wrote "&amp;" inside the <pre> it would be rendered literally as
such. A simple test proved me wrong, and I found that the standards are
very clear -- "&" should always be escaped as "&amp;".

I just released a new version of Pytextile (2.0.10) that _tries_ to escape
unescaped ampersands. A regular expression is smart enough to not escape
"&amp;" as "&amp;amp;", for example; it also handles numeric entities
correctly as far as I can tell.

Anyway, I would still recomend that if you want the textile plugin to
generate valid XHTML, install either mx.Tidy or uTidyLib and set
VALIDATE=1. You can set the flag on your config.py with the key
config['txtl_validate']=1, or directly on the textile.py file.

Regards,

Roberto

-- 
Roberto De Almeida <[email protected]>
this email is: [ ] bloggable [ ] ask first [ ] private [x] nonsense


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.