From 50fe9be623221ab9d1be3a806e7e536cd50814ce Mon Sep 17 00:00:00 2001 From: Igor Kushnir Date: Wed, 21 Feb 2018 12:48:11 +0200 Subject: [PATCH] Show #link as a tooltip instead of empty "Definition: " Internal links in MediaWiki articles don't lead to word definitions, so the "Definition: " prefix is not correct for them. It also does not provide any information and is largely useless. Perhaps the actual footnote text should be displayed in the tooltip, but this requires distinguishing them from citations/references and backlinks. --- articleview.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/articleview.cc b/articleview.cc index a3a6c808..b8cdd289 100644 --- a/articleview.cc +++ b/articleview.cc @@ -1012,7 +1012,12 @@ void ArticleView::linkHovered ( const QString & link, const QString & , const QS } if( msg.isEmpty() ) - msg = tr( "Definition: %1").arg( def ); + { + if( def.isEmpty() && url.hasFragment() ) + msg = '#' + url.fragment(); // this must be a citation, footnote or backlink + else + msg = tr( "Definition: %1").arg( def ); + } } else {