Hi David,
I wrote WebUtils.HTMLTag in order to parse HTML for the purposes of [a]
validating it (since HTMLTag is fairly strict about structural nesting)
and [b] examining it (think "blackbox regression test suite").
I never imagined it would ever be used to _generate_ HTML. :-)
The pretty print was just for my debugging purposes which is why I
never noticed the %r issue with text.
I see that Ian Bicking already applied your suggestion in cvs earlier
today. I also just ran the test suite and found a couple small problems
which are now fixed.
Can you post an example of using HTMLTag for page generation?
-Chuck
On Monday 11 November 2002 06:28 pm, David McNab wrote:
> Hi,
>
> I've just started using WebWare in CGI mode, and find the HTMLTag
> class to be a worthy foundation for page generation.
>
> But there's something strange in the pprint() method.
> When it's printing out a child item that's pure text, the text is
> formatted with '%r' instead of '%s'.
>
> Is there any reason for this?
>
> It's making my pages look strange, with all text items on the
> generated html page enclosed in quotes.
>
> I've got around this by subclassing HTMLTag and overriding the
> pprint() routine with one that replaces:
>
> wr('%s %r\n' % (spacer, child))
> with
> wr('%s %s\n' % (spacer, child))
>
> That way, the text strings on the page get generated as they should.
>
> Is the original '%r' formatting a bug or a feature?
>
> Cheers
> David
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Webware-discuss mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/webware-discuss
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss