Merge "Fix broken reference popup when name contains # character"

This commit is contained in:
jenkins-bot 2023-12-14 10:45:50 +00:00 committed by Gerrit Code Review
commit ab64229a4d

View file

@ -16,17 +16,16 @@ module.exports = function () {
* @param {jQuery.Event} ev Click event of the reference element
*/
function showReference( ev ) {
var urlComponents,
$dest = $( ev.currentTarget ),
var $dest = $( ev.currentTarget ),
href = $dest.attr( 'href' );
ev.preventDefault();
// If necessary strip the URL portion of the href so we are left with the
// fragment
urlComponents = href.split( '#' );
if ( urlComponents.length > 1 ) {
href = '#' + urlComponents[ 1 ];
var i = href.indexOf( '#' );
if ( i > 0 ) {
href = href.slice( i );
}
references.showReference( href, currentPage, $dest.text(),