Is there a safe way to make a change to code in a core Grav Module, so it won’t be overridden next time I update grav?
A case in point right now is that the page summary hard truncates at the summary size set in the Admin panel with ellipsis. I would rather that it truncated on word boundary. A quick look through the code reveals that the summary is generated in
/system/src/Grav/Common/Page/Page.php
on line 712 which says
$summary = Utils::truncateHtml($content, $size);
It is easy to change this to
$summary = Utils::safeTruncateHtml($content, $size);
which gives the desired result but is this the right thing to do?
I did a grep on safeTruncateHtml and it appears to be defined, but unused in my installation