[pmwiki-users] pmwiki-2.2.0-beta41 released (leading spaces update)

Patrick R. Michaud pmichaud at pobox.com
Tue Mar 27 10:35:48 CDT 2007


On Tue, Mar 27, 2007 at 10:30:53AM +0200, christian.ridderstrom at gmail.com wrote:
> On Mon, 26 Mar 2007, Patrick R. Michaud wrote:
> 
> >Values greater than 1 for $EnableWSPre can be used to indicate a minimum 
> >number of initial spaces required to indicate a preformatted text block.
> 
> Does this handle lines starting with a TAB?  

Tabs are considered to be a single whitespace character here.
But it's okay to give tabs their own markup rule:

    # lines beginning with tabs are always preformatted text
    Markup('^tab', '<^ ', '^\t', '<:pre,1>$0');

Lots of browsers have difficulty entering tabs into textareas, which
is why I haven't relied on this for anything I do.

> >I'm also looking at the possibility of introducing (:wspre:), 
> >(:nowspre:), and (:wspre #:) markups so that the leading whitespace rule 
> >can be selectively enabled and changed within page markups.
> 
> I think those could be more verbose, or merely have a more verbose 
> alternative... not that I have an immediate suggestion unfortunately.
> 
> How about '(:$EnableWSpre=0:)' etc?  It's still not easy to understand, 
> but at least closer to what you have in the configuration file.

No, I don't want it to look like we're setting a variable (even if that's
what we're doing) -- directives should indicate the result we're trying to
achieve, not how it's to be done.  (Because "how it's to be done" could
easily change at some point in the future.)

Thus we say (:notitle:), (:nofooter:), (:spacewikiwords:) and the like
without reference to the corresponding PHP variables or settings.

> Or possibly a directive for preformatted text in general, i.e. (:pre:), 
> that you can give different arguments to?  

This might also be possible.  But notice that the (:wspre:) option
I discussed above already provides some of this capability:

    (:wspre:)
       this is preformatted text
    (:nowspre:)

I don't think we need two separate directives for this -- so perhaps
"wspre" is just "pre" and it allows a variety of arguments that
can determine how preformatted text is identified/rendered for
the page (at least until the next (:pre:) directive).

Pm




More information about the pmwiki-users mailing list