[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
Sun Nov 1 07:36:12 PST 2026
Completed screenshots (light and dark themes) of the flexrow markup with videos
and include.
https://endlessnow.com/images/flexbox-video-light.png
https://endlessnow.com/images/flexbox-video-dark.png
On 11/1/26 9:12 AM, Christopher Cox wrote:
> On 11/1/26 1:39 AM, Petko Yotov wrote:
>> Oh, I misread your message, did not understand that you had (:include ...:) as
>> one of the lines inside your directive. I was doing the opposite, include your
>> directive from another page.
>>
>> I suspect the heading is not recognized because headings need the !! marks to
>> appear at the start of a line. In your output, your function outputs
>> everything on one line, and you have something like
>>
>> (Keep Token)(Keep Token)!! Banner
>>
>> See how the !! is not first thing on the line, there is no line break before
>> it. Actually your output has (:include...:) which is later processed and
>> inserts the heading in the middle of the line.
>>
>> I suspect inline markup like %red%Banner%% does render the red text.
>
> Very very very helpful, thanks. Put line endings in and voila!! Thanks again.
>
> Got rid of the keep extras mentioned from my other message as well. I guess I
> could reply there for completeness.
>
>>
>> Petko
>>
>>
>>
>> On 31/10/2026 23:03, Christopher Cox wrote:
>>> 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;
>>>>> }
>>>>>
>>>>
>>>
>>>
>>> _______________________________________________
>>> pmwiki-users mailing list
>>> pmwiki-users at pmichaud.com
>>> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>>
>
>
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
More information about the pmwiki-users
mailing list