aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--embed/mozilla/mozilla-embed.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp
index f5f600934..77d11b224 100644
--- a/embed/mozilla/mozilla-embed.cpp
+++ b/embed/mozilla/mozilla-embed.cpp
@@ -428,8 +428,18 @@ mozilla_embed_get_uri_parent (MozillaEmbed *membed,
nsCString encoding;
rv = membed->priv->browser->GetEncoding (encoding);
if (NS_FAILED (rv)) return FALSE;
-
+
+ /* Check for HTML anchors */
nsCOMPtr<nsIURI> uri;
+ const char *anchor = strrchr (aUri, '#');
+ if (anchor)
+ {
+ aParent.Assign (aUri);
+ aParent.SetLength (anchor - aUri);
+
+ return TRUE;
+ }
+
rv = EphyUtils::NewURI (getter_AddRefs(uri), nsCString(aUri), encoding.get());
if (NS_FAILED(rv) || !uri) return FALSE;