|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r59137 - trunk/tools/inspect
From: daniel_james_at_[hidden]
Date: 2010-01-18 14:24:13
Author: danieljames
Date: 2010-01-18 14:24:13 EST (Mon, 18 Jan 2010)
New Revision: 59137
URL: http://svn.boost.org/trac/boost/changeset/59137
Log:
Fix some false positives in the the bookmark checker.
- Don't check if the fragment is invalid.
- Don't check it it's empty (`<a href="#">` links to the top of the page).
- Percent decode the fragment before checking.
Text files modified:
trunk/tools/inspect/link_check.cpp | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
Modified: trunk/tools/inspect/link_check.cpp
==============================================================================
--- trunk/tools/inspect/link_check.cpp (original)
+++ trunk/tools/inspect/link_check.cpp 2010-01-18 14:24:13 EST (Mon, 18 Jan 2010)
@@ -332,10 +332,10 @@
++m_bookmark_errors;
error( library_name, source_path, string(name()) + " invalid bookmark: " + decoded_url );
}
- if ( !no_link_errors && url_path.empty()
+ else if ( !no_link_errors && url_path.empty() && !fragment.empty()
// w3.org recommends case-sensitive broken bookmark checking
// since some browsers do a case-sensitive match.
- && bookmarks.find(fragment) == bookmarks.end() )
+ && bookmarks.find(decode_percents(fragment)) == bookmarks.end() )
{
++m_bookmark_errors;
error( library_name, source_path, string(name()) + " unknown bookmark: " + decoded_url );
@@ -361,7 +361,7 @@
}
}
- // Decode percent and ampersand encoded characters.
+ // Decode percent encoded characters.
string decoded_path = decode_percents(url_path);
if(decoded_path.empty()) {
if(!no_link_errors) {
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk