[yelp] Unbreak simple #fragment links, bug #671018
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp] Unbreak simple #fragment links, bug #671018
- Date: Wed, 29 Feb 2012 02:30:31 +0000 (UTC)
commit 57839d52cd6ca476b59f6bc8d0f44cbb90b3cc3c
Author: Shaun McCance <shaunm gnome org>
Date: Tue Feb 28 21:29:43 2012 -0500
Unbreak simple #fragment links, bug #671018
libyelp/yelp-view.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/libyelp/yelp-view.c b/libyelp/yelp-view.c
index 8593063..69239fc 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]