Back-references not consideres all tags in a document, not just the first one

This commit is contained in:
Veronica K. B. Olsen
2020-05-25 21:14:50 +02:00
parent e7f0751275
commit 3b7927f0ff
8 changed files with 81 additions and 34 deletions
+14 -4
View File
@@ -107,7 +107,11 @@ class GuiDocViewDetails(QWidget):
for tHandle in theRefs:
tItem = self.theProject.projTree[tHandle]
if tItem is not None:
theList.append("<a href='#tag=%s'>%s</a>" % (tHandle,tItem.itemName))
theList.append("<a href='#tag=%s:%s'>%s</a>" % (
tHandle, theRefs[tHandle], tItem.itemName
))
# print(theList)
self.refList.setText(", ".join(theList))
self.refList.adjustSize()
@@ -122,9 +126,15 @@ class GuiDocViewDetails(QWidget):
"""Capture the link-click and forward it to the document viewer
class for handling.
"""
if len(theLink) == 18:
tHandle = theLink[-13:]
self.theParent.viewDocument(tHandle)
logger.verbose("Clicked link: '%s'" % theLink)
if len(theLink) == 26:
tHandle = theLink[5:18]
tLine = theLink[19:26]
if tLine[1:].isdigit():
nLine = int(tLine[1:])
else:
nLine = 1
self.theParent.viewDocument(tHandle, nLine)
return
def _doShowHide(self, chState):