diff options
author | Shaun McCance <shaunm@shaunmlxlap.localdomain> | 2009-06-10 10:28:20 -0500 |
---|---|---|
committer | Shaun McCance <shaunm@shaunmlxlap.localdomain> | 2009-06-10 10:28:20 -0500 |
commit | acaffb022ca65788a873f5ca6ab73b3a4f54dd34 (patch) | |
tree | e0b80add069c50b8a4ed7a3fa20d5b1fd257e428 | |
parent | 42fd63e585f33786824adcf78c4487bdb18155ce (diff) | |
download | yelp-acaffb022ca65788a873f5ca6ab73b3a4f54dd34.tar.gz |
[yelp-window.c] Hacky temporary solution to handle links to mallard sections
-rw-r--r-- | src/yelp-window.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/yelp-window.c b/src/yelp-window.c index ab5f119c..a59e91d9 100644 --- a/src/yelp-window.c +++ b/src/yelp-window.c @@ -1140,6 +1140,7 @@ yelp_window_load (YelpWindow *window, const gchar *uri) } if (doc) { + gchar *slash; gboolean need_hist = FALSE; if (!frag_id) frag_id = g_strdup ("x-yelp-index"); @@ -1151,6 +1152,15 @@ yelp_window_load (YelpWindow *window, const gchar *uri) window_setup_window (window, type, real_uri, frag_id, (gchar *) uri, current_base, need_hist); + /* FIXME: Super hacky. We want the part before the slash for mallard IDs, + because right now we're outputting "#page_id/section_id". We ought to + be scrolling to the section as well. I happen to know that get_page is + just going to strdup the string, and we free frag_id itself immediately + after this, so this is safe. It just sucks. + */ + slash = strchr (frag_id, '/'); + if (slash) + *slash = '\0'; priv->current_request = yelp_document_get_page (doc, frag_id, (YelpDocumentFunc) page_request_cb, |