summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libyelp/yelp-view.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libyelp/yelp-view.c b/libyelp/yelp-view.c
index 8593063b..69239fcd 100644
--- a/libyelp/yelp-view.c
+++ b/libyelp/yelp-view.c
@@ -1428,8 +1428,16 @@ view_navigation_requested (WebKitWebView *view,
YelpViewPrivate *priv = GET_PRIV (view);
YelpUri *uri;
- if (g_str_has_prefix (requri, BOGUS_URI))
+ if (priv->bogus_uri &&
+ g_str_has_prefix (requri, priv->bogus_uri) &&
+ requri[strlen(priv->bogus_uri)] == '#') {
+ gchar *tmp = g_strconcat("xref:", requri + strlen(priv->bogus_uri), NULL);
+ uri = yelp_uri_new_relative (priv->uri, tmp);
+ g_free (tmp);
+ }
+ else if (g_str_has_prefix (requri, BOGUS_URI)) {
uri = yelp_uri_new_relative (priv->uri, requri + BOGUS_URI_LEN);
+ }
else
uri = yelp_uri_new_relative (priv->uri, requri);