[pmwiki-devel] Testing empty string (was:php logic question)

Patrick R. Michaud pmichaud at pobox.com
Wed Mar 14 08:08:09 CDT 2007


On Wed, Mar 14, 2007 at 01:46:32PM +0100, christian.ridderstrom at gmail.com wrote:
> >In general PmWiki doesn't report "syntax errors", if only because I'm 
> >not sure of a good way to do so.  I suppose I could always insert text 
> >into the markup in such cases.
> 
> How about treating it the same as all other markup that isn't recognized, 
> i.e. letting
> 	(:if "" :)
> 	bla
> 	(:ifend:)
> render as
> 	(:if "" :)
> 	bla
> 	(:ifend:)
> instead of treating the condition as true.

What would we do with...?

    (:if ! name HomePage:)
    foo
    (:elseif "":)
    bar
    (:else:)
    baz
    (:if:)

PmWiki won't even discover the syntax error on pages with a
name other than "HomePage", so what should it render in
this case?  

> Here's another thought regarding syntax errors and warnings.
> 
> What if each error/warning was appended to some variable, e.g. 
> $PmWikiErrors and $PmWikiWarnings, which you could then optionally show at 
> the end of the page if you so desire.

Somehow I think it's much better to have warnings displayed
as they occur in the markup, rather than save them to the end
and try to remap them to their source location.

Pm



More information about the pmwiki-devel mailing list