The fix added for https://phabricator.wikimedia.org/T275984 is overly greedy in what it fixes; if you try to display [[Page#Section|Section]] with DisplayTitle enabled, no output shows up.
Similarly, [[Page#Section|ExtraTextHereSection]] has its text truncated to ExtraTextHer.
This is caused by the following block of code:
if ( substr( $text, -$fragmentLength ) === $fragment ) { $textTitle = substr( $text, 0, -( $fragmentLength + 1 ) ); $textFragment = $fragment; } else { $textTitle = $text; $textFragment = ''; }
If we comment the first block and simply write:
$textTitle = $text; $textFragment = '';
then the issue goes away, but I don't know what is needed to preserve the fix for https://phabricator.wikimedia.org/T275984.
(At worst I could gate this behind another setting, if it's impossible to fix this while retaining the SMW fix.)