Index: pathologic.module =================================================================== --- pathologic.module (revision 113) +++ pathologic.module (revision 216) @@ -126,6 +126,16 @@ */ function _pathologic_do_href($matches) { + // If they JUST passed the fragment, pass the current URL and the fragment + // as the second argument. + if (substr($matches[1],0,1) == '#' && !$matches[2]) { + // Get the current URL + $curi = urldecode(request_uri()); // decode URL removes annoying % and ## + $curi = substr($curi, strlen(url()), strlen($curi)); + // Pas the current uri as the first argument, and the fragment minus the + // leading '#' as the second argument. + return 'href="' . _pathologic_url($curi, substr($matches[1],1)) . '"'; + } return 'href="' . _pathologic_url($matches[1], $matches[2]) . '"'; }