diff options
author | Shaun McCance <shaunm@gnome.org> | 2009-08-26 15:38:46 -0500 |
---|---|---|
committer | Shaun McCance <shaunm@gnome.org> | 2009-08-26 16:57:07 -0500 |
commit | 6c3b1b8514ab656b609cb45a22e1585ee5d6f8c0 (patch) | |
tree | 93693da66d970b18d613b7e616d2b842dd5c1cfe | |
parent | a1bf8d358e5df30d82306a26d74233f1c6843e51 (diff) | |
download | yelp-6c3b1b8514ab656b609cb45a22e1585ee5d6f8c0.tar.gz |
Make anchor jumping work for Mallard documents
-rw-r--r-- | src/yelp-window.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/yelp-window.c b/src/yelp-window.c index b2ae6bd8..23169243 100644 --- a/src/yelp-window.c +++ b/src/yelp-window.c @@ -2573,7 +2573,7 @@ window_about_cb (GtkAction *action, YelpWindow *window) { const gchar *copyright = "Copyright © 2001-2003 Mikael Hallendal\n" - "Copyright © 2003-2005 Shaun McCance\n" + "Copyright © 2003-2009 Shaun McCance\n" "Copyright © 2005-2006 Don Scorgie\n" "Copyright © 2005-2006 Brent Smith"; const gchar *authors[] = { @@ -2852,9 +2852,16 @@ window_write_html (YelpLoadData *data) gchar contents[BUFFER_SIZE]; /* Use a silly fake URI to stop gecko doing silly things */ - if (data->window->priv->current_frag) - uri = g_strdup_printf ("%s#%s", data->window->priv->base_uri, - data->window->priv->current_frag); + if (data->window->priv->current_frag) { + /* FIXME: more of this terrible slash hack */ + gchar *slash, *jump_id; + slash = strchr (data->window->priv->current_frag, '/'); + if (slash) + jump_id = slash + 1; + else + jump_id = data->window->priv->current_frag; + uri = g_strdup_printf ("%s#%s", data->window->priv->base_uri, jump_id); + } else uri = g_strdup (data->window->priv->base_uri); |