From chriscox at endlessnow.com Sun Nov 1 07:12:54 2026 From: chriscox at endlessnow.com (Christopher Cox) Date: Sun, 1 Nov 2026 09:12:54 -0600 Subject: [pmwiki-users] Markup that process "fulltext" with (:blah:)....(:blahend:), but I want re-eval of some of the data in between In-Reply-To: <914087d62464b00562654e2081e7c6ca@5ko.fr> References: <78922b47-86b1-45fa-9ae4-9f405a0419de@endlessnow.com> <08a1024aa9a19d851f7247b496e1f898@5ko.fr> <817ec22a-8a70-4a07-8a75-8057feb55e1b@endlessnow.com> <914087d62464b00562654e2081e7c6ca@5ko.fr> Message-ID: <9c01788c-39e3-4b34-8d92-34179386aace@endlessnow.com> 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 '>> 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. >>>> >>>> >>> >>>> /* >>>> ??? 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("
\n"); >>>> ??? foreach ($sourcelines as $line) { >>>> ??????? if (trim($line) === '' || trim($line) === '<:vspace>') { >>>> ??????????? continue; >>>> ??????? } >>>> ??????? error_log("line: [" . $line . "]"); >>>> ??????? $flexrow .= Keep("
\n"); >>>> ??????? $flexrow .= PRR($line) . "\n"; >>>> ??????? $flexrow .= Keep("
\n"); >>>> ??? } >>>> ??? $flexrow .= Keep("
\n"); >>>> ??? return $flexrow; >>>> } >>>> >>> >> >> >> _______________________________________________ >> pmwiki-users mailing list >> pmwiki-users at pmichaud.com >> http://www.pmichaud.com/mailman/listinfo/pmwiki-users > From chriscox at endlessnow.com Sun Nov 1 07:14:13 2026 From: chriscox at endlessnow.com (Christopher Cox) Date: Sun, 1 Nov 2026 09:14:13 -0600 Subject: [pmwiki-users] Strange characters, but only in some cases on Markup parse In-Reply-To: <5cbde0a6dac16ea0476c70e49d5e616f@5ko.fr> References: <6a63314f-4aa2-4e28-b662-e5853a050a2b@endlessnow.com> <5cbde0a6dac16ea0476c70e49d5e616f@5ko.fr> Message-ID: On 11/1/26 1:23 AM, Petko Yotov wrote: > On 31/10/2026 23:59, Christopher Cox wrote: >> https://youtu.be/euLOyGadyDs&list=PLZOfSznMOwYenRt25XSChMwxxim5bKVOx&index=104 >> >> I get (notice the 18B19B at the end): >> >> [31-Oct-2026 17:52:54 America/Chicago] yt site: //youtu.be >> [31-Oct-2026 17:52:54 America/Chicago] yt id and parms: >> euLOyGadyDs&list=PLZOfSznMOwYenRt25XSChMwxxim5bKVOx&index=10418B19B >> >> The difference is the m[4] aspect ratio in quotes is missing, But isn't that >> ok here? (zero or one time)? And I'm still not sure what the 18B19B means? > > In your example, there seems to be no aspect ratio in quotes after the link. > > When I enabled your custom markup, both your links, ending with "4:3", got > correctly found on the page. > > These 18B and 19B may be "keep tokens", some markup or escaped text that was > passed through Keep() and, in the "B" case, expected to be restored just before > markup blocks are processed. > > If so, it is actually $KeepToken + 18B + $KeepToken; each $KeepToken contains 2 > control characters that browsers may not display. > > Note that now people may [=escape=] URLs with special characters to avoid url- > encoding them, e.g. spaces or parentheses like this: > > https://en.wikipedia.org/wiki/[=Wiki (disambiguation)=] > > So the Keep tokens may be part of the URL, to be restored and encoded later. > > You can call RestoreMarkup() to see what was escaped. This too was caused by my custom markup that didn't include line endings after Keeps. Once I fixed that, the problem is now gone. > > Petko > > > On 31/10/2026 23:59, Christopher Cox wrote: >> Consider this cookbook recipe snippet (I'm looking for youtube video links): >> >> Markup('youtu_be_watch','> "/\\b(?>(\\L))(\/\/youtu\.be)\/([^\\s$UrlExcludeChars]+)(\"[0-9]+:[0-9]+\")?/", >> ? "YoutubeWatchLink"); >> >> function YoutubeWatchLink($m) { >> ? extract($GLOBALS["MarkupToHTML"]); # get $pagename >> >> ? $aspectRatio = ''; >> ? error_log('yt site: ' . $m[2]); >> ? error_log('yt id and parms: ' . $m[3]); >> >> ... rest not shown. >> >> >> If on my page I have: >> >> https://youtu.be/3kx24YtwPKA"4:3" >> >> Looking at my debug log messages I see: >> >> [31-Oct-2026 17:47:33 America/Chicago] yt site: //youtu.be >> [31-Oct-2026 17:47:33 America/Chicago] yt id and parms: 3kx24YtwPKA >> >> Which I expect.? This is fine. >> >> But then if I have: >> >> https://youtu.be/euLOyGadyDs&list=PLZOfSznMOwYenRt25XSChMwxxim5bKVOx&index=104 >> >> I get (notice the 18B19B at the end): >> >> [31-Oct-2026 17:52:54 America/Chicago] yt site: //youtu.be >> [31-Oct-2026 17:52:54 America/Chicago] yt id and parms: >> euLOyGadyDs&list=PLZOfSznMOwYenRt25XSChMwxxim5bKVOx&index=10418B19B >> >> The difference is the m[4] aspect ratio in quotes is missing, But isn't that >> ok here? (zero or one time)? And I'm still not sure what the 18B19B means? >> >> I may just be failing regexp school. >> >> _______________________________________________ >> pmwiki-users mailing list >> pmwiki-users at pmichaud.com >> http://www.pmichaud.com/mailman/listinfo/pmwiki-users > From chriscox at endlessnow.com Sun Nov 1 07:36:12 2026 From: chriscox at endlessnow.com (Christopher Cox) Date: Sun, 1 Nov 2026 09:36:12 -0600 Subject: [pmwiki-users] Markup that process "fulltext" with (:blah:)....(:blahend:), but I want re-eval of some of the data in between In-Reply-To: <9c01788c-39e3-4b34-8d92-34179386aace@endlessnow.com> References: <78922b47-86b1-45fa-9ae4-9f405a0419de@endlessnow.com> <08a1024aa9a19d851f7247b496e1f898@5ko.fr> <817ec22a-8a70-4a07-8a75-8057feb55e1b@endlessnow.com> <914087d62464b00562654e2081e7c6ca@5ko.fr> <9c01788c-39e3-4b34-8d92-34179386aace@endlessnow.com> Message-ID: 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 '>>> 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. >>>>> >>>>> >>>> >>>>> /* >>>>> ??? 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("
\n"); >>>>> ??? foreach ($sourcelines as $line) { >>>>> ??????? if (trim($line) === '' || trim($line) === '<:vspace>') { >>>>> ??????????? continue; >>>>> ??????? } >>>>> ??????? error_log("line: [" . $line . "]"); >>>>> ??????? $flexrow .= Keep("
\n"); >>>>> ??????? $flexrow .= PRR($line) . "\n"; >>>>> ??????? $flexrow .= Keep("
\n"); >>>>> ??? } >>>>> ??? $flexrow .= Keep("
\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