[Zope] <dtml-comment> doesn't? Please fix... ;-)

Andrew Kenneth Milton akm@mail.theinternet.com.au
Mon, 4 Sep 2000 22:08:08 +1000


+-------[ Chris Withers ]----------------------
| Andrew Kenneth Milton wrote:
| > But then you'd have to parse the contents to find out if the comments are
| > properly nested...
| 
| Well, the parsing should be pretty simple:
| 1. find <dtml-comment>
| 2. search for </dtml-comment>

Or <dtml-comment>

| 3. if found:
| 	ignore that block of text
|    else if end of text reached:
| 	bitch like hell ;-)
| 
| What's wrong with that?

It's wrong :-)

<dtml-comment>
crap
more crap
<dtml-comment>
Lots of crap
</dtml-comment>
</dtml-comment>

In order to parse that fragment, you need to parse the blocks in case you
find another opening block, so that you can recursively process comments.

| > I've looked at this briefly today, and the code inside DT_String.py is
| > recursively ugly... d;)
| 
| You do surprise me ;-)
| 
| > It doesn't look difficult to provide what you want, but, I'm not motivated
| > enough to fix it either at this stage. d8)
| 
| Aww... go on, you know you want to really ;-)

Now you know the problem domain, it shouldn't be hard for you to create
a cut-down equivalent of the DT_String parser that only parses comment blocks.

Take you less time than writing these emails I'm sure d;)

-- 
Totally Holistic Enterprises Internet|  P:+61 7 3870 0066   | Andrew Milton
The Internet (Aust) Pty Ltd          |  F:+61 7 3870 4477   | 
ACN: 082 081 472 ABN: 83 082 081 472 |  M:+61 416 022 411   | Carpe Daemon
PO Box 837 Indooroopilly QLD 4068    |akm@theinternet.com.au|