RE: code blocks in blog posts

rand-kzPqTZqrtG+O+QkcXTtFxKWz8mPg4b/[email protected] Sat, 27 Mar 2004 14:24:03 -0700
Newsgroups gmane.comp.pythin.pyds.devel
Message-ID <[email protected]>
Hi,

> Hmm. They _shouldn't_ be recoded. But there are some weird situations
> where this might happen - maybe some problem with a browser. But there
> _may_ be still a bug that some textarea doesn't get properly encoded
> characters from PyDS. Where did you try to enter the code exactly?
> There
> were some of those problems in older versions, but I thought I fixed
> all.

I put the following in part of a post via the Weblog Edit page:

-------start snip-------
Here's the python code:

def blogrollRenderer(self, blogrollURL='c:\\somefiles\\mySubscriptions.opml'):
    import xmlrpclib
    server = xmlrpclib.Server("http://rpc.activerenderer.com")

    opmlFile = open(blogrollURL)
    opml = opmlFile.read()
    opmlFile.close()

    opmlHtml = server.activeRenderer.opmlRenderer(opml)

    html = ''
    html += '<b>Blogroll</b>'
    html += '<link rel="stylesheet" type="text/css" \
            href="http://www.activerenderer.com/activeRenderer/activerenderer.css">'
    html += '<script type="text/javascript" \
            src="http://www.activerenderer.com/activeRenderer/activerenderer.js"></script>'
    html += opmlHtml
    html += '<br>'

    return html
-------end snip-------

If I enter it exactly as above, then when it renders, it interprets all of the embedded html tags. So in the
edit mode, I replaced all of the < and > with their escaped versions (&lt; and &gt;). When I go back in for a
subsequent edit (not a normal practice for my posts, but necessary while I was trying to get this formatting
correct), the escaped character encodings have been replaced with the < and >, so I need to re-replace them all
manually again. Luckily it was a short snip of code! ;)

I'll look into the SilverCity goods, and Ian Bicking's suggestion on CSS, shortly to see how that might help.

Thx,
Rand