changeset 33000:59b2e0e41434

fix XREF in urls of octaves help collection (bug #65285) * documentation.cc (handle_index_clicked): replace #XREF by #index- in help urls
author Torsten Lilge <ttl-octave@mailbox.org>
date Sat, 10 Feb 2024 13:39:44 +0100
parents 7ab350607296
children 4fb466fb717e
files libgui/src/documentation.cc
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/documentation.cc	Fri Feb 09 21:46:35 2024 -0500
+++ b/libgui/src/documentation.cc	Sat Feb 10 13:39:44 2024 +0100
@@ -1103,9 +1103,14 @@
 documentation_browser::handle_index_clicked (const QUrl& url, const QString&)
 {
   if (url.scheme () == "qthelp")
-    setSource (url);
+    {
+      // URL wihtin the help system, replace #XREF by #index-
+      QString u = url.toString ();
+      u.replace ("#XREF", "#index-");
+      setSource (QUrl (u));
+    }
   else
-    QDesktopServices::openUrl (url);
+    QDesktopServices::openUrl (url);  // URL outside help system
 }
 
 void