[pmwiki-users] Re: Undesired space combined with (:if ...:)
Dominique Faure
dominique.faure.1 at free.fr
Sun Aug 7 11:11:37 CDT 2005
At Sunday, August 07, 2005 5:32 PM [GMT+1=CET], Patrick R. Michaud wrote:
> On Sun, Aug 07, 2005 at 09:50:56AM +0200, chr at home.se wrote:
>> Just a thought... would it make sense to do an
>> initial conversion step that replaces blank lines with a special
>> marker/markukp? Then it doesn't matter if later blank lines are created
>> in intermediate steps, since you'll still be able to separate these from
>> the initially blank lines.
>
> I looked into this possibility once and decided it doesn't quite work.
> But thinking about it more, perhaps it can. The problem is knowing
> when to do the conversion step -- consider:
>
> Some text
> (:include SomePage:)
> More text
>
> If we do the blank-line markers only once before the (:include:),
> then the included text's blank lines aren't marked. If we do it
> after an (:include:) has been processed which is what currently
> happens), then the (:include:) itself generates extra blank lines
> that get marked. More directly, consider:
>
> Text
> (:if false:)
> Text
> (:ifend:)
> More text
> (:include SomePage:)
> Still more text
>
> The processing basically goes like:
>
> 1. Mark blank lines (there are none, initially)
> 2. Process the (:if:)...(:ifend:). This results in an unmarked
> blank line, so far so good.
> 3. Process the (:include:)
> 4. The (:include:) requires reprocessing the text, to mark its
> blank lines and process any [=...=] and (:if:) markups in
> the included text, which ends up marking the blank line
> that formed in step 2.
>
> The answer appears to be to have step 4 do the reprocessing of previous
> markups only on the included text, but it's not entirely that simple.
> However, the possibility I hadn't considered until now is to do the
> marking of blank lines only on the included text, and then start
> the reprocessing from the top. That might work.
>
Why not improving a bit the CondText() function to return something else
than an empty string (a marker) which could be removed later (by a dedicated
markup rule)?
Regards,
Dom
More information about the pmwiki-users
mailing list