This approach adds the title without conflicting with the custom label feature. It doesn't require any changes to the bbcode class, because `intval()` implicitly strips any non-numeric content that follows a number.
See #2668
<classname>wcf\system\bbcode\WoltLabSuitePageBBCode</classname>
<attributes>
<attribute name="0">
- <validationpattern><![CDATA[^\d+$]]></validationpattern>
+ <validationpattern><![CDATA[^\d+(?:#.+)$]]></validationpattern>
<required>1</required>
</attribute>
<attribute name="1">
_click: function (event) {
event.preventDefault();
- _callbackSelect(elData(event.currentTarget, 'page-id'));
+ var page = event.currentTarget;
+ var pageTitle = elBySel('h3', page).textContent.replace(/['"]/g, '');
+
+ _callbackSelect(elData(page, 'page-id') + '#' + pageTitle);
UiDialog.close(this);
},