[pmwiki-users] Markup that process "fulltext" with (:blah:)....(:blahend:), but I want re-eval of some of the data in between
Christopher Cox
chriscox at endlessnow.com
Sat Oct 31 15:03:06 PDT 2026
On 10/31/26 5:15 AM, Petko Yotov wrote:
> Your code seems to work for me, the text is included and the markup in the
> included text is processed.
Strange. I whittled my config.php down to the very basics with just my
flexrow.php included and, again, while the (:include SomeGroup/SomePage:) text
comes into the flex container, it's not evaluated.
My SomeGroup/SomePage contains:
!! Banner
Some text.
And that is literally what I see, instead of a 2nd level heading of Banner.
I'm running latest.
Confused. I added a crappy text thing I could match on to the front of lines to
run MarkupToHTML on it with Keep and used that as my ugly workaround.
Normal includes work just fine, just not this way using my recipe.
>
> I would place your markup not at 'fulltext' but at '>include' or '<split', this
> way it would be evaluated once the included sections are already inserted. See ?
> action=ruleset.
>
> You don't need to call PRR() for every line, just once anywhere in your
> function. Or for your case never.
>
> PRR() tells the markup engine that later, after you return some text, it should
> rerun all previous markup rules from the start up to yours, for the lines from
> the start up to yours.
>
> Petko
>
>
>
> On 30/10/2026 17:22, Christopher Cox wrote:
>> On 10/29/26 11:37 PM, Christopher Cox wrote:
>>> So, as I iterate on the lines of my "sourceblock" (hopefully you understand
>>> that). If I have, for example (:include SomeGroup/SomePage:), the text of
>>> the page does come in, but it's not evaluated as pmwiki markup like if you
>>> normally did the include.
>>>
>>> So, my markup output html things using Keep, then the (:include SomeGroup/
>>> SomePage:) but again, I get the markup text and not the markup interpreted text.
>>> I tried PRR, but that didn't seem to help this case.
>>>
>>> It's late, sorry for being terse and not trying to include actual code.
>>> Hopefully "you know the issue" and can make a suggestion.
>> Here's the markup in it's gory-ness. Any comments welcome, but mainly
>> interested why (:include SomeGroup/SomePage:) which includes, but with no
>> pmwiki eval of the markup of the included page. Probably an ordering or
>> something, and
>> I've tried a few things, but without success so far.
>>
>> <?php if (!defined('PmWiki')) exit();
>>
>> /*
>> flexrow.php
>>
>> Row of contained things
>>
>> Example:
>>
>> (:flexrow:)
>> item1
>> item2
>> ...
>> (:flexrowend:)
>> */
>>
>> $RecipeInfo['FlexRow']['Version'] = '2026-10-29';
>>
>>
>> Markup(
>> 'flexrow',
>> 'fulltext',
>> '/\\(:flexrow:\\)(.*?)\\(:flexrowend:\\)/si',
>> "FlexRowMarkup"
>> );
>>
>> function FlexRowMarkup($m)
>> {
>> extract($GLOBALS["MarkupToHTML"]); # get $pagename
>>
>> @list($m0, $sourceblock) = $m;
>>
>> $sourcelines = preg_split('/\R/', $sourceblock);
>>
>> $flexrow = Keep("<div style='display:flex; gap: 1rem; background-color:
>> transparent; flex-wrap: wrap;'>\n");
>> foreach ($sourcelines as $line) {
>> if (trim($line) === '' || trim($line) === '<:vspace>') {
>> continue;
>> }
>> error_log("line: [" . $line . "]");
>> $flexrow .= Keep("<div style='flex: 1 1 300px; overflow: hidden;'>\n");
>> $flexrow .= PRR($line) . "\n";
>> $flexrow .= Keep("</div>\n");
>> }
>> $flexrow .= Keep("</div>\n");
>> return $flexrow;
>> }
>>
>
More information about the pmwiki-users
mailing list