The code on this page does the following:
We define 「old_print_html」 to do what 「print_html」 currently does and we define 「print_html」 to do what 「new_print_html」 does. Writing it this way avoids the error “Deep recursion on subroutine …”
「new_print_html」 gets the output of 「old_print_html」 and it uses 「link_social_media」 to fiddle with the HTML, and then returns that instead.
「link_social_media」 changes the HTML output using search and replace: every time a social media handle gets mentioned, like “@kensanata@twitter.com” or “@kensanata@octodon.social” it gets shown as “@kensanata” and is linked to an appropriate target URL.
This would be a way to add fancier HTML to the HTML side without having to add extra markup to the gemtext.
package MyConfig; use Modern::Perl; use App::Phoebe::Web;