Bug 134329

Summary: links to html anchor on the same page (with # at the end) are reported as broken
Product: [Frameworks and Libraries] klinkstatus Reporter: Petr Sodomka <pesmail2003>
Component: generalAssignee: Paulo Moura Guedes <kde>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

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)