[Seaside] [BUG] in IAHtmlParser

Avi Bryant avi@beta4.com
Fri, 29 Mar 2002 11:01:50 -0800 (PST)


On Fri, 29 Mar 2002, Alain Fischer wrote:

> Eventually, if I understand well enough your parser, I will try to add
> some warning in the case we found a close tag after the open tag is
> supposed to be already closed. It seem to me that a solution like this
> could be very simple but I must go deeper in my understanding of the
> parser.

You could do something like:

IAHtmlParser>>closeTag: aTag

  | toClose |

  toClose _ nodeStack reversed
                       detect: [:n | n name = aTag name asLowercase]
                       ifNone: [^ self notify: 'Warning:  lonely </',
                                  aTag name, '>'].
  toClose hadCloseTag: true.
  nodeStack _ nodeStack copyUpTo: toClose.

But I'm not sure I like the notification popping up, and it would be nice
to be able to provide more context.  The really cool way to handle this
would be to hook into the compiler and treat #html methods specially, but
then that doesn't do anything for templates stored in files...
thoughts?