Bug 134329 - links to html anchor on the same page (with # at the end) are reported as broken
Summary: links to html anchor on the same page (with # at the end) are reported as broken
Status: RESOLVED FIXED
Alias: None
Product: klinkstatus
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Paulo Moura Guedes
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-19 15:00 UTC by Petr Sodomka
Modified: 2006-09-23 17:41 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Sodomka 2006-09-19 15:00:07 UTC
Version:            (using KDE KDE 3.5.2)
Installed from:    Ubuntu Packages
OS:                Linux

My valid local anchor urls like http://www.example.com/link# are reported as broken.

It is sometimes used in this context: <a href="#" onclick="....">example</a>
Comment 1 Paulo Moura Guedes 2006-09-23 17:06:40 UTC
BTW, is this  RFC? The browsers I tested act on it jumping to the top of the page but I found nothing on w3.org. It is the same as "#top"? What else is commonly used?
Comment 2 Paulo Moura Guedes 2006-09-23 17:41:02 UTC
SVN commit 587660 by mojo:

BUG: 134329

Accept fragment identifiers like "#" and "#top".

 M  +9 -1      linkchecker.cpp  


--- branches/KDE/3.5/kdewebdev/klinkstatus/src/engine/linkchecker.cpp #587659:587660
@@ -505,6 +505,14 @@
 {
     KURL url(linkStatus()->absoluteUrl());
     Q_ASSERT(url.hasRef());
+    
+    QString ref = url.ref();
+    if(ref == "" || ref == "top") {
+        linkstatus_->setStatus("OK");
+        finnish();
+        return;
+    }
+
     QString url_base;
     LinkStatus const* ls_parent = 0;
     int i_ref = -1;
@@ -535,7 +543,7 @@
 void LinkChecker::checkRef(KURL const& url)
 {
     Q_ASSERT(search_manager_);
-
+    
     QString url_string = url.url();
     KHTMLPart* html_part = search_manager_->htmlPart(url_string);
     if(!html_part)