tcl-mod_dtcl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@dedasys.com (David N. Welton)
Subject Re: "escaping" start/close tags in Tcl sections of tcl/html pages
Date Wed, 02 Jan 2002 11:01:33 GMT
Wojciech Kocjan <wojciech@kocjan.org> writes:

> >>Which currently cause problems with the parser.  Thoughts?  Maybe
> >>at the same time, I can make it accept <?dtcl as well as <?,
> >>also...

> >     Hrmmm...  Couldn't we just check to see if we're already in a
> > block of code?

> I suppose a counter would be the easiest way to do it - when started
> it is 0, on evert "<?rivet" it is incremented by 1, on every "?>" it
> is decremented if the counter is >0.

Yes, that's how my new parser works.
 
> However, I suppose a problem would be with XML stuff like this:
> <?rivet
> puts "<?xml version=\"1.0\" encoding=\"$encoding\"?>"
> ?>

Right..hrm...

> It will work with the above example. However, the following is a big
> problem:
> 
> <?rivet
> proc php_end {} {
>      puts "?>"
> }
> proc php_begin {} {
>      puts "<?php "
> }
> 
> php_begin
> puts "echo('test')"
> php_end
> ?>

Yuck, I think we are just going to have to tell people to escape it.
There are too many sneaky things like that.
 
-- 
David N. Welton
   Consulting: http://www.dedasys.com/
Free Software: http://people.debian.org/~davidw/
   Apache Tcl: http://tcl.apache.org/
     Personal: http://www.efn.org/~davidw/

Mime
View raw message