? print-735260.patch
Index: print.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/print/print.admin.inc,v
retrieving revision 1.1.2.29
diff -u -p -r1.1.2.29 print.admin.inc
--- print.admin.inc	3 Oct 2009 15:18:23 -0000	1.1.2.29
+++ print.admin.inc	8 Mar 2010 19:46:47 -0000
@@ -42,6 +42,13 @@ function print_main_settings() {
                       t('Note that you can enable/disable the URL list for each content type individually from the !url.', array('!url' => l(t('Content Types page'), 'admin/content/types'))),
   );
 
+  $form['settings']['print_urls_anchors'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Include anchors in printer-friendly URLs list'),
+    '#default_value' => variable_get('print_urls_anchors', PRINT_URLS_ANCHORS_DEFAULT),
+    '#description' => t('If set, the list of the URLs at the bottom of the page will include anchors links on the same page.'),
+  );
+
   $form['settings']['print_comments'] = array(
     '#type' => 'checkbox',
     '#title' => t('Include comments in printer-friendly version'),
Index: print.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/print/print.module,v
retrieving revision 1.25.2.79
diff -u -p -r1.25.2.79 print.module
--- print.module	11 Jan 2010 15:40:12 -0000	1.25.2.79
+++ print.module	8 Mar 2010 19:46:47 -0000
@@ -47,6 +47,7 @@ define('PRINT_FOOTER_OPTIONS_DEFAULT', 1
 define('PRINT_FOOTER_USER_DEFAULT', '');
 define('PRINT_CSS_DEFAULT', '');
 define('PRINT_URLS_DEFAULT', 1);
+define('PRINT_URLS_ANCHORS_DEFAULT', 1);
 define('PRINT_COMMENTS_DEFAULT', 0);
 define('PRINT_NEWWINDOW_DEFAULT', 1);
 
Index: print.pages.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/print/print.pages.inc,v
retrieving revision 1.1.2.59
diff -u -p -r1.1.2.59 print.pages.inc
--- print.pages.inc	11 Jan 2010 19:55:52 -0000	1.1.2.59
+++ print.pages.inc	8 Mar 2010 19:46:48 -0000
@@ -370,6 +370,7 @@ function _print_rewrite_urls($matches) {
   }
 
   $size = count($attribs);
+  $include_anchors = variable_get('print_urls_anchors', PRINT_URLS_ANCHORS_DEFAULT);
   for ($i=1; $i < $size; $i++) {
     // If the attribute is href or src, we may need to rewrite the URL in the value
     if (preg_match('!^(?:href|src)\s*?=(.*)!i', $attribs[$i], $urls) > 0) {
@@ -381,20 +382,22 @@ function _print_rewrite_urls($matches) {
       }
       else {
         if ($url[0] == '#') {
-          // URL is an anchor tag
-          if (!empty($_print_urls)) {
-            $path = explode('/', $_GET['q']);
-            unset($path[0]);
-            $path = implode('/', $path);
-            if (is_numeric($path)) {
-              $path = "node/$path";
+          if ($include_anchors) {
+            // URL is an anchor tag
+            if (!empty($_print_urls)) {
+              $path = explode('/', $_GET['q']);
+              unset($path[0]);
+              $path = implode('/', $path);
+              if (is_numeric($path)) {
+                $path = "node/$path";
+              }
+              // Printer-friendly URLs is on, so we need to make it absolute
+              $newurl = url($path, array('fragment' => substr($url, 1), 'absolute' => TRUE));
             }
-            // Printer-friendly URLs is on, so we need to make it absolute
-            $newurl = url($path, array('fragment' => substr($url, 1), 'absolute' => TRUE));
+            // Because base href is the original page, change the link to
+            // still be usable inside the print page
+            $matches[1] = str_replace($url, base_path() . $_GET['q'] . $url, $matches[1]);
           }
-          // Because base href is the original page, change the link to
-          // still be usable inside the print page
-          $matches[1] = str_replace($url, base_path() . $_GET['q'] . $url, $matches[1]);
         }
         else {
           // URL is relative, convert it into absolute URL
