Andy Armstrong <[EMAIL PROTECTED]> writes:
> For that to work I have to rely on HTML::Parser issuing a tag
> callback as soon as it sees the closing character of a tag - if it
> reads ahead then it will have already digested text beyond the
> <include /> tag by the time it issues the callback for the <include /
> > tage.
>
> I can easily check what the current behaviour is - and I shall - but
> there's no contract that I can see about the relationship between the
> text that HTML::Parser has read via a callback and when the handlers
> trigger. So even if it works now it could potentially change in the
> future - I don't want to rely on undocumented behaviour.
>
> So, is what I'm proposing sensible?
Seems so to me. You can depend on any complete tag to be reported
before $p->parse(), passing in the corresponding text, returns. This
is implicitly documented by the description of $p->eof that says that
its effect is to flush any remaining _text_.
One caveat is that your tag will not be recognized inside tags that
force literal text content. For instance:
<textarea>
<include />
</textarea>
Here <include /> will be parsed as text whatever you do.
--Gisle