Lucas_Werkmeister_WMDE added a comment.

  It looks like this happens in this condition in 
`HtmlPageLinkRendererBeginHookHandler::doHtmlPageLinkRendererBegin`:
  
    // if custom link text is given, there is no point in overwriting it
    // but not if it is similar to the plain title
    if ( $text !== null && $target->getFullText() !== HtmlArmor::getHtml( $text 
) ) {
        return true;
    }
  
  `$target->getFullText()` is `Property:P31`, but `HtmlArmor::getHtml( $text )` 
is `P:P31`. So we think the user has set some custom text that we don’t want to 
override.
  
  Looking at the `$target` object (a `Title`) in the debugger, I don’t see any 
trace of the original namespace in there, so I think the price to pay for this 
feature will be that even `[[Property:P31|P:P31]]` will be formatted just like 
`[[Property:P31]]` or `[[P:P31]]`, ignoring the custom text the user specified. 
I suppose that’s acceptable, though.
  
  So I think the way to fix this will be to refine that condition – perhaps 
instead of comparing the title’s text with the link text, parse the link text 
back into a title and see if it’s the same as the title?

TASK DETAIL
  https://phabricator.wikimedia.org/T223904

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Lucas_Werkmeister_WMDE
Cc: Lydia_Pintscher, Lucas_Werkmeister_WMDE, Aklapper, DSGalaktos, 
darthmon_wmde, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, 
_jensen, rosalieper, Wikidata-bugs, aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to