diff options
author | Marcos ChavarrÃa Teijeiro <chavarria1991@gmail.com> | 2014-11-12 10:28:42 +0100 |
---|---|---|
committer | David King <amigadave@amigadave.com> | 2015-06-22 13:32:35 +0100 |
commit | 901b4fb82e007e9d93deb3f1e13cc36d5b2bf37b (patch) | |
tree | 2007392a342967c526c412dfb5b5a97175883de7 /libyelp/yelp-uri-builder.c | |
parent | 7a2f5fc0ab4709d82de7748080dfe920407b763d (diff) | |
download | yelp-901b4fb82e007e9d93deb3f1e13cc36d5b2bf37b.tar.gz |
yelp-view: Implement web extension to load resources
I have split the libyelp library into two parts in order to avoid linking the webextension against libyelp. So now we have a libyelpuri with the yelp-uri, yelp-build-uri and their dependecies and the old libyelp with the remaining files. I have modified the yelp-build-uri logic to not have to use yelp-document because it implies to have to add to the new library most of libyelp classes.
Diffstat (limited to 'libyelp/yelp-uri-builder.c')
-rw-r--r-- | libyelp/yelp-uri-builder.c | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/libyelp/yelp-uri-builder.c b/libyelp/yelp-uri-builder.c index 3c195e03..49ee0246 100644 --- a/libyelp/yelp-uri-builder.c +++ b/libyelp/yelp-uri-builder.c @@ -24,17 +24,12 @@ #define BOGUS_PREFIX_LEN 6 gchar * -build_network_uri (YelpUri *uri, YelpDocument *document) +build_network_uri (gchar *uri) { SoupURI *soup_uri; - gchar *bogus_scheme; - gchar *canonical; - gchar *path; - gchar *retval; + gchar *bogus_scheme, *path, *retval; - canonical = yelp_uri_get_canonical_uri (uri); - soup_uri = soup_uri_new (canonical); - g_free (canonical); + soup_uri = soup_uri_new (uri); /* Build the URI that will be passed to WebKit. Relative URIs will be automatically reolved by WebKit, so we need to add a leading slash to @@ -60,22 +55,6 @@ build_network_uri (YelpUri *uri, YelpDocument *document) g_free (path); } - /* We don't have actual page and frag IDs for DocBook. We just map IDs - of block elements. The result is that we get xref:someid#someid. - If someid is really the page ID, we just drop the frag reference. - Otherwise, normal page views scroll past the link trail. - */ - if (soup_uri->fragment && YELP_IS_DOCBOOK_DOCUMENT (document)) { - gchar *page_id = yelp_uri_get_page_id (uri); - gchar *real_id = yelp_document_get_page_id (document, page_id); - - if (g_str_equal (real_id, soup_uri->fragment)) - soup_uri_set_fragment (soup_uri, NULL); - - g_free (real_id); - g_free (page_id); - } - /* We need to use a different scheme from help or ghelp to be able to deal with absolute uris in the HTML. Help uri schemes are help:gnome-help/... they dont have a slash after the colon so WebKit resolves them as a relative |