Hi Rich,
I'm not a hook expert, so not sure about this. But, the
https://www.mediawiki.org/wiki/Manual:Hooks/OutputPageBeforeHTML manual
shows that it acts on both $out and $text. Furthermore, the talk page says
that using the first could lead to an infinite loop, so I'd suggest using
$text for the '...tbd...
There's also an example in the talk page.
https://www.mediawiki.org/wiki/Manual_talk:Hooks/OutputPageBeforeHTML
Greg Rundlett
https://eQuality-Tech.com
https://freephile.org